diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2014-08-22 14:22:51 +0900 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2014-08-22 00:20:39 -0500 |
commit | 787aded65044e4cabefcf7eb7576c2dd6b151468 (patch) | |
tree | 43f16f4b5407733662fd975ca8156aef5e545fb4 /fs/cifs/file.c | |
parent | d4a029d21556437b09ffb3207cf2871651bec38f (diff) | |
download | talos-op-linux-787aded65044e4cabefcf7eb7576c2dd6b151468.tar.gz talos-op-linux-787aded65044e4cabefcf7eb7576c2dd6b151468.zip |
cifs: Allow directIO read/write during cache=strict
Currently cifs have all or nothing approach for directIO operations.
cache=strict mode does not allow directIO while cache=none mode performs
all the operations as directIO even when user does not specify O_DIRECT
flag. This patch enables strict cache mode to honour directIO semantics.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index d5fec92e0360..7c018a1c52f7 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -467,6 +467,14 @@ int cifs_open(struct inode *inode, struct file *file) cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n", inode, file->f_flags, full_path); + if (file->f_flags & O_DIRECT && + cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) { + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) + file->f_op = &cifs_file_direct_nobrl_ops; + else + file->f_op = &cifs_file_direct_ops; + } + if (server->oplocks) oplock = REQ_OPLOCK; else |