use newer posix open SMB in cifs_reopen_file
PATCH 1/1 use newer posix open SMB in cifs_reopen_file
Still working on a patch to cifs_open (to use the newer posix open protocol operation when available, e.g. when server is Samba)
I didn't see a way to avoid the warnings on the fmode_t casts (to and from int) caused by the different definitions of the O MODE bits in the fs headers in the include directory.
Signature · 3 lines
Thanks, Steve
fs/cifs/cifsproto.h +3 -0
@@ -92,6 +92,9 @@ extern u64 cifs_UnixTimeToNT(struct timespec);extern __le64 cnvrtDosCifsTm (__u16 date,__u16 time);extern struct timespec cnvrtDosUnixTm (__u16 date,__u16 time); +extern int cifs_posix_open (char *full_path,struct inode **pinode, +struct super_block *sb,int mode,int oflags, +int *poplock,__u16 *pnetfid,int xid);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,__u64 *inum);
fs/cifs/dir.c +4 -2
@@ -129,7 +129,7 @@ cifs_bp_rename_retry:return full_path; } -static int cifs_posix_open (char *full_path,struct inode **pinode, +int cifs_posix_open (char *full_path,struct inode **pinode,struct super_block *sb,int mode,int oflags,int *poplock,__u16 *pnetfid,int xid) {
@@ -187,7 +187,9 @@ static int cifs_posix_open(char *full_path, struct inode **pinode,if (!pinode) goto posix_open_ret;/* caller does not need info */ - *pinode =cifs_new_inode (sb, &presp_data->UniqueId); +if (*pinode ==NULL ) + *pinode =cifs_new_inode (sb, &presp_data->UniqueId); +/* else an inode was passed in. Update its info, don't create one */ /* We do not need to close the file if new_inode fails since the caller will retry qpathinfo as long as inode is null */
fs/cifs/file.c +51 -6
113 lines not on this page · raw message