aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-04-25 07:46:06 -0400
committerSteve French <sfrench@us.ibm.com>2007-04-25 07:46:06 -0400
commitcbac3cba66ab51492da53e7bf4f38da872408065 (patch)
tree4f6531413c4063a879b96fb4e89805f5ac982773 /fs/cifs/inode.c
parent2dd29d3133ad4c7926ea03b8431e604373c4ad65 (diff)
[CIFS] New CIFS POSIX mkdir performance improvement (part 2)
Fix incorrect parsing of return data Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 9b7e0dbdd826..f74f37cee119 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -796,6 +796,9 @@ static void posix_fill_in_inode(struct inode *tmp_inode,
796 cFYI(1,("unknown inode type %d",type)); 796 cFYI(1,("unknown inode type %d",type));
797 } 797 }
798 798
799#ifdef CONFIG_CIFS_DEBUG2
800 cFYI(1,("object type: %d", type));
801#endif
799 tmp_inode->i_uid = le64_to_cpu(pData->Uid); 802 tmp_inode->i_uid = le64_to_cpu(pData->Uid);
800 tmp_inode->i_gid = le64_to_cpu(pData->Gid); 803 tmp_inode->i_gid = le64_to_cpu(pData->Gid);
801 tmp_inode->i_nlink = le64_to_cpu(pData->Nlinks); 804 tmp_inode->i_nlink = le64_to_cpu(pData->Nlinks);
@@ -903,6 +906,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
903 cFYI(1, ("posix mkdir returned 0x%x", rc)); 906 cFYI(1, ("posix mkdir returned 0x%x", rc));
904 d_drop(direntry); 907 d_drop(direntry);
905 } else { 908 } else {
909 int obj_type;
906 if (pInfo->Type == -1) /* no return info - go query */ 910 if (pInfo->Type == -1) /* no return info - go query */
907 goto mkdir_get_info; 911 goto mkdir_get_info;
908/*BB check (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID ) to see if need to set uid/gid */ 912/*BB check (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID ) to see if need to set uid/gid */
@@ -911,19 +915,36 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
911 direntry->d_op = &cifs_ci_dentry_ops; 915 direntry->d_op = &cifs_ci_dentry_ops;
912 else 916 else
913 direntry->d_op = &cifs_dentry_ops; 917 direntry->d_op = &cifs_dentry_ops;
918
919 newinode = new_inode(inode->i_sb);
920 if (newinode == NULL)
921 goto mkdir_get_info;
922 /* Is an i_ino of zero legal? */
923 /* Are there sanity checks we can use to ensure that
924 the server is really filling in that field? */
925 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
926 newinode->i_ino =
927 (unsigned long)pInfo->UniqueId;
928 } /* note ino incremented to unique num in new_inode */
929 if(inode->i_sb->s_flags & MS_NOATIME)
930 newinode->i_flags |= S_NOATIME | S_NOCMTIME;
931 newinode->i_nlink = 2;
932
933 insert_inode_hash(newinode);
914 d_instantiate(direntry, newinode); 934 d_instantiate(direntry, newinode);
915 if (direntry->d_inode) { 935
916 int obj_type; 936 /* we already checked in POSIXCreate whether
917 direntry->d_inode->i_nlink = 2; 937 frame was long enough */
918 /* already checked in POSIXCreate whether 938 posix_fill_in_inode(direntry->d_inode,
919 frame was long enough */
920 posix_fill_in_inode(direntry->d_inode,
921 pInfo, &obj_type, 1 /* NewInode */); 939 pInfo, &obj_type, 1 /* NewInode */);
922 /* could double check that we actually 940#ifdef CONFIG_CIFS_DEBUG2
923 * created what we thought we did ie 941 cFYI(1,("instantiated dentry %p %s to inode %p",
924 * a directory 942 direntry, direntry->d_name.name, newinode));
925 */ 943
926 } 944 if(newinode->i_nlink != 2)
945 cFYI(1,("unexpected number of links %d",
946 newinode->i_nlink));
947#endif
927 } 948 }
928 kfree(pInfo); 949 kfree(pInfo);
929 goto mkdir_out; 950 goto mkdir_out;