aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 0786f19d288f..92fdf9c35de2 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -224,6 +224,13 @@ cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb,
224 if (backup_cred(cifs_sb)) 224 if (backup_cred(cifs_sb))
225 create_options |= CREATE_OPEN_BACKUP_INTENT; 225 create_options |= CREATE_OPEN_BACKUP_INTENT;
226 226
227 /* O_SYNC also has bit for O_DSYNC so following check picks up either */
228 if (f_flags & O_SYNC)
229 create_options |= CREATE_WRITE_THROUGH;
230
231 if (f_flags & O_DIRECT)
232 create_options |= CREATE_NO_BUFFER;
233
227 oparms.tcon = tcon; 234 oparms.tcon = tcon;
228 oparms.cifs_sb = cifs_sb; 235 oparms.cifs_sb = cifs_sb;
229 oparms.desired_access = desired_access; 236 oparms.desired_access = desired_access;
@@ -1102,8 +1109,10 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
1102 struct cifs_tcon *tcon; 1109 struct cifs_tcon *tcon;
1103 unsigned int num, max_num, max_buf; 1110 unsigned int num, max_num, max_buf;
1104 LOCKING_ANDX_RANGE *buf, *cur; 1111 LOCKING_ANDX_RANGE *buf, *cur;
1105 int types[] = {LOCKING_ANDX_LARGE_FILES, 1112 static const int types[] = {
1106 LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES}; 1113 LOCKING_ANDX_LARGE_FILES,
1114 LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES
1115 };
1107 int i; 1116 int i;
1108 1117
1109 xid = get_xid(); 1118 xid = get_xid();
@@ -1434,8 +1443,10 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
1434 unsigned int xid) 1443 unsigned int xid)
1435{ 1444{
1436 int rc = 0, stored_rc; 1445 int rc = 0, stored_rc;
1437 int types[] = {LOCKING_ANDX_LARGE_FILES, 1446 static const int types[] = {
1438 LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES}; 1447 LOCKING_ANDX_LARGE_FILES,
1448 LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES
1449 };
1439 unsigned int i; 1450 unsigned int i;
1440 unsigned int max_num, num, max_buf; 1451 unsigned int max_num, num, max_buf;
1441 LOCKING_ANDX_RANGE *buf, *cur; 1452 LOCKING_ANDX_RANGE *buf, *cur;