sio: fix call to vfs_fsync() for newest rhel6 kernels

the number of arguments to vfs_fsync has changed in kernel 2.6.35.
The S_BIAS macro (removed at about the same time in 2.6.35) is used to
detect whether vfs_fsync must be called with 2 or 3 args. In RHEL6
kernels 2.6.32, the removal of S_BIAS was backported, but the change
in vfs_fsync was not. So a check for RHEL_MAJOR < 7 is used in
addition to S_BIAS to find the correct number of args for vfs_fsync
call.

Signed-off-by: Thomas Schoebel-Theuer <tst@1und1.de>
This commit is contained in:
Daniel Hermann 2013-06-20 18:55:15 +02:00 committed by Thomas Schoebel-Theuer
parent 5b523f16f7
commit 83b658467b
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/string.h>
#include <linux/list.h>
#include <linux/types.h>
@ -305,7 +306,7 @@ static void sync_file(struct sio_output *output)
{
struct file *file = output->filp;
int ret;
#ifdef S_BIAS
#if defined(S_BIAS) || (defined(RHEL_MAJOR) && (RHEL_MAJOR < 7))
ret = vfs_fsync(file, file->f_path.dentry, 1);
#else
ret = vfs_fsync(file, 1);