mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Linux 3.1 compat, vfs_fsync()
Preferentially use the vfs_fsync() function. This function was initially introduced in 2.6.29 and took three arguments. As of 2.6.35 the dentry argument was dropped from the function. For older kernels fall back to using file_fsync() which also took three arguments including the dentry. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #52
This commit is contained in:
@@ -50,12 +50,16 @@ spl_filp_open(const char *name, int flags, int mode, int *err)
|
||||
#define spl_filp_poff(f) (&(f)->f_pos)
|
||||
#define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p)
|
||||
|
||||
#ifdef HAVE_3ARGS_FILE_FSYNC
|
||||
#define spl_filp_fsync(fp, sync) (fp)->f_op->fsync((fp), \
|
||||
(fp)->f_dentry, sync)
|
||||
#ifdef HAVE_VFS_FSYNC
|
||||
# ifdef HAVE_2ARGS_VFS_FSYNC
|
||||
# define spl_filp_fsync(fp, sync) vfs_fsync(fp, sync)
|
||||
# else
|
||||
# define spl_filp_fsync(fp, sync) vfs_fsync(fp, (fp)->f_dentry, sync)
|
||||
# endif /* HAVE_2ARGS_VFS_FSYNC */
|
||||
#else
|
||||
#define spl_filp_fsync(fp, sync) (fp)->f_op->fsync((fp), sync)
|
||||
#endif
|
||||
# include <linux/buffer_head.h>
|
||||
# define spl_filp_fsync(fp, sync) file_fsync(fp, (fp)->f_dentry, sync)
|
||||
#endif /* HAVE_VFS_FSYNC */
|
||||
|
||||
#ifdef HAVE_INODE_I_MUTEX
|
||||
#define spl_inode_lock(ip) (mutex_lock(&(ip)->i_mutex))
|
||||
|
||||
Reference in New Issue
Block a user