aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-08-22 10:40:25 -0400
committerJeff Layton <jlayton@primarydata.com>2014-10-07 14:06:12 -0400
commite6f5c78930e409f3a6b37f5484313a416359ac7f (patch)
treee5465ac34a9251be44276f135c8a4f0a5ba4d42e /fs/cifs/cifsfs.c
parent0c637be884f5eaa0ee53396ea7686ec0de03d126 (diff)
locks: plumb a "priv" pointer into the setlease routines
In later patches, we're going to add a new lock_manager_operation to finish setting up the lease while still holding the i_lock. To do this, we'll need to pass a little bit of info in the fcntl setlease case (primarily an fasync structure). Plumb the extra pointer into there in advance of that. We declare this pointer as a void ** to make it clear that this is private info, and that the caller isn't required to set this unless the lm_setup specifically requires it. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index ac4f260155c8..85c70d5969ac 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -800,7 +800,8 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int whence)
800 return generic_file_llseek(file, offset, whence); 800 return generic_file_llseek(file, offset, whence);
801} 801}
802 802
803static int cifs_setlease(struct file *file, long arg, struct file_lock **lease) 803static int
804cifs_setlease(struct file *file, long arg, struct file_lock **lease, void **priv)
804{ 805{
805 /* 806 /*
806 * Note that this is called by vfs setlease with i_lock held to 807 * Note that this is called by vfs setlease with i_lock held to
@@ -815,7 +816,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
815 /* check if file is oplocked */ 816 /* check if file is oplocked */
816 if (((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) || 817 if (((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) ||
817 ((arg == F_WRLCK) && CIFS_CACHE_WRITE(CIFS_I(inode)))) 818 ((arg == F_WRLCK) && CIFS_CACHE_WRITE(CIFS_I(inode))))
818 return generic_setlease(file, arg, lease); 819 return generic_setlease(file, arg, lease, priv);
819 else if (tlink_tcon(cfile->tlink)->local_lease && 820 else if (tlink_tcon(cfile->tlink)->local_lease &&
820 !CIFS_CACHE_READ(CIFS_I(inode))) 821 !CIFS_CACHE_READ(CIFS_I(inode)))
821 /* 822 /*
@@ -826,7 +827,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
826 * knows that the file won't be changed on the server by anyone 827 * knows that the file won't be changed on the server by anyone
827 * else. 828 * else.
828 */ 829 */
829 return generic_setlease(file, arg, lease); 830 return generic_setlease(file, arg, lease, priv);
830 else 831 else
831 return -EAGAIN; 832 return -EAGAIN;
832} 833}