aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-06-20 03:21:16 -0400
committerSteve French <smfrench@gmail.com>2012-07-24 11:25:08 -0400
commit6d5786a34d98bffb8ad50d8053d1e53231fe0636 (patch)
treeae49860befc52cb18dfb2b86929878a204289601 /fs/cifs/dir.c
parent2e6e02ab6ddbd539fd7e092973daf057adbd53dc (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/dir.c')
-rw-r--r--fs/cifs/dir.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index a180265a10b5..d364654491e3 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -157,10 +157,10 @@ check_name(struct dentry *direntry)
157 157
158/* Inode operations in similar order to how they appear in Linux file fs.h */ 158/* Inode operations in similar order to how they appear in Linux file fs.h */
159 159
160static int cifs_do_create(struct inode *inode, struct dentry *direntry, 160static int
161 int xid, struct tcon_link *tlink, unsigned oflags, 161cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
162 umode_t mode, __u32 *oplock, __u16 *fileHandle, 162 struct tcon_link *tlink, unsigned oflags, umode_t mode,
163 int *created) 163 __u32 *oplock, __u16 *fileHandle, int *created)
164{ 164{
165 int rc = -ENOENT; 165 int rc = -ENOENT;
166 int create_options = CREATE_NOT_DIR; 166 int create_options = CREATE_NOT_DIR;
@@ -382,7 +382,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
382 int *opened) 382 int *opened)
383{ 383{
384 int rc; 384 int rc;
385 int xid; 385 unsigned int xid;
386 struct tcon_link *tlink; 386 struct tcon_link *tlink;
387 struct cifs_tcon *tcon; 387 struct cifs_tcon *tcon;
388 __u16 fileHandle; 388 __u16 fileHandle;
@@ -412,7 +412,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
412 if (rc) 412 if (rc)
413 return rc; 413 return rc;
414 414
415 xid = GetXid(); 415 xid = get_xid();
416 416
417 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 417 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
418 inode, direntry->d_name.name, direntry); 418 inode, direntry->d_name.name, direntry);
@@ -420,7 +420,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
420 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 420 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
421 filp = ERR_CAST(tlink); 421 filp = ERR_CAST(tlink);
422 if (IS_ERR(tlink)) 422 if (IS_ERR(tlink))
423 goto free_xid; 423 goto out_free_xid;
424 424
425 tcon = tlink_tcon(tlink); 425 tcon = tlink_tcon(tlink);
426 426
@@ -445,8 +445,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
445 445
446out: 446out:
447 cifs_put_tlink(tlink); 447 cifs_put_tlink(tlink);
448free_xid: 448out_free_xid:
449 FreeXid(xid); 449 free_xid(xid);
450 return rc; 450 return rc;
451} 451}
452 452
@@ -454,7 +454,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
454 bool excl) 454 bool excl)
455{ 455{
456 int rc; 456 int rc;
457 int xid = GetXid(); 457 unsigned int xid = get_xid();
458 /* 458 /*
459 * BB below access is probably too much for mknod to request 459 * BB below access is probably too much for mknod to request
460 * but we have to do query and setpathinfo so requesting 460 * but we have to do query and setpathinfo so requesting
@@ -474,7 +474,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
474 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 474 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
475 rc = PTR_ERR(tlink); 475 rc = PTR_ERR(tlink);
476 if (IS_ERR(tlink)) 476 if (IS_ERR(tlink))
477 goto free_xid; 477 goto out_free_xid;
478 478
479 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, 479 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
480 &oplock, &fileHandle, &created); 480 &oplock, &fileHandle, &created);
@@ -482,9 +482,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
482 CIFSSMBClose(xid, tlink_tcon(tlink), fileHandle); 482 CIFSSMBClose(xid, tlink_tcon(tlink), fileHandle);
483 483
484 cifs_put_tlink(tlink); 484 cifs_put_tlink(tlink);
485free_xid: 485out_free_xid:
486 FreeXid(xid); 486 free_xid(xid);
487
488 return rc; 487 return rc;
489} 488}
490 489
@@ -492,7 +491,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
492 dev_t device_number) 491 dev_t device_number)
493{ 492{
494 int rc = -EPERM; 493 int rc = -EPERM;
495 int xid; 494 unsigned int xid;
496 int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL; 495 int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL;
497 struct cifs_sb_info *cifs_sb; 496 struct cifs_sb_info *cifs_sb;
498 struct tcon_link *tlink; 497 struct tcon_link *tlink;
@@ -516,7 +515,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
516 515
517 pTcon = tlink_tcon(tlink); 516 pTcon = tlink_tcon(tlink);
518 517
519 xid = GetXid(); 518 xid = get_xid();
520 519
521 full_path = build_path_from_dentry(direntry); 520 full_path = build_path_from_dentry(direntry);
522 if (full_path == NULL) { 521 if (full_path == NULL) {
@@ -564,7 +563,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
564 if (buf == NULL) { 563 if (buf == NULL) {
565 kfree(full_path); 564 kfree(full_path);
566 rc = -ENOMEM; 565 rc = -ENOMEM;
567 FreeXid(xid); 566 free_xid(xid);
568 return rc; 567 return rc;
569 } 568 }
570 569
@@ -614,7 +613,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
614mknod_out: 613mknod_out:
615 kfree(full_path); 614 kfree(full_path);
616 kfree(buf); 615 kfree(buf);
617 FreeXid(xid); 616 free_xid(xid);
618 cifs_put_tlink(tlink); 617 cifs_put_tlink(tlink);
619 return rc; 618 return rc;
620} 619}
@@ -623,7 +622,7 @@ struct dentry *
623cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, 622cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
624 unsigned int flags) 623 unsigned int flags)
625{ 624{
626 int xid; 625 unsigned int xid;
627 int rc = 0; /* to get around spurious gcc warning, set to zero here */ 626 int rc = 0; /* to get around spurious gcc warning, set to zero here */
628 struct cifs_sb_info *cifs_sb; 627 struct cifs_sb_info *cifs_sb;
629 struct tcon_link *tlink; 628 struct tcon_link *tlink;
@@ -631,7 +630,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
631 struct inode *newInode = NULL; 630 struct inode *newInode = NULL;
632 char *full_path = NULL; 631 char *full_path = NULL;
633 632
634 xid = GetXid(); 633 xid = get_xid();
635 634
636 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 635 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
637 parent_dir_inode, direntry->d_name.name, direntry); 636 parent_dir_inode, direntry->d_name.name, direntry);
@@ -641,7 +640,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
641 cifs_sb = CIFS_SB(parent_dir_inode->i_sb); 640 cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
642 tlink = cifs_sb_tlink(cifs_sb); 641 tlink = cifs_sb_tlink(cifs_sb);
643 if (IS_ERR(tlink)) { 642 if (IS_ERR(tlink)) {
644 FreeXid(xid); 643 free_xid(xid);
645 return (struct dentry *)tlink; 644 return (struct dentry *)tlink;
646 } 645 }
647 pTcon = tlink_tcon(tlink); 646 pTcon = tlink_tcon(tlink);
@@ -695,7 +694,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
695lookup_out: 694lookup_out:
696 kfree(full_path); 695 kfree(full_path);
697 cifs_put_tlink(tlink); 696 cifs_put_tlink(tlink);
698 FreeXid(xid); 697 free_xid(xid);
699 return ERR_PTR(rc); 698 return ERR_PTR(rc);
700} 699}
701 700