aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 073640675a39..b72bc29cba23 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -577,12 +577,13 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
577 struct cifs_io_parms io_parms; 577 struct cifs_io_parms io_parms;
578 char *full_path = NULL; 578 char *full_path = NULL;
579 struct inode *newinode = NULL; 579 struct inode *newinode = NULL;
580 int oplock = 0; 580 __u32 oplock = 0;
581 struct cifs_fid fid; 581 struct cifs_fid fid;
582 struct cifs_open_parms oparms; 582 struct cifs_open_parms oparms;
583 FILE_ALL_INFO *buf = NULL; 583 FILE_ALL_INFO *buf = NULL;
584 unsigned int bytes_written; 584 unsigned int bytes_written;
585 struct win_dev *pdev; 585 struct win_dev *pdev;
586 struct kvec iov[2];
586 587
587 if (!old_valid_dev(device_number)) 588 if (!old_valid_dev(device_number))
588 return -EINVAL; 589 return -EINVAL;
@@ -658,7 +659,11 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
658 oparms.fid = &fid; 659 oparms.fid = &fid;
659 oparms.reconnect = false; 660 oparms.reconnect = false;
660 661
661 rc = CIFS_open(xid, &oparms, &oplock, buf); 662 if (tcon->ses->server->oplocks)
663 oplock = REQ_OPLOCK;
664 else
665 oplock = 0;
666 rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, buf);
662 if (rc) 667 if (rc)
663 goto mknod_out; 668 goto mknod_out;
664 669
@@ -668,25 +673,26 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
668 */ 673 */
669 674
670 pdev = (struct win_dev *)buf; 675 pdev = (struct win_dev *)buf;
671 io_parms.netfid = fid.netfid;
672 io_parms.pid = current->tgid; 676 io_parms.pid = current->tgid;
673 io_parms.tcon = tcon; 677 io_parms.tcon = tcon;
674 io_parms.offset = 0; 678 io_parms.offset = 0;
675 io_parms.length = sizeof(struct win_dev); 679 io_parms.length = sizeof(struct win_dev);
680 iov[1].iov_base = buf;
681 iov[1].iov_len = sizeof(struct win_dev);
676 if (S_ISCHR(mode)) { 682 if (S_ISCHR(mode)) {
677 memcpy(pdev->type, "IntxCHR", 8); 683 memcpy(pdev->type, "IntxCHR", 8);
678 pdev->major = cpu_to_le64(MAJOR(device_number)); 684 pdev->major = cpu_to_le64(MAJOR(device_number));
679 pdev->minor = cpu_to_le64(MINOR(device_number)); 685 pdev->minor = cpu_to_le64(MINOR(device_number));
680 rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, (char *)pdev, 686 rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
681 NULL, 0); 687 &bytes_written, iov, 1);
682 } else if (S_ISBLK(mode)) { 688 } else if (S_ISBLK(mode)) {
683 memcpy(pdev->type, "IntxBLK", 8); 689 memcpy(pdev->type, "IntxBLK", 8);
684 pdev->major = cpu_to_le64(MAJOR(device_number)); 690 pdev->major = cpu_to_le64(MAJOR(device_number));
685 pdev->minor = cpu_to_le64(MINOR(device_number)); 691 pdev->minor = cpu_to_le64(MINOR(device_number));
686 rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, (char *)pdev, 692 rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
687 NULL, 0); 693 &bytes_written, iov, 1);
688 } /* else if (S_ISFIFO) */ 694 } /* else if (S_ISFIFO) */
689 CIFSSMBClose(xid, tcon, fid.netfid); 695 tcon->ses->server->ops->close(xid, tcon, &fid);
690 d_drop(direntry); 696 d_drop(direntry);
691 697
692 /* FIXME: add code here to set EAs */ 698 /* FIXME: add code here to set EAs */