]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/zpl_file.c
Introduce read/write kstats per dataset
[mirror_zfs.git] / module / zfs / zpl_file.c
index 1c5f5e4096371d89016b41e483406e6a4093617d..91251f9e6e0fd986cf5a1d33e620d89972eded93 100644 (file)
@@ -27,6 +27,7 @@
 #ifdef CONFIG_COMPAT
 #include <linux/compat.h>
 #endif
+#include <sys/file.h>
 #include <sys/dmu_objset.h>
 #include <sys/zfs_vfsops.h>
 #include <sys/zfs_vnops.h>
@@ -76,7 +77,7 @@ zpl_release(struct inode *ip, struct file *filp)
 }
 
 static int
-zpl_iterate(struct file *filp, struct dir_context *ctx)
+zpl_iterate(struct file *filp, zpl_dir_context_t *ctx)
 {
        cred_t *cr = CRED();
        int error;
@@ -96,7 +97,8 @@ zpl_iterate(struct file *filp, struct dir_context *ctx)
 static int
 zpl_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
-       struct dir_context ctx = DIR_CONTEXT_INIT(dirent, filldir, filp->f_pos);
+       zpl_dir_context_t ctx =
+           ZPL_DIR_CONTEXT_INIT(dirent, filldir, filp->f_pos);
        int error;
 
        error = zpl_iterate(filp, &ctx);
@@ -104,7 +106,7 @@ zpl_readdir(struct file *filp, void *dirent, filldir_t filldir)
 
        return (error);
 }
-#endif /* HAVE_VFS_ITERATE */
+#endif /* !HAVE_VFS_ITERATE && !HAVE_VFS_ITERATE_SHARED */
 
 #if defined(HAVE_FSYNC_WITH_DENTRY)
 /*
@@ -240,7 +242,6 @@ zpl_read_common_iovec(struct inode *ip, const struct iovec *iovp, size_t count,
 
        read = count - uio.uio_resid;
        *ppos += read;
-       task_io_account_read(read);
 
        return (read);
 }
@@ -337,7 +338,6 @@ zpl_write_common_iovec(struct inode *ip, const struct iovec *iovp, size_t count,
 
        wrote = count - uio.uio_resid;
        *ppos += wrote;
-       task_io_account_write(wrote);
 
        return (wrote);
 }
@@ -965,7 +965,7 @@ const struct file_operations zpl_file_operations = {
 const struct file_operations zpl_dir_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
-#ifdef HAVE_VFS_ITERATE_SHARED
+#if defined(HAVE_VFS_ITERATE_SHARED)
        .iterate_shared = zpl_iterate,
 #elif defined(HAVE_VFS_ITERATE)
        .iterate        = zpl_iterate,