[PATCH] cifs: Enable ioctl support in POSIX extensions to handle lsattr
authorSteve French <smfrench@austin.rr.com>
Fri, 29 Apr 2005 05:41:04 +0000 (22:41 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 29 Apr 2005 05:41:04 +0000 (22:41 -0700)
remove sparse warnings, unnecessary pad in QueryFileInfo and redundant
function define.

Signed-off-by: Steve French (sfrench@us.ibm.com)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/cifs/cifsfs.c
fs/cifs/cifspdu.h
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/ioctl.c

index 5082fce3c566d56d81d3b7cbcf447807437ddd2f..ae48ef0429774c406307909e72db1238b5f3af43 100644 (file)
@@ -559,6 +559,10 @@ struct file_operations cifs_file_ops = {
        .flush = cifs_flush,
        .mmap  = cifs_file_mmap,
        .sendfile = generic_file_sendfile,
+#ifdef CONFIG_CIFS_POSIX
+       .ioctl  = cifs_ioctl,
+#endif /* CONFIG_CIFS_POSIX */
+
 #ifdef CONFIG_CIFS_EXPERIMENTAL
        .readv = generic_file_readv,
        .writev = generic_file_writev,
@@ -579,6 +583,10 @@ struct file_operations cifs_file_direct_ops = {
        .fsync = cifs_fsync,
        .flush = cifs_flush,
        .sendfile = generic_file_sendfile, /* BB removeme BB */
+#ifdef CONFIG_CIFS_POSIX
+       .ioctl  = cifs_ioctl,
+#endif /* CONFIG_CIFS_POSIX */
+
 #ifdef CONFIG_CIFS_EXPERIMENTAL
        .dir_notify = cifs_dir_notify,
 #endif /* CONFIG_CIFS_EXPERIMENTAL */
index 085109d2b55e21f31dd368336b40f66d3778bf13..5b352890f0929e952a544925ecdd59c6436e1504 100644 (file)
@@ -1258,10 +1258,8 @@ struct smb_t2_qfi_req {
         struct smb_hdr hdr;
         struct trans2_req t2;
        __u8    Pad;
-       __u16   Pad1;
        __u16   Fid;
        __le16  InformationLevel;
-       __u16   Pad2;
 };
 
 struct smb_t2_qfi_rsp {
index 82ae59d7cf9d2551c65bdcbea120eba517c92372..1b0070dfc51ceacc55cb568d64db7405e950e8d9 100644 (file)
@@ -266,6 +266,4 @@ extern int CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
                const struct nls_table *nls_codepage);
 extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
                 const int netfid, __u64 * pExtAttrBits, __u64 *pMask);
-extern int cifs_ioctl (struct inode * inode, struct file * filep,
-                unsigned int command, unsigned long arg);
 #endif                 /* _CIFSPROTO_H */
index 36d3c128a58bde9166e94cab813ef3314ea28926..237e3bf94bfe888475053e2aced02b7d140fee8d 100644 (file)
@@ -2093,9 +2093,9 @@ GetExtAttrRetry:
         if (rc)
                 return rc;
 
-        params = 2 /* level */ +2 /* fid */ + 2 /* rsrvd */;
+        params = 2 /* level */ +2 /* fid */;
         pSMB->t2.TotalDataCount = 0;
-        pSMB->t2.MaxParameterCount = cpu_to_le16(2);
+        pSMB->t2.MaxParameterCount = cpu_to_le16(4);
         /* BB find exact max data count below from sess structure BB */
         pSMB->t2.MaxDataCount = cpu_to_le16(4000);
         pSMB->t2.MaxSetupCount = 0;
@@ -2103,19 +2103,18 @@ GetExtAttrRetry:
         pSMB->t2.Flags = 0;
         pSMB->t2.Timeout = 0;
         pSMB->t2.Reserved2 = 0;
-        pSMB->t2.ParameterOffset = cpu_to_le16(offsetof(
-                struct smb_com_transaction2_qpi_req ,InformationLevel) - 4);
+        pSMB->t2.ParameterOffset = cpu_to_le16(offsetof(struct smb_t2_qfi_req,
+                       Fid) - 4);
         pSMB->t2.DataCount = 0;
         pSMB->t2.DataOffset = 0;
         pSMB->t2.SetupCount = 1;
         pSMB->t2.Reserved3 = 0;
         pSMB->t2.SubCommand = cpu_to_le16(TRANS2_QUERY_FILE_INFORMATION);
-        byte_count = params + 3 /* pad */ ;
+        byte_count = params + 1 /* pad */ ;
         pSMB->t2.TotalParameterCount = cpu_to_le16(params);
         pSMB->t2.ParameterCount = pSMB->t2.TotalParameterCount;
         pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_ATTR_FLAGS);
-        pSMB->Pad1 = 0;
-       pSMB->Pad2 = 0;
+        pSMB->Pad = 0;
        pSMB->Fid = netfid;
         pSMB->hdr.smb_buf_length += byte_count;
         pSMB->t2.ByteCount = cpu_to_le16(byte_count);
index 7b84b2bb8c4a85e8e50247ee3a514c6baad8dd7d..a4f1c34a8dc7fa518e557f8f57beab4c1a4ee3a5 100644 (file)
@@ -27,6 +27,7 @@
 #include "cifsglob.h"
 #include "cifsproto.h"
 #include "cifs_debug.h"
+#include "cifsfs.h"
 
 int cifs_ioctl (struct inode * inode, struct file * filep, 
                unsigned int command, unsigned long arg)