cifs: request oplock when doing open on lookup
authorJeff Layton <jlayton@redhat.com>
Tue, 7 Feb 2012 11:30:52 +0000 (06:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Feb 2012 20:46:17 +0000 (12:46 -0800)
commit 8b0192a5f478da1c1ae906bf3ffff53f26204f56 upstream.

Currently, it's always set to 0 (no oplock requested).

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/dir.c

index d7eeb9d..e4c3334 100644 (file)
@@ -492,7 +492,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
 {
        int xid;
        int rc = 0; /* to get around spurious gcc warning, set to zero here */
-       __u32 oplock = 0;
+       __u32 oplock = enable_oplocks ? REQ_OPLOCK : 0;
        __u16 fileHandle = 0;
        bool posix_open = false;
        struct cifs_sb_info *cifs_sb;