cifs: refactor new_inode() calls and inode initialization
PATCH 1/2 cifs: refactor new_inode() calls and inode initialization
Move new inode creation into a separate routine and refactor the callers to take advantage of it.
Signed-off-by Jeff Layton <[email protected]>
--- fs/cifs/cifsproto.h | 1 + fs/cifs/inode.c | 90 ++++++++++++++++++++++++++++++-------------------- fs/cifs/readdir.c | 42 ++++++++--------------- 3 files changed, 70 insertions(+), 63 deletions(-)
fs/cifs/cifsproto.h +1 -0
@@ -91,6 +91,7 @@ extern u64 cifs_UnixTimeToNT(struct timespec);extern __le64 cnvrtDosCifsTm (__u16 date,__u16 time);extern struct timespec cnvrtDosUnixTm (__u16 date,__u16 time); +extern struct inode *cifs_new_inode (struct super_block *sb,unsigned long inum); extern int cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path, FILE_ALL_INFO *pfile_info,
fs/cifs/inode.c +54 -36
136 lines not on this page · raw message
fs/cifs/readdir.c +15 -27
85 lines not on this page · raw message
Signature · 1 line
1.5.5.6
PATCH 2/2 cifs: have cifs_create use POSIX create if it's available
This reduces the number of calls to the server when creating files, and also makes the force_create_mode option in samba work correctly.
This also refactors some of the error handling in this function to reduce layers of indentation.
Signed-off-by Jeff Layton <[email protected]>
--- fs/cifs/cifsproto.h | 2 + fs/cifs/dir.c | 281 +++++++++++++++++++++++++++++---------------------- fs/cifs/inode.c | 2 +- 3 files changed, 165 insertions(+), 120 deletions(-)
fs/cifs/cifsproto.h +2 -0
@@ -91,6 +91,8 @@ extern u64 cifs_UnixTimeToNT(struct timespec);extern __le64 cnvrtDosCifsTm (__u16 date,__u16 time);extern struct timespec cnvrtDosUnixTm (__u16 date,__u16 time); +extern void posix_fill_in_inode (struct inode *tmp_inode, +FILE_UNIX_BASIC_INFO *pData,int isNewInode);extern struct inode *cifs_new_inode (struct super_block *sb,unsigned long inum); extern int cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
fs/cifs/dir.c +162 -119
339 lines not on this page · raw message
fs/cifs/inode.c +1 -1
@@ -1045,7 +1045,7 @@ out_reval:return rc; } -static void posix_fill_in_inode (struct inode *tmp_inode, +void posix_fill_in_inode (struct inode *tmp_inode,FILE_UNIX_BASIC_INFO *pData,int isNewInode) {struct cifsInodeInfo *cifsInfo =CIFS_I (tmp_inode);
Signature · 1 line
1.5.5.6