summaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2014-01-16 06:53:34 -0500
committerSteve French <smfrench@gmail.com>2014-01-20 10:52:05 -0500
commitdd12067156b442801a7d636de354efe1d4dc467c (patch)
tree67892ff3ea2a765d7e259245e46f61b23d34c8c9 /fs/cifs/dir.c
parent9bf4fa01f9aaf240bc6e40b3ed186039472c5298 (diff)
CIFS: Cleanup cifs_mknod
Rename camel case variable and fix comment style. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index a514e0a65f69..0850325c3b44 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -565,12 +565,12 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
565 int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL; 565 int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL;
566 struct cifs_sb_info *cifs_sb; 566 struct cifs_sb_info *cifs_sb;
567 struct tcon_link *tlink; 567 struct tcon_link *tlink;
568 struct cifs_tcon *pTcon; 568 struct cifs_tcon *tcon;
569 struct cifs_io_parms io_parms; 569 struct cifs_io_parms io_parms;
570 char *full_path = NULL; 570 char *full_path = NULL;
571 struct inode *newinode = NULL; 571 struct inode *newinode = NULL;
572 int oplock = 0; 572 int oplock = 0;
573 u16 fileHandle; 573 u16 netfid;
574 FILE_ALL_INFO *buf = NULL; 574 FILE_ALL_INFO *buf = NULL;
575 unsigned int bytes_written; 575 unsigned int bytes_written;
576 struct win_dev *pdev; 576 struct win_dev *pdev;
@@ -583,7 +583,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
583 if (IS_ERR(tlink)) 583 if (IS_ERR(tlink))
584 return PTR_ERR(tlink); 584 return PTR_ERR(tlink);
585 585
586 pTcon = tlink_tcon(tlink); 586 tcon = tlink_tcon(tlink);
587 587
588 xid = get_xid(); 588 xid = get_xid();
589 589
@@ -593,7 +593,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
593 goto mknod_out; 593 goto mknod_out;
594 } 594 }
595 595
596 if (pTcon->unix_ext) { 596 if (tcon->unix_ext) {
597 struct cifs_unix_set_info_args args = { 597 struct cifs_unix_set_info_args args = {
598 .mode = mode & ~current_umask(), 598 .mode = mode & ~current_umask(),
599 .ctime = NO_CHANGE_64, 599 .ctime = NO_CHANGE_64,
@@ -608,7 +608,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
608 args.uid = INVALID_UID; /* no change */ 608 args.uid = INVALID_UID; /* no change */
609 args.gid = INVALID_GID; /* no change */ 609 args.gid = INVALID_GID; /* no change */
610 } 610 }
611 rc = CIFSSMBUnixSetPathInfo(xid, pTcon, full_path, &args, 611 rc = CIFSSMBUnixSetPathInfo(xid, tcon, full_path, &args,
612 cifs_sb->local_nls, 612 cifs_sb->local_nls,
613 cifs_sb->mnt_cifs_flags & 613 cifs_sb->mnt_cifs_flags &
614 CIFS_MOUNT_MAP_SPECIAL_CHR); 614 CIFS_MOUNT_MAP_SPECIAL_CHR);
@@ -640,42 +640,38 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
640 if (backup_cred(cifs_sb)) 640 if (backup_cred(cifs_sb))
641 create_options |= CREATE_OPEN_BACKUP_INTENT; 641 create_options |= CREATE_OPEN_BACKUP_INTENT;
642 642
643 rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_CREATE, 643 rc = CIFSSMBOpen(xid, tcon, full_path, FILE_CREATE,
644 GENERIC_WRITE, create_options, 644 GENERIC_WRITE, create_options,
645 &fileHandle, &oplock, buf, cifs_sb->local_nls, 645 &netfid, &oplock, buf, cifs_sb->local_nls,
646 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 646 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
647 if (rc) 647 if (rc)
648 goto mknod_out; 648 goto mknod_out;
649 649
650 /* BB Do not bother to decode buf since no local inode yet to put 650 /*
651 * timestamps in, but we can reuse it safely */ 651 * BB Do not bother to decode buf since no local inode yet to put
652 * timestamps in, but we can reuse it safely.
653 */
652 654
653 pdev = (struct win_dev *)buf; 655 pdev = (struct win_dev *)buf;
654 io_parms.netfid = fileHandle; 656 io_parms.netfid = netfid;
655 io_parms.pid = current->tgid; 657 io_parms.pid = current->tgid;
656 io_parms.tcon = pTcon; 658 io_parms.tcon = tcon;
657 io_parms.offset = 0; 659 io_parms.offset = 0;
658 io_parms.length = sizeof(struct win_dev); 660 io_parms.length = sizeof(struct win_dev);
659 if (S_ISCHR(mode)) { 661 if (S_ISCHR(mode)) {
660 memcpy(pdev->type, "IntxCHR", 8); 662 memcpy(pdev->type, "IntxCHR", 8);
661 pdev->major = 663 pdev->major = cpu_to_le64(MAJOR(device_number));
662 cpu_to_le64(MAJOR(device_number)); 664 pdev->minor = cpu_to_le64(MINOR(device_number));
663 pdev->minor = 665 rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, (char *)pdev,
664 cpu_to_le64(MINOR(device_number)); 666 NULL, 0);
665 rc = CIFSSMBWrite(xid, &io_parms,
666 &bytes_written, (char *)pdev,
667 NULL, 0);
668 } else if (S_ISBLK(mode)) { 667 } else if (S_ISBLK(mode)) {
669 memcpy(pdev->type, "IntxBLK", 8); 668 memcpy(pdev->type, "IntxBLK", 8);
670 pdev->major = 669 pdev->major = cpu_to_le64(MAJOR(device_number));
671 cpu_to_le64(MAJOR(device_number)); 670 pdev->minor = cpu_to_le64(MINOR(device_number));
672 pdev->minor = 671 rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, (char *)pdev,
673 cpu_to_le64(MINOR(device_number)); 672 NULL, 0);
674 rc = CIFSSMBWrite(xid, &io_parms,
675 &bytes_written, (char *)pdev,
676 NULL, 0);
677 } /* else if (S_ISFIFO) */ 673 } /* else if (S_ISFIFO) */
678 CIFSSMBClose(xid, pTcon, fileHandle); 674 CIFSSMBClose(xid, tcon, netfid);
679 d_drop(direntry); 675 d_drop(direntry);
680 676
681 /* FIXME: add code here to set EAs */ 677 /* FIXME: add code here to set EAs */