[CIFS] Performance improvement, finish up adding CIFSSMBWrite2
authorSteve French <sfrench@us.ibm.com>
Fri, 24 Jun 2005 00:31:17 +0000 (19:31 -0500)
committerSteve French <sfrench@us.ibm.com>
Fri, 24 Jun 2005 00:31:17 +0000 (19:31 -0500)
Signed-off-by: Steve French (sfrench@us.ibm.com)
fs/cifs/cifs_debug.c
fs/cifs/cifssmb.c
fs/cifs/file.c
fs/cifs/transport.c

index 4061e43471c1a1dc1822fcae3dca02c4406794f0..8381713280769679464e2609c035653e7111bc6d 100644 (file)
@@ -283,6 +283,12 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
                        atomic_read(&tcon->num_t2renames));
                buf += item_length;
                length += item_length;
                        atomic_read(&tcon->num_t2renames));
                buf += item_length;
                length += item_length;
+               item_length = sprintf(buf,"\nFindFirst: %d FNext %d FClose %d",
+                       atomic_read(&tcon->num_ffirst),
+                       atomic_read(&tcon->num_fnext),
+                       atomic_read(&tcon->num_fclose));
+               buf += item_length;
+               length += item_length;
        }
        read_unlock(&GlobalSMBSeslock);
 
        }
        read_unlock(&GlobalSMBSeslock);
 
@@ -360,7 +366,7 @@ cifs_proc_init(void)
        if (pde)
                pde->write_proc = oplockEnabled_write;
 
        if (pde)
                pde->write_proc = oplockEnabled_write;
 
-       pde = create_proc_read_entry("ReenableOldCifsReaddirCode", 0, proc_fs_cifs,
+       pde = create_proc_read_entry("Experimental", 0, proc_fs_cifs,
                                quotaEnabled_read, NULL);
        if (pde)
                pde->write_proc = quotaEnabled_write;
                                quotaEnabled_read, NULL);
        if (pde)
                pde->write_proc = quotaEnabled_write;
@@ -419,7 +425,7 @@ cifs_proc_clean(void)
        remove_proc_entry("ExtendedSecurity",proc_fs_cifs);
        remove_proc_entry("PacketSigningEnabled",proc_fs_cifs);
        remove_proc_entry("LinuxExtensionsEnabled",proc_fs_cifs);
        remove_proc_entry("ExtendedSecurity",proc_fs_cifs);
        remove_proc_entry("PacketSigningEnabled",proc_fs_cifs);
        remove_proc_entry("LinuxExtensionsEnabled",proc_fs_cifs);
-       remove_proc_entry("ReenableOldCifsReaddirCode",proc_fs_cifs);
+       remove_proc_entry("Experimental",proc_fs_cifs);
        remove_proc_entry("LookupCacheEnabled",proc_fs_cifs);
        remove_proc_entry("cifs", proc_root_fs);
 }
        remove_proc_entry("LookupCacheEnabled",proc_fs_cifs);
        remove_proc_entry("cifs", proc_root_fs);
 }
index f3dfae7788fd02414746945ae78c3916653d1118..56d79fd90679157f9a4730bdeaa3727517e00ffe 100644 (file)
@@ -964,7 +964,7 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
        __u32 bytes_sent;
        __u16 byte_count;
 
        __u32 bytes_sent;
        __u16 byte_count;
 
-       cERROR(1,("write2 at %lld %d bytes",offset,count)); /* BB removeme BB */
+       cFYI(1,("write2 at %lld %d bytes",offset,count)); /* BB removeme BB */
        rc = small_smb_init(SMB_COM_WRITE_ANDX, 14, tcon, (void **) &pSMB);
        if (rc)
                return rc;
        rc = small_smb_init(SMB_COM_WRITE_ANDX, 14, tcon, (void **) &pSMB);
        if (rc)
                return rc;
index f55c0c7aeeb0b70b9d585187026579f6b2b328f3..ddb25a0a63d5bc0fcb00883e65540e7fe950b050 100644 (file)
@@ -845,11 +845,10 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
                                if (rc != 0)
                                        break;
                        }
                                if (rc != 0)
                                        break;
                        }
-#ifdef CIFS_EXPERIMENTAL
+#ifdef CONFIG_CIFS_EXPERIMENTAL
                        /* BB FIXME We can not sign across two buffers yet */
                        /* BB FIXME We can not sign across two buffers yet */
-                       cERROR(1,("checking signing")); /* BB removeme BB */
-                       if(pTcon->ses->server->secMode & 
-                          (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED) == 0)
+                       if((experimEnabled) && ((pTcon->ses->server->secMode & 
+                        (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0)) {
                                rc = CIFSSMBWrite2(xid, pTcon,
                                                open_file->netfid,
                                                min_t(const int, cifs_sb->wsize,
                                rc = CIFSSMBWrite2(xid, pTcon,
                                                open_file->netfid,
                                                min_t(const int, cifs_sb->wsize,
index 04f4af07fdd40a6344793430918e32086fd98727..496a2738bbe3d5915276072194770b22545c243b 100644 (file)
@@ -197,7 +197,7 @@ smb_send2(struct socket *ssocket, struct smb_hdr *smb_buffer,
        iov[0].iov_base = smb_buffer;
        iov[0].iov_len = len;
        iov[1].iov_base = data;
        iov[0].iov_base = smb_buffer;
        iov[0].iov_len = len;
        iov[1].iov_base = data;
-       iov[2].iov_len = datalen;
+       iov[1].iov_len = datalen;
        smb_msg.msg_name = sin;
        smb_msg.msg_namelen = sizeof (struct sockaddr);
        smb_msg.msg_control = NULL;
        smb_msg.msg_name = sin;
        smb_msg.msg_namelen = sizeof (struct sockaddr);
        smb_msg.msg_control = NULL;
@@ -210,7 +210,8 @@ smb_send2(struct socket *ssocket, struct smb_hdr *smb_buffer,
           Flags2 is converted in SendReceive */
 
        smb_buffer->smb_buf_length = cpu_to_be32(smb_buffer->smb_buf_length);
           Flags2 is converted in SendReceive */
 
        smb_buffer->smb_buf_length = cpu_to_be32(smb_buffer->smb_buf_length);
-       cFYI(1, ("Sending smb of length %d ", len + datalen));
+       cFYI(1, ("Sending smb:  hdrlen %d datalen %d",
+                smb_hdr_length,datalen));
        dump_smb(smb_buffer, len);
 
        while (len + datalen > 0) {
        dump_smb(smb_buffer, len);
 
        while (len + datalen > 0) {
@@ -233,6 +234,7 @@ smb_send2(struct socket *ssocket, struct smb_hdr *smb_buffer,
                        if(rc >= len) {
                                iov[0].iov_len = 0;
                                rc -= len;
                        if(rc >= len) {
                                iov[0].iov_len = 0;
                                rc -= len;
+                               len = 0;
                        } else {  /* some of hdr was not sent */
                                len -= rc;
                                iov[0].iov_len -= rc;
                        } else {  /* some of hdr was not sent */
                                len -= rc;
                                iov[0].iov_len -= rc;