]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
vfs: use helper for calling f_op->fsync()
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 20 Feb 2017 15:51:23 +0000 (16:51 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 20 Feb 2017 15:51:23 +0000 (16:51 +0100)
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/sync.c
include/linux/fs.h
ipc/shm.c

index 2a54c1f2203595823df1bd97680b9a1fb163e400..11ba023434b14bb0075a130a9837426a5fc57b90 100644 (file)
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -192,7 +192,7 @@ int vfs_fsync_range(struct file *file, loff_t start, loff_t end, int datasync)
                spin_unlock(&inode->i_lock);
                mark_inode_dirty_sync(inode);
        }
-       return file->f_op->fsync(file, start, end, datasync);
+       return call_fsync(file, start, end, datasync);
 }
 EXPORT_SYMBOL(vfs_fsync_range);
 
index 93691b59e476ac26f2ac0d347b0a53637c57c255..72a33007ec24ba8ec77b91cbb23580c28d808724 100644 (file)
@@ -1732,6 +1732,12 @@ static inline int call_mmap(struct file *file, struct vm_area_struct *vma)
        return file->f_op->mmap(file, vma);
 }
 
+static inline int call_fsync(struct file *file, loff_t start, loff_t end,
+                            int datasync)
+{
+       return file->f_op->fsync(file, start, end, datasync);
+}
+
 ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
                              unsigned long nr_segs, unsigned long fast_segs,
                              struct iovec *fast_pointer,
index 4329fe3ef5948a434d8547d66f22bec403521bb0..258aff2e03bbc61773a1e7f5a2d8ea4230574910 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -452,7 +452,7 @@ static int shm_fsync(struct file *file, loff_t start, loff_t end, int datasync)
 
        if (!sfd->file->f_op->fsync)
                return -EINVAL;
-       return sfd->file->f_op->fsync(sfd->file, start, end, datasync);
+       return call_fsync(sfd->file, start, end, datasync);
 }
 
 static long shm_fallocate(struct file *file, int mode, loff_t offset,