diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-02-28 06:16:55 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2012-05-16 21:13:35 -0400 |
commit | 04a6aa8acfac51385ec3e72fac1227e15db78ed9 (patch) | |
tree | 72a73c0d451b9f01714e6f2387d120b6ed165403 /fs/cifs | |
parent | fbd35acadd728eac5d94f360c7cd8cbe12a0379f (diff) |
CIFS: Convert lock type to 32 bit variable
to handle SMB2 lock type field further.
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsglob.h | 2 | ||||
-rw-r--r-- | fs/cifs/file.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 03d24a5c9774..0e06de16f34e 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -567,7 +567,7 @@ struct cifsLockInfo { | |||
567 | __u64 offset; | 567 | __u64 offset; |
568 | __u64 length; | 568 | __u64 length; |
569 | __u32 pid; | 569 | __u32 pid; |
570 | __u8 type; | 570 | __u32 type; |
571 | }; | 571 | }; |
572 | 572 | ||
573 | /* | 573 | /* |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fc45cd97e14f..8d5d9c04cd78 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -912,7 +912,8 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | |||
912 | cur->OffsetHigh = cpu_to_le32((u32)(li->offset>>32)); | 912 | cur->OffsetHigh = cpu_to_le32((u32)(li->offset>>32)); |
913 | if (++num == max_num) { | 913 | if (++num == max_num) { |
914 | stored_rc = cifs_lockv(xid, tcon, cfile->netfid, | 914 | stored_rc = cifs_lockv(xid, tcon, cfile->netfid, |
915 | li->type, 0, num, buf); | 915 | (__u8)li->type, 0, num, |
916 | buf); | ||
916 | if (stored_rc) | 917 | if (stored_rc) |
917 | rc = stored_rc; | 918 | rc = stored_rc; |
918 | cur = buf; | 919 | cur = buf; |
@@ -923,7 +924,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | |||
923 | 924 | ||
924 | if (num) { | 925 | if (num) { |
925 | stored_rc = cifs_lockv(xid, tcon, cfile->netfid, | 926 | stored_rc = cifs_lockv(xid, tcon, cfile->netfid, |
926 | types[i], 0, num, buf); | 927 | (__u8)types[i], 0, num, buf); |
927 | if (stored_rc) | 928 | if (stored_rc) |
928 | rc = stored_rc; | 929 | rc = stored_rc; |
929 | } | 930 | } |
@@ -1067,7 +1068,7 @@ cifs_push_locks(struct cifsFileInfo *cfile) | |||
1067 | } | 1068 | } |
1068 | 1069 | ||
1069 | static void | 1070 | static void |
1070 | cifs_read_flock(struct file_lock *flock, __u8 *type, int *lock, int *unlock, | 1071 | cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock, |
1071 | bool *wait_flag) | 1072 | bool *wait_flag) |
1072 | { | 1073 | { |
1073 | if (flock->fl_flags & FL_POSIX) | 1074 | if (flock->fl_flags & FL_POSIX) |
@@ -1111,7 +1112,7 @@ cifs_read_flock(struct file_lock *flock, __u8 *type, int *lock, int *unlock, | |||
1111 | } | 1112 | } |
1112 | 1113 | ||
1113 | static int | 1114 | static int |
1114 | cifs_getlk(struct file *file, struct file_lock *flock, __u8 type, | 1115 | cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, |
1115 | bool wait_flag, bool posix_lck, int xid) | 1116 | bool wait_flag, bool posix_lck, int xid) |
1116 | { | 1117 | { |
1117 | int rc = 0; | 1118 | int rc = 0; |
@@ -1299,7 +1300,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) | |||
1299 | } | 1300 | } |
1300 | 1301 | ||
1301 | static int | 1302 | static int |
1302 | cifs_setlk(struct file *file, struct file_lock *flock, __u8 type, | 1303 | cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, |
1303 | bool wait_flag, bool posix_lck, int lock, int unlock, int xid) | 1304 | bool wait_flag, bool posix_lck, int lock, int unlock, int xid) |
1304 | { | 1305 | { |
1305 | int rc = 0; | 1306 | int rc = 0; |
@@ -1370,7 +1371,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock) | |||
1370 | struct cifsInodeInfo *cinode; | 1371 | struct cifsInodeInfo *cinode; |
1371 | struct cifsFileInfo *cfile; | 1372 | struct cifsFileInfo *cfile; |
1372 | __u16 netfid; | 1373 | __u16 netfid; |
1373 | __u8 type; | 1374 | __u32 type; |
1374 | 1375 | ||
1375 | rc = -EACCES; | 1376 | rc = -EACCES; |
1376 | xid = GetXid(); | 1377 | xid = GetXid(); |