summaryrefslogtreecommitdiff
path: root/fs/aufs/f_op.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aufs/f_op.c')
-rw-r--r--fs/aufs/f_op.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c
index 2baacd7a6..145dec870 100644
--- a/fs/aufs/f_op.c
+++ b/fs/aufs/f_op.c
@@ -688,6 +688,29 @@ out:
return err;
}
+static int aufs_setfl(struct file *file, unsigned long arg)
+{
+ int err;
+ struct file *h_file;
+ struct super_block *sb;
+
+ sb = file->f_path.dentry->d_sb;
+ si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
+
+ h_file = au_read_pre(file, /*keep_fi*/0);
+ err = PTR_ERR(h_file);
+ if (IS_ERR(h_file))
+ goto out;
+
+ arg |= vfsub_file_flags(file) & FASYNC; /* stop calling h_file->fasync */
+ err = setfl(/*unused fd*/-1, h_file, arg);
+ fput(h_file); /* instead of au_read_post() */
+
+out:
+ si_read_unlock(sb);
+ return err;
+}
+
/* ---------------------------------------------------------------------- */
/* no one supports this operation, currently */
@@ -725,6 +748,7 @@ const struct file_operations aufs_file_fop = {
/* .aio_fsync = aufs_aio_fsync_nondir, */
.fasync = aufs_fasync,
/* .sendpage = aufs_sendpage, */
+ .setfl = aufs_setfl,
.splice_write = aufs_splice_write,
.splice_read = aufs_splice_read,
#if 0