cifs: have cifs_create use POSIX create if it's available (try #2)
PATCH 1/1 cifs: have cifs_create use POSIX create if it's available (try #2)
This reduces the number of calls to the server when creating files, and also makes the force_create_mode option in samba work correctly.
It also refactors some of the error handling in this function to reduce layers of indentation.
This is the second attempt at this patch. The first patch had a bug in the open flag conversion routines and didn't try to enable O_DIRECT on direct I/O mounts.
Signed-off-by Jeff Layton <[email protected]>
--- fs/cifs/cifsproto.h | 2 + fs/cifs/dir.c | 283 +++++++++++++++++++++++++++++--------------------- fs/cifs/inode.c | 2 +- 3 files changed, 167 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 +164 -119
341 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