]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/cifs/ioctl.c
Merge branch 'master' into csb1725
[mv-sheeva.git] / fs / cifs / ioctl.c
index 9d38a71c8e1449561f625d5762c2337714d31563..0c98672d01225ccadb67bb09705e7c21922332c7 100644 (file)
@@ -37,11 +37,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
        int xid;
        struct cifs_sb_info *cifs_sb;
 #ifdef CONFIG_CIFS_POSIX
+       struct cifsFileInfo *pSMBFile = filep->private_data;
+       struct cifsTconInfo *tcon;
        __u64   ExtAttrBits = 0;
        __u64   ExtAttrMask = 0;
        __u64   caps;
-       struct cifsTconInfo *tcon;
-       struct cifsFileInfo *pSMBFile = filep->private_data;
 #endif /* CONFIG_CIFS_POSIX */
 
        xid = GetXid();
@@ -50,17 +50,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
 
        cifs_sb = CIFS_SB(inode->i_sb);
 
-#ifdef CONFIG_CIFS_POSIX
-       tcon = cifs_sb->tcon;
-       if (tcon)
-               caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
-       else {
-               rc = -EIO;
-               FreeXid(xid);
-               return -EIO;
-       }
-#endif /* CONFIG_CIFS_POSIX */
-
        switch (command) {
                case CIFS_IOC_CHECKUMOUNT:
                        cFYI(1, "User unmount attempted");
@@ -73,9 +62,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
                        break;
 #ifdef CONFIG_CIFS_POSIX
                case FS_IOC_GETFLAGS:
+                       if (pSMBFile == NULL)
+                               break;
+                       tcon = tlink_tcon(pSMBFile->tlink);
+                       caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
                        if (CIFS_UNIX_EXTATTR_CAP & caps) {
-                               if (pSMBFile == NULL)
-                                       break;
                                rc = CIFSGetExtAttr(xid, tcon, pSMBFile->netfid,
                                        &ExtAttrBits, &ExtAttrMask);
                                if (rc == 0)
@@ -86,13 +77,15 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
                        break;
 
                case FS_IOC_SETFLAGS:
+                       if (pSMBFile == NULL)
+                               break;
+                       tcon = tlink_tcon(pSMBFile->tlink);
+                       caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
                        if (CIFS_UNIX_EXTATTR_CAP & caps) {
                                if (get_user(ExtAttrBits, (int __user *)arg)) {
                                        rc = -EFAULT;
                                        break;
                                }
-                               if (pSMBFile == NULL)
-                                       break;
                                /* rc= CIFSGetExtAttr(xid,tcon,pSMBFile->netfid,
                                        extAttrBits, &ExtAttrMask);*/
                        }