diff options
Diffstat (limited to 'fs/cifs/ioctl.c')
-rw-r--r-- | fs/cifs/ioctl.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c index 711bb7a3a98e..b0ea6687ab55 100644 --- a/fs/cifs/ioctl.c +++ b/fs/cifs/ioctl.c | |||
@@ -35,35 +35,37 @@ int cifs_ioctl (struct inode * inode, struct file * filep, | |||
35 | unsigned int command, unsigned long arg) | 35 | unsigned int command, unsigned long arg) |
36 | { | 36 | { |
37 | int rc = -ENOTTY; /* strange error - but the precedent */ | 37 | int rc = -ENOTTY; /* strange error - but the precedent */ |
38 | int xid; | ||
39 | struct cifs_sb_info *cifs_sb; | ||
38 | #ifdef CONFIG_CIFS_POSIX | 40 | #ifdef CONFIG_CIFS_POSIX |
39 | __u64 ExtAttrBits = 0; | 41 | __u64 ExtAttrBits = 0; |
40 | __u64 ExtAttrMask = 0; | 42 | __u64 ExtAttrMask = 0; |
41 | #endif /* CONFIG_CIFS_POSIX */ | ||
42 | __u64 caps; | 43 | __u64 caps; |
43 | int xid; | ||
44 | struct cifs_sb_info *cifs_sb; | ||
45 | struct cifsTconInfo *tcon; | 44 | struct cifsTconInfo *tcon; |
46 | struct cifsFileInfo *pSMBFile = | 45 | struct cifsFileInfo *pSMBFile = |
47 | (struct cifsFileInfo *)filep->private_data; | 46 | (struct cifsFileInfo *)filep->private_data; |
47 | #endif /* CONFIG_CIFS_POSIX */ | ||
48 | 48 | ||
49 | xid = GetXid(); | 49 | xid = GetXid(); |
50 | 50 | ||
51 | cFYI(1,("ioctl file %p cmd %u arg %lu",filep,command,arg)); | 51 | cFYI(1,("ioctl file %p cmd %u arg %lu",filep,command,arg)); |
52 | 52 | ||
53 | cifs_sb = CIFS_SB(inode->i_sb); | 53 | cifs_sb = CIFS_SB(inode->i_sb); |
54 | tcon = cifs_sb->tcon; | ||
55 | 54 | ||
55 | #ifdef CONFIG_CIFS_POSIX | ||
56 | tcon = cifs_sb->tcon; | ||
56 | if(tcon) | 57 | if(tcon) |
57 | caps = le64_to_cpu(tcon->fsUnixInfo.Capability); | 58 | caps = le64_to_cpu(tcon->fsUnixInfo.Capability); |
58 | else { | 59 | else { |
59 | rc = -EIO; | 60 | rc = -EIO; |
60 | goto cifs_ioctl_out; | 61 | FreeXid(xid); |
62 | return -EIO; | ||
61 | } | 63 | } |
64 | #endif /* CONFIG_CIFS_POSIX */ | ||
62 | 65 | ||
63 | switch(command) { | 66 | switch(command) { |
64 | case CIFS_IOC_CHECKUMOUNT: | 67 | case CIFS_IOC_CHECKUMOUNT: |
65 | cFYI(1,("User unmount attempted")); | 68 | cFYI(1,("User unmount attempted")); |
66 | /* BB FIXME - add missing code here FIXME */ | ||
67 | if(cifs_sb->mnt_uid == current->uid) | 69 | if(cifs_sb->mnt_uid == current->uid) |
68 | rc = 0; | 70 | rc = 0; |
69 | else { | 71 | else { |
@@ -75,7 +77,7 @@ int cifs_ioctl (struct inode * inode, struct file * filep, | |||
75 | case EXT2_IOC_GETFLAGS: | 77 | case EXT2_IOC_GETFLAGS: |
76 | if(CIFS_UNIX_EXTATTR_CAP & caps) { | 78 | if(CIFS_UNIX_EXTATTR_CAP & caps) { |
77 | if (pSMBFile == NULL) | 79 | if (pSMBFile == NULL) |
78 | goto cifs_ioctl_out; | 80 | break; |
79 | rc = CIFSGetExtAttr(xid, tcon, pSMBFile->netfid, | 81 | rc = CIFSGetExtAttr(xid, tcon, pSMBFile->netfid, |
80 | &ExtAttrBits, &ExtAttrMask); | 82 | &ExtAttrBits, &ExtAttrMask); |
81 | if(rc == 0) | 83 | if(rc == 0) |
@@ -89,10 +91,10 @@ int cifs_ioctl (struct inode * inode, struct file * filep, | |||
89 | if(CIFS_UNIX_EXTATTR_CAP & caps) { | 91 | if(CIFS_UNIX_EXTATTR_CAP & caps) { |
90 | if(get_user(ExtAttrBits,(int __user *)arg)) { | 92 | if(get_user(ExtAttrBits,(int __user *)arg)) { |
91 | rc = -EFAULT; | 93 | rc = -EFAULT; |
92 | goto cifs_ioctl_out; | 94 | break; |
93 | } | 95 | } |
94 | if (pSMBFile == NULL) | 96 | if (pSMBFile == NULL) |
95 | goto cifs_ioctl_out; | 97 | break; |
96 | /* rc= CIFSGetExtAttr(xid,tcon,pSMBFile->netfid, | 98 | /* rc= CIFSGetExtAttr(xid,tcon,pSMBFile->netfid, |
97 | extAttrBits, &ExtAttrMask);*/ | 99 | extAttrBits, &ExtAttrMask);*/ |
98 | 100 | ||
@@ -105,7 +107,6 @@ int cifs_ioctl (struct inode * inode, struct file * filep, | |||
105 | break; | 107 | break; |
106 | } | 108 | } |
107 | 109 | ||
108 | cifs_ioctl_out: | ||
109 | FreeXid(xid); | 110 | FreeXid(xid); |
110 | return rc; | 111 | return rc; |
111 | } | 112 | } |