diff options
author | Brian Behlendorf <[email protected]> | 2011-05-06 12:23:34 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-05-06 12:33:45 -0700 |
commit | 3117dd0b9005eb76e483b9772c493883b82998bb (patch) | |
tree | 48406e7d6154f424879a3f6cf7100f407d16fc95 /include | |
parent | 6ee44e32be259706aed9b1439b71971a165b198c (diff) |
Handle NULL in nfsd .fsync() hook
How nfsd handles .fsync() has been changed a couple of times in the
recent kernels. But basically there are three cases we need to
consider.
Linux 2.6.12 - 2.6.33
* The .fsync() hook takes 3 arguments
* The nfsd will call .fsync() with a NULL file struct pointer.
Linux 2.6.34
* The .fsync() hook takes 3 arguments
* The nfsd no longer calls .fsync() but instead used sync_inode()
Linux 2.6.35 - 2.6.x
* The .fsync() hook takes 2 arguments
* The nfsd no longer calls .fsync() but instead used sync_inode()
For once it looks like we've gotten lucky. The first two cases can
actually be collased in to one if we stop using the file struct
pointer entirely. Since the dentry is still passed in both cases
this is possible. The last case can then be safely handled by
unconditionally using the dentry in the file struct pointer now
that we know the nfsd caller has been removed.
Closes #230
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/vfs_compat.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h index c25cf4477..dce2b6f28 100644 --- a/include/linux/vfs_compat.h +++ b/include/linux/vfs_compat.h @@ -27,19 +27,6 @@ #define _ZFS_VFS_H /* - * 2.6.35 API change, - * The dentry argument to the .fsync() vfs hook was deemed unused by - * all filesystem consumers and dropped. Add a compatibility prototype - * to ensure correct usage when defining this callback. - */ -#ifdef HAVE_2ARGS_FSYNC -#define ZPL_FSYNC_PROTO(fn, x, y, z) static int fn(struct file *x, int z) -#else -#define ZPL_FSYNC_PROTO(fn, x, y, z) static int fn(struct file *x, \ - struct dentry *y, int z) -#endif /* HAVE_2ARGS_FSYNC */ - -/* * 2.6.28 API change, * Added insert_inode_locked() helper function, prior to this most callers * used insert_inode_hash(). The older method doesn't check for collisions |