diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-06-20 03:21:16 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-07-24 11:25:08 -0400 |
commit | 6d5786a34d98bffb8ad50d8053d1e53231fe0636 (patch) | |
tree | ae49860befc52cb18dfb2b86929878a204289601 /fs/cifs/file.c | |
parent | 2e6e02ab6ddbd539fd7e092973daf057adbd53dc (diff) |
CIFS: Rename Get/FreeXid and make them work with unsigned int
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 133 |
1 files changed, 68 insertions, 65 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index e9a8ac0047c7..93b3b1358409 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -107,7 +107,7 @@ static inline int cifs_get_disposition(unsigned int flags) | |||
107 | 107 | ||
108 | int cifs_posix_open(char *full_path, struct inode **pinode, | 108 | int cifs_posix_open(char *full_path, struct inode **pinode, |
109 | struct super_block *sb, int mode, unsigned int f_flags, | 109 | struct super_block *sb, int mode, unsigned int f_flags, |
110 | __u32 *poplock, __u16 *pnetfid, int xid) | 110 | __u32 *poplock, __u16 *pnetfid, unsigned int xid) |
111 | { | 111 | { |
112 | int rc; | 112 | int rc; |
113 | FILE_UNIX_BASIC_INFO *presp_data; | 113 | FILE_UNIX_BASIC_INFO *presp_data; |
@@ -170,7 +170,7 @@ posix_open_ret: | |||
170 | static int | 170 | static int |
171 | cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb, | 171 | cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb, |
172 | struct cifs_tcon *tcon, unsigned int f_flags, __u32 *poplock, | 172 | struct cifs_tcon *tcon, unsigned int f_flags, __u32 *poplock, |
173 | __u16 *pnetfid, int xid) | 173 | __u16 *pnetfid, unsigned int xid) |
174 | { | 174 | { |
175 | int rc; | 175 | int rc; |
176 | int desiredAccess; | 176 | int desiredAccess; |
@@ -324,11 +324,11 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file) | |||
324 | cancel_work_sync(&cifs_file->oplock_break); | 324 | cancel_work_sync(&cifs_file->oplock_break); |
325 | 325 | ||
326 | if (!tcon->need_reconnect && !cifs_file->invalidHandle) { | 326 | if (!tcon->need_reconnect && !cifs_file->invalidHandle) { |
327 | int xid, rc; | 327 | unsigned int xid; |
328 | 328 | int rc; | |
329 | xid = GetXid(); | 329 | xid = get_xid(); |
330 | rc = CIFSSMBClose(xid, tcon, cifs_file->netfid); | 330 | rc = CIFSSMBClose(xid, tcon, cifs_file->netfid); |
331 | FreeXid(xid); | 331 | free_xid(xid); |
332 | } | 332 | } |
333 | 333 | ||
334 | /* Delete any outstanding lock records. We'll lose them when the file | 334 | /* Delete any outstanding lock records. We'll lose them when the file |
@@ -350,7 +350,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file) | |||
350 | int cifs_open(struct inode *inode, struct file *file) | 350 | int cifs_open(struct inode *inode, struct file *file) |
351 | { | 351 | { |
352 | int rc = -EACCES; | 352 | int rc = -EACCES; |
353 | int xid; | 353 | unsigned int xid; |
354 | __u32 oplock; | 354 | __u32 oplock; |
355 | struct cifs_sb_info *cifs_sb; | 355 | struct cifs_sb_info *cifs_sb; |
356 | struct cifs_tcon *tcon; | 356 | struct cifs_tcon *tcon; |
@@ -360,12 +360,12 @@ int cifs_open(struct inode *inode, struct file *file) | |||
360 | bool posix_open_ok = false; | 360 | bool posix_open_ok = false; |
361 | __u16 netfid; | 361 | __u16 netfid; |
362 | 362 | ||
363 | xid = GetXid(); | 363 | xid = get_xid(); |
364 | 364 | ||
365 | cifs_sb = CIFS_SB(inode->i_sb); | 365 | cifs_sb = CIFS_SB(inode->i_sb); |
366 | tlink = cifs_sb_tlink(cifs_sb); | 366 | tlink = cifs_sb_tlink(cifs_sb); |
367 | if (IS_ERR(tlink)) { | 367 | if (IS_ERR(tlink)) { |
368 | FreeXid(xid); | 368 | free_xid(xid); |
369 | return PTR_ERR(tlink); | 369 | return PTR_ERR(tlink); |
370 | } | 370 | } |
371 | tcon = tlink_tcon(tlink); | 371 | tcon = tlink_tcon(tlink); |
@@ -445,7 +445,7 @@ int cifs_open(struct inode *inode, struct file *file) | |||
445 | 445 | ||
446 | out: | 446 | out: |
447 | kfree(full_path); | 447 | kfree(full_path); |
448 | FreeXid(xid); | 448 | free_xid(xid); |
449 | cifs_put_tlink(tlink); | 449 | cifs_put_tlink(tlink); |
450 | return rc; | 450 | return rc; |
451 | } | 451 | } |
@@ -464,7 +464,7 @@ static int cifs_relock_file(struct cifsFileInfo *cifsFile) | |||
464 | static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) | 464 | static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) |
465 | { | 465 | { |
466 | int rc = -EACCES; | 466 | int rc = -EACCES; |
467 | int xid; | 467 | unsigned int xid; |
468 | __u32 oplock; | 468 | __u32 oplock; |
469 | struct cifs_sb_info *cifs_sb; | 469 | struct cifs_sb_info *cifs_sb; |
470 | struct cifs_tcon *tcon; | 470 | struct cifs_tcon *tcon; |
@@ -476,12 +476,12 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) | |||
476 | int create_options = CREATE_NOT_DIR; | 476 | int create_options = CREATE_NOT_DIR; |
477 | __u16 netfid; | 477 | __u16 netfid; |
478 | 478 | ||
479 | xid = GetXid(); | 479 | xid = get_xid(); |
480 | mutex_lock(&pCifsFile->fh_mutex); | 480 | mutex_lock(&pCifsFile->fh_mutex); |
481 | if (!pCifsFile->invalidHandle) { | 481 | if (!pCifsFile->invalidHandle) { |
482 | mutex_unlock(&pCifsFile->fh_mutex); | 482 | mutex_unlock(&pCifsFile->fh_mutex); |
483 | rc = 0; | 483 | rc = 0; |
484 | FreeXid(xid); | 484 | free_xid(xid); |
485 | return rc; | 485 | return rc; |
486 | } | 486 | } |
487 | 487 | ||
@@ -497,7 +497,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) | |||
497 | if (full_path == NULL) { | 497 | if (full_path == NULL) { |
498 | rc = -ENOMEM; | 498 | rc = -ENOMEM; |
499 | mutex_unlock(&pCifsFile->fh_mutex); | 499 | mutex_unlock(&pCifsFile->fh_mutex); |
500 | FreeXid(xid); | 500 | free_xid(xid); |
501 | return rc; | 501 | return rc; |
502 | } | 502 | } |
503 | 503 | ||
@@ -583,7 +583,7 @@ reopen_success: | |||
583 | 583 | ||
584 | reopen_error_exit: | 584 | reopen_error_exit: |
585 | kfree(full_path); | 585 | kfree(full_path); |
586 | FreeXid(xid); | 586 | free_xid(xid); |
587 | return rc; | 587 | return rc; |
588 | } | 588 | } |
589 | 589 | ||
@@ -601,13 +601,13 @@ int cifs_close(struct inode *inode, struct file *file) | |||
601 | int cifs_closedir(struct inode *inode, struct file *file) | 601 | int cifs_closedir(struct inode *inode, struct file *file) |
602 | { | 602 | { |
603 | int rc = 0; | 603 | int rc = 0; |
604 | int xid; | 604 | unsigned int xid; |
605 | struct cifsFileInfo *pCFileStruct = file->private_data; | 605 | struct cifsFileInfo *pCFileStruct = file->private_data; |
606 | char *ptmp; | 606 | char *ptmp; |
607 | 607 | ||
608 | cFYI(1, "Closedir inode = 0x%p", inode); | 608 | cFYI(1, "Closedir inode = 0x%p", inode); |
609 | 609 | ||
610 | xid = GetXid(); | 610 | xid = get_xid(); |
611 | 611 | ||
612 | if (pCFileStruct) { | 612 | if (pCFileStruct) { |
613 | struct cifs_tcon *pTcon = tlink_tcon(pCFileStruct->tlink); | 613 | struct cifs_tcon *pTcon = tlink_tcon(pCFileStruct->tlink); |
@@ -639,7 +639,7 @@ int cifs_closedir(struct inode *inode, struct file *file) | |||
639 | file->private_data = NULL; | 639 | file->private_data = NULL; |
640 | } | 640 | } |
641 | /* BB can we lock the filestruct while this is going on? */ | 641 | /* BB can we lock the filestruct while this is going on? */ |
642 | FreeXid(xid); | 642 | free_xid(xid); |
643 | return rc; | 643 | return rc; |
644 | } | 644 | } |
645 | 645 | ||
@@ -872,7 +872,8 @@ try_again: | |||
872 | static int | 872 | static int |
873 | cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | 873 | cifs_push_mandatory_locks(struct cifsFileInfo *cfile) |
874 | { | 874 | { |
875 | int xid, rc = 0, stored_rc; | 875 | unsigned int xid; |
876 | int rc = 0, stored_rc; | ||
876 | struct cifsLockInfo *li, *tmp; | 877 | struct cifsLockInfo *li, *tmp; |
877 | struct cifs_tcon *tcon; | 878 | struct cifs_tcon *tcon; |
878 | struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); | 879 | struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); |
@@ -882,13 +883,13 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | |||
882 | LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES}; | 883 | LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES}; |
883 | int i; | 884 | int i; |
884 | 885 | ||
885 | xid = GetXid(); | 886 | xid = get_xid(); |
886 | tcon = tlink_tcon(cfile->tlink); | 887 | tcon = tlink_tcon(cfile->tlink); |
887 | 888 | ||
888 | mutex_lock(&cinode->lock_mutex); | 889 | mutex_lock(&cinode->lock_mutex); |
889 | if (!cinode->can_cache_brlcks) { | 890 | if (!cinode->can_cache_brlcks) { |
890 | mutex_unlock(&cinode->lock_mutex); | 891 | mutex_unlock(&cinode->lock_mutex); |
891 | FreeXid(xid); | 892 | free_xid(xid); |
892 | return rc; | 893 | return rc; |
893 | } | 894 | } |
894 | 895 | ||
@@ -899,7 +900,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | |||
899 | max_buf = tcon->ses->server->maxBuf; | 900 | max_buf = tcon->ses->server->maxBuf; |
900 | if (!max_buf) { | 901 | if (!max_buf) { |
901 | mutex_unlock(&cinode->lock_mutex); | 902 | mutex_unlock(&cinode->lock_mutex); |
902 | FreeXid(xid); | 903 | free_xid(xid); |
903 | return -EINVAL; | 904 | return -EINVAL; |
904 | } | 905 | } |
905 | 906 | ||
@@ -908,7 +909,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | |||
908 | buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); | 909 | buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); |
909 | if (!buf) { | 910 | if (!buf) { |
910 | mutex_unlock(&cinode->lock_mutex); | 911 | mutex_unlock(&cinode->lock_mutex); |
911 | FreeXid(xid); | 912 | free_xid(xid); |
912 | return rc; | 913 | return rc; |
913 | } | 914 | } |
914 | 915 | ||
@@ -947,7 +948,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | |||
947 | mutex_unlock(&cinode->lock_mutex); | 948 | mutex_unlock(&cinode->lock_mutex); |
948 | 949 | ||
949 | kfree(buf); | 950 | kfree(buf); |
950 | FreeXid(xid); | 951 | free_xid(xid); |
951 | return rc; | 952 | return rc; |
952 | } | 953 | } |
953 | 954 | ||
@@ -977,12 +978,12 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile) | |||
977 | struct lock_to_push *lck, *tmp; | 978 | struct lock_to_push *lck, *tmp; |
978 | __u64 length; | 979 | __u64 length; |
979 | 980 | ||
980 | xid = GetXid(); | 981 | xid = get_xid(); |
981 | 982 | ||
982 | mutex_lock(&cinode->lock_mutex); | 983 | mutex_lock(&cinode->lock_mutex); |
983 | if (!cinode->can_cache_brlcks) { | 984 | if (!cinode->can_cache_brlcks) { |
984 | mutex_unlock(&cinode->lock_mutex); | 985 | mutex_unlock(&cinode->lock_mutex); |
985 | FreeXid(xid); | 986 | free_xid(xid); |
986 | return rc; | 987 | return rc; |
987 | } | 988 | } |
988 | 989 | ||
@@ -1054,7 +1055,7 @@ out: | |||
1054 | cinode->can_cache_brlcks = false; | 1055 | cinode->can_cache_brlcks = false; |
1055 | mutex_unlock(&cinode->lock_mutex); | 1056 | mutex_unlock(&cinode->lock_mutex); |
1056 | 1057 | ||
1057 | FreeXid(xid); | 1058 | free_xid(xid); |
1058 | return rc; | 1059 | return rc; |
1059 | err_out: | 1060 | err_out: |
1060 | list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) { | 1061 | list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) { |
@@ -1126,7 +1127,7 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock, | |||
1126 | } | 1127 | } |
1127 | 1128 | ||
1128 | static int | 1129 | static int |
1129 | cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset, | 1130 | cifs_mandatory_lock(unsigned int xid, struct cifsFileInfo *cfile, __u64 offset, |
1130 | __u64 length, __u32 type, int lock, int unlock, bool wait) | 1131 | __u64 length, __u32 type, int lock, int unlock, bool wait) |
1131 | { | 1132 | { |
1132 | return CIFSSMBLock(xid, tlink_tcon(cfile->tlink), cfile->netfid, | 1133 | return CIFSSMBLock(xid, tlink_tcon(cfile->tlink), cfile->netfid, |
@@ -1136,7 +1137,7 @@ cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset, | |||
1136 | 1137 | ||
1137 | static int | 1138 | static int |
1138 | cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, | 1139 | cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, |
1139 | bool wait_flag, bool posix_lck, int xid) | 1140 | bool wait_flag, bool posix_lck, unsigned int xid) |
1140 | { | 1141 | { |
1141 | int rc = 0; | 1142 | int rc = 0; |
1142 | __u64 length = 1 + flock->fl_end - flock->fl_start; | 1143 | __u64 length = 1 + flock->fl_end - flock->fl_start; |
@@ -1221,7 +1222,8 @@ cifs_free_llist(struct list_head *llist) | |||
1221 | } | 1222 | } |
1222 | 1223 | ||
1223 | static int | 1224 | static int |
1224 | cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) | 1225 | cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, |
1226 | unsigned int xid) | ||
1225 | { | 1227 | { |
1226 | int rc = 0, stored_rc; | 1228 | int rc = 0, stored_rc; |
1227 | int types[] = {LOCKING_ANDX_LARGE_FILES, | 1229 | int types[] = {LOCKING_ANDX_LARGE_FILES, |
@@ -1326,7 +1328,8 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) | |||
1326 | 1328 | ||
1327 | static int | 1329 | static int |
1328 | cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, | 1330 | cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, |
1329 | bool wait_flag, bool posix_lck, int lock, int unlock, int xid) | 1331 | bool wait_flag, bool posix_lck, int lock, int unlock, |
1332 | unsigned int xid) | ||
1330 | { | 1333 | { |
1331 | int rc = 0; | 1334 | int rc = 0; |
1332 | __u64 length = 1 + flock->fl_end - flock->fl_start; | 1335 | __u64 length = 1 + flock->fl_end - flock->fl_start; |
@@ -1400,7 +1403,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock) | |||
1400 | __u32 type; | 1403 | __u32 type; |
1401 | 1404 | ||
1402 | rc = -EACCES; | 1405 | rc = -EACCES; |
1403 | xid = GetXid(); | 1406 | xid = get_xid(); |
1404 | 1407 | ||
1405 | cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld " | 1408 | cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld " |
1406 | "end: %lld", cmd, flock->fl_flags, flock->fl_type, | 1409 | "end: %lld", cmd, flock->fl_flags, flock->fl_type, |
@@ -1426,7 +1429,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock) | |||
1426 | */ | 1429 | */ |
1427 | if (IS_GETLK(cmd)) { | 1430 | if (IS_GETLK(cmd)) { |
1428 | rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); | 1431 | rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); |
1429 | FreeXid(xid); | 1432 | free_xid(xid); |
1430 | return rc; | 1433 | return rc; |
1431 | } | 1434 | } |
1432 | 1435 | ||
@@ -1435,13 +1438,13 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock) | |||
1435 | * if no lock or unlock then nothing to do since we do not | 1438 | * if no lock or unlock then nothing to do since we do not |
1436 | * know what it is | 1439 | * know what it is |
1437 | */ | 1440 | */ |
1438 | FreeXid(xid); | 1441 | free_xid(xid); |
1439 | return -EOPNOTSUPP; | 1442 | return -EOPNOTSUPP; |
1440 | } | 1443 | } |
1441 | 1444 | ||
1442 | rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, | 1445 | rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, |
1443 | xid); | 1446 | xid); |
1444 | FreeXid(xid); | 1447 | free_xid(xid); |
1445 | return rc; | 1448 | return rc; |
1446 | } | 1449 | } |
1447 | 1450 | ||
@@ -1468,7 +1471,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid, | |||
1468 | unsigned int total_written; | 1471 | unsigned int total_written; |
1469 | struct cifs_sb_info *cifs_sb; | 1472 | struct cifs_sb_info *cifs_sb; |
1470 | struct cifs_tcon *pTcon; | 1473 | struct cifs_tcon *pTcon; |
1471 | int xid; | 1474 | unsigned int xid; |
1472 | struct dentry *dentry = open_file->dentry; | 1475 | struct dentry *dentry = open_file->dentry; |
1473 | struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode); | 1476 | struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode); |
1474 | struct cifs_io_parms io_parms; | 1477 | struct cifs_io_parms io_parms; |
@@ -1480,7 +1483,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid, | |||
1480 | 1483 | ||
1481 | pTcon = tlink_tcon(open_file->tlink); | 1484 | pTcon = tlink_tcon(open_file->tlink); |
1482 | 1485 | ||
1483 | xid = GetXid(); | 1486 | xid = get_xid(); |
1484 | 1487 | ||
1485 | for (total_written = 0; write_size > total_written; | 1488 | for (total_written = 0; write_size > total_written; |
1486 | total_written += bytes_written) { | 1489 | total_written += bytes_written) { |
@@ -1516,7 +1519,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid, | |||
1516 | if (total_written) | 1519 | if (total_written) |
1517 | break; | 1520 | break; |
1518 | else { | 1521 | else { |
1519 | FreeXid(xid); | 1522 | free_xid(xid); |
1520 | return rc; | 1523 | return rc; |
1521 | } | 1524 | } |
1522 | } else { | 1525 | } else { |
@@ -1536,7 +1539,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid, | |||
1536 | spin_unlock(&dentry->d_inode->i_lock); | 1539 | spin_unlock(&dentry->d_inode->i_lock); |
1537 | } | 1540 | } |
1538 | mark_inode_dirty_sync(dentry->d_inode); | 1541 | mark_inode_dirty_sync(dentry->d_inode); |
1539 | FreeXid(xid); | 1542 | free_xid(xid); |
1540 | return total_written; | 1543 | return total_written; |
1541 | } | 1544 | } |
1542 | 1545 | ||
@@ -1935,9 +1938,9 @@ static int | |||
1935 | cifs_writepage_locked(struct page *page, struct writeback_control *wbc) | 1938 | cifs_writepage_locked(struct page *page, struct writeback_control *wbc) |
1936 | { | 1939 | { |
1937 | int rc; | 1940 | int rc; |
1938 | int xid; | 1941 | unsigned int xid; |
1939 | 1942 | ||
1940 | xid = GetXid(); | 1943 | xid = get_xid(); |
1941 | /* BB add check for wbc flags */ | 1944 | /* BB add check for wbc flags */ |
1942 | page_cache_get(page); | 1945 | page_cache_get(page); |
1943 | if (!PageUptodate(page)) | 1946 | if (!PageUptodate(page)) |
@@ -1966,7 +1969,7 @@ retry_write: | |||
1966 | SetPageUptodate(page); | 1969 | SetPageUptodate(page); |
1967 | end_page_writeback(page); | 1970 | end_page_writeback(page); |
1968 | page_cache_release(page); | 1971 | page_cache_release(page); |
1969 | FreeXid(xid); | 1972 | free_xid(xid); |
1970 | return rc; | 1973 | return rc; |
1971 | } | 1974 | } |
1972 | 1975 | ||
@@ -2005,9 +2008,9 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, | |||
2005 | if (!PageUptodate(page)) { | 2008 | if (!PageUptodate(page)) { |
2006 | char *page_data; | 2009 | char *page_data; |
2007 | unsigned offset = pos & (PAGE_CACHE_SIZE - 1); | 2010 | unsigned offset = pos & (PAGE_CACHE_SIZE - 1); |
2008 | int xid; | 2011 | unsigned int xid; |
2009 | 2012 | ||
2010 | xid = GetXid(); | 2013 | xid = get_xid(); |
2011 | /* this is probably better than directly calling | 2014 | /* this is probably better than directly calling |
2012 | partialpage_write since in this function the file handle is | 2015 | partialpage_write since in this function the file handle is |
2013 | known which we might as well leverage */ | 2016 | known which we might as well leverage */ |
@@ -2018,7 +2021,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, | |||
2018 | /* if (rc < 0) should we set writebehind rc? */ | 2021 | /* if (rc < 0) should we set writebehind rc? */ |
2019 | kunmap(page); | 2022 | kunmap(page); |
2020 | 2023 | ||
2021 | FreeXid(xid); | 2024 | free_xid(xid); |
2022 | } else { | 2025 | } else { |
2023 | rc = copied; | 2026 | rc = copied; |
2024 | pos += copied; | 2027 | pos += copied; |
@@ -2041,7 +2044,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, | |||
2041 | int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, | 2044 | int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, |
2042 | int datasync) | 2045 | int datasync) |
2043 | { | 2046 | { |
2044 | int xid; | 2047 | unsigned int xid; |
2045 | int rc = 0; | 2048 | int rc = 0; |
2046 | struct cifs_tcon *tcon; | 2049 | struct cifs_tcon *tcon; |
2047 | struct cifsFileInfo *smbfile = file->private_data; | 2050 | struct cifsFileInfo *smbfile = file->private_data; |
@@ -2053,7 +2056,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, | |||
2053 | return rc; | 2056 | return rc; |
2054 | mutex_lock(&inode->i_mutex); | 2057 | mutex_lock(&inode->i_mutex); |
2055 | 2058 | ||
2056 | xid = GetXid(); | 2059 | xid = get_xid(); |
2057 | 2060 | ||
2058 | cFYI(1, "Sync file - name: %s datasync: 0x%x", | 2061 | cFYI(1, "Sync file - name: %s datasync: 0x%x", |
2059 | file->f_path.dentry->d_name.name, datasync); | 2062 | file->f_path.dentry->d_name.name, datasync); |
@@ -2070,14 +2073,14 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, | |||
2070 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) | 2073 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) |
2071 | rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); | 2074 | rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); |
2072 | 2075 | ||
2073 | FreeXid(xid); | 2076 | free_xid(xid); |
2074 | mutex_unlock(&inode->i_mutex); | 2077 | mutex_unlock(&inode->i_mutex); |
2075 | return rc; | 2078 | return rc; |
2076 | } | 2079 | } |
2077 | 2080 | ||
2078 | int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) | 2081 | int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
2079 | { | 2082 | { |
2080 | int xid; | 2083 | unsigned int xid; |
2081 | int rc = 0; | 2084 | int rc = 0; |
2082 | struct cifs_tcon *tcon; | 2085 | struct cifs_tcon *tcon; |
2083 | struct cifsFileInfo *smbfile = file->private_data; | 2086 | struct cifsFileInfo *smbfile = file->private_data; |
@@ -2089,7 +2092,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2089 | return rc; | 2092 | return rc; |
2090 | mutex_lock(&inode->i_mutex); | 2093 | mutex_lock(&inode->i_mutex); |
2091 | 2094 | ||
2092 | xid = GetXid(); | 2095 | xid = get_xid(); |
2093 | 2096 | ||
2094 | cFYI(1, "Sync file - name: %s datasync: 0x%x", | 2097 | cFYI(1, "Sync file - name: %s datasync: 0x%x", |
2095 | file->f_path.dentry->d_name.name, datasync); | 2098 | file->f_path.dentry->d_name.name, datasync); |
@@ -2098,7 +2101,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2098 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) | 2101 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) |
2099 | rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); | 2102 | rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); |
2100 | 2103 | ||
2101 | FreeXid(xid); | 2104 | free_xid(xid); |
2102 | mutex_unlock(&inode->i_mutex); | 2105 | mutex_unlock(&inode->i_mutex); |
2103 | return rc; | 2106 | return rc; |
2104 | } | 2107 | } |
@@ -2743,14 +2746,14 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
2743 | unsigned int rsize; | 2746 | unsigned int rsize; |
2744 | struct cifs_sb_info *cifs_sb; | 2747 | struct cifs_sb_info *cifs_sb; |
2745 | struct cifs_tcon *pTcon; | 2748 | struct cifs_tcon *pTcon; |
2746 | int xid; | 2749 | unsigned int xid; |
2747 | char *current_offset; | 2750 | char *current_offset; |
2748 | struct cifsFileInfo *open_file; | 2751 | struct cifsFileInfo *open_file; |
2749 | struct cifs_io_parms io_parms; | 2752 | struct cifs_io_parms io_parms; |
2750 | int buf_type = CIFS_NO_BUFFER; | 2753 | int buf_type = CIFS_NO_BUFFER; |
2751 | __u32 pid; | 2754 | __u32 pid; |
2752 | 2755 | ||
2753 | xid = GetXid(); | 2756 | xid = get_xid(); |
2754 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 2757 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
2755 | 2758 | ||
2756 | /* FIXME: set up handlers for larger reads and/or convert to async */ | 2759 | /* FIXME: set up handlers for larger reads and/or convert to async */ |
@@ -2758,7 +2761,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
2758 | 2761 | ||
2759 | if (file->private_data == NULL) { | 2762 | if (file->private_data == NULL) { |
2760 | rc = -EBADF; | 2763 | rc = -EBADF; |
2761 | FreeXid(xid); | 2764 | free_xid(xid); |
2762 | return rc; | 2765 | return rc; |
2763 | } | 2766 | } |
2764 | open_file = file->private_data; | 2767 | open_file = file->private_data; |
@@ -2803,7 +2806,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
2803 | if (total_read) { | 2806 | if (total_read) { |
2804 | break; | 2807 | break; |
2805 | } else { | 2808 | } else { |
2806 | FreeXid(xid); | 2809 | free_xid(xid); |
2807 | return rc; | 2810 | return rc; |
2808 | } | 2811 | } |
2809 | } else { | 2812 | } else { |
@@ -2811,7 +2814,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
2811 | *poffset += bytes_read; | 2814 | *poffset += bytes_read; |
2812 | } | 2815 | } |
2813 | } | 2816 | } |
2814 | FreeXid(xid); | 2817 | free_xid(xid); |
2815 | return total_read; | 2818 | return total_read; |
2816 | } | 2819 | } |
2817 | 2820 | ||
@@ -2838,7 +2841,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) | |||
2838 | int rc, xid; | 2841 | int rc, xid; |
2839 | struct inode *inode = file->f_path.dentry->d_inode; | 2842 | struct inode *inode = file->f_path.dentry->d_inode; |
2840 | 2843 | ||
2841 | xid = GetXid(); | 2844 | xid = get_xid(); |
2842 | 2845 | ||
2843 | if (!CIFS_I(inode)->clientCanCacheRead) { | 2846 | if (!CIFS_I(inode)->clientCanCacheRead) { |
2844 | rc = cifs_invalidate_mapping(inode); | 2847 | rc = cifs_invalidate_mapping(inode); |
@@ -2849,7 +2852,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) | |||
2849 | rc = generic_file_mmap(file, vma); | 2852 | rc = generic_file_mmap(file, vma); |
2850 | if (rc == 0) | 2853 | if (rc == 0) |
2851 | vma->vm_ops = &cifs_file_vm_ops; | 2854 | vma->vm_ops = &cifs_file_vm_ops; |
2852 | FreeXid(xid); | 2855 | free_xid(xid); |
2853 | return rc; | 2856 | return rc; |
2854 | } | 2857 | } |
2855 | 2858 | ||
@@ -2857,17 +2860,17 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
2857 | { | 2860 | { |
2858 | int rc, xid; | 2861 | int rc, xid; |
2859 | 2862 | ||
2860 | xid = GetXid(); | 2863 | xid = get_xid(); |
2861 | rc = cifs_revalidate_file(file); | 2864 | rc = cifs_revalidate_file(file); |
2862 | if (rc) { | 2865 | if (rc) { |
2863 | cFYI(1, "Validation prior to mmap failed, error=%d", rc); | 2866 | cFYI(1, "Validation prior to mmap failed, error=%d", rc); |
2864 | FreeXid(xid); | 2867 | free_xid(xid); |
2865 | return rc; | 2868 | return rc; |
2866 | } | 2869 | } |
2867 | rc = generic_file_mmap(file, vma); | 2870 | rc = generic_file_mmap(file, vma); |
2868 | if (rc == 0) | 2871 | if (rc == 0) |
2869 | vma->vm_ops = &cifs_file_vm_ops; | 2872 | vma->vm_ops = &cifs_file_vm_ops; |
2870 | FreeXid(xid); | 2873 | free_xid(xid); |
2871 | return rc; | 2874 | return rc; |
2872 | } | 2875 | } |
2873 | 2876 | ||
@@ -3157,13 +3160,13 @@ static int cifs_readpage(struct file *file, struct page *page) | |||
3157 | { | 3160 | { |
3158 | loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; | 3161 | loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; |
3159 | int rc = -EACCES; | 3162 | int rc = -EACCES; |
3160 | int xid; | 3163 | unsigned int xid; |
3161 | 3164 | ||
3162 | xid = GetXid(); | 3165 | xid = get_xid(); |
3163 | 3166 | ||
3164 | if (file->private_data == NULL) { | 3167 | if (file->private_data == NULL) { |
3165 | rc = -EBADF; | 3168 | rc = -EBADF; |
3166 | FreeXid(xid); | 3169 | free_xid(xid); |
3167 | return rc; | 3170 | return rc; |
3168 | } | 3171 | } |
3169 | 3172 | ||
@@ -3174,7 +3177,7 @@ static int cifs_readpage(struct file *file, struct page *page) | |||
3174 | 3177 | ||
3175 | unlock_page(page); | 3178 | unlock_page(page); |
3176 | 3179 | ||
3177 | FreeXid(xid); | 3180 | free_xid(xid); |
3178 | return rc; | 3181 | return rc; |
3179 | } | 3182 | } |
3180 | 3183 | ||