Cleanup open codepath
Subsystems (2)
cover Cleanup open codepath
This patchset includes various cleanups that touch open codepath. This will help to introduce share modes into cifs module easier.
Patches are rebased on top of Sachin's patchset "Clean up MF-Symlink code and add readlink support for DFS shares".
Pavel Shilovsky (4):
CIFS: Cleanup CIFSSMBOpen
CIFS: Cleanup cifs_mknod
CIFS: Remove extra indentation in cifs_sfu_type
CIFS: Cleanup cifs open codepath
fs/cifs/cifsacl.c | 40 +++++++++---- fs/cifs/cifsproto.h | 7 +-- fs/cifs/cifssmb.c | 158 +++++++++++++++++++++++++++--------------------- fs/cifs/dir.c | 59 +++++++++--------- fs/cifs/file.c | 2 +- fs/cifs/inode.c | 166 +++++++++++++++++++++++++++++---------------------- fs/cifs/link.c | 44 +++++++++----- fs/cifs/smb1ops.c | 71 +++++++++++++--------- 8 files changed, 317 insertions(+), 230 deletions(-)
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): 1389873217-17519-1-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org
PATCH 1/4 CIFS: Cleanup CIFSSMBOpen
Remove indentation, fix comment style, rename camel case variables in preparation to make it work with cifs_open_parms structure as a parm.
--- fs/cifs/cifsproto.h | 8 +-- fs/cifs/cifssmb.c | 150 ++++++++++++++++++++++++++++----------------------- 2 files changed, 86 insertions(+), 72 deletions(-)
fs/cifs/cifsproto.h +4 -4
@@ -363,10 +363,10 @@ extern int CIFSSMBQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,extern int CIFSSMB_set_compression (const unsigned int xid,struct cifs_tcon *tcon,__u16 fid);extern int CIFSSMBOpen (const unsigned int xid,struct cifs_tcon *tcon, -const char *fileName,const int disposition, -const int access_flags,const int omode, -__u16 *netfid,int *pOplock,FILE_ALL_INFO *, -const struct nls_table *nls_codepage,int remap); +const char *path,const int disposition, +const int desired_access,const int create_options, +__u16 *netfid,int *oplock,FILE_ALL_INFO *buf, +const struct nls_table *nls,int remap); extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon, const char *fileName, const int disposition, const int access_flags, const int omode,
fs/cifs/cifssmb.c +82 -68
185 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 2/4 CIFS: Cleanup cifs_mknod
In reply to a message not in the archiveRename camel case variable and fix comment style.
--- fs/cifs/dir.c | 48 ++++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 26 deletions(-)
fs/cifs/dir.c +22 -26
@@ -565,12 +565,12 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,int create_options =CREATE_NOT_DIR |CREATE_OPTION_SPECIAL ;struct cifs_sb_info *cifs_sb;struct tcon_link *tlink; -struct cifs_tcon *pTcon; +struct cifs_tcon *tcon;struct cifs_io_parms io_parms;char *full_path =NULL ;struct inode *newinode =NULL ;int oplock =0 ; -u16 fileHandle; +u16 netfid;FILE_ALL_INFO *buf =NULL ;unsigned int bytes_written;struct win_dev *pdev;
@@ -583,7 +583,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,if (IS_ERR (tlink))return PTR_ERR (tlink); - pTcon =tlink_tcon (tlink); + tcon =tlink_tcon (tlink); xid =get_xid ();
@@ -593,7 +593,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, goto mknod_out; } -if (pTcon->unix_ext) { +if (tcon->unix_ext) {struct cifs_unix_set_info_args args = { .mode = mode & ~current_umask (), .ctime =NO_CHANGE_64 ,
@@ -608,7 +608,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, args.uid =INVALID_UID ;/* no change */ args.gid =INVALID_GID ;/* no change */ } - rc =CIFSSMBUnixSetPathInfo (xid, pTcon, full_path, &args, + rc =CIFSSMBUnixSetPathInfo (xid, tcon, full_path, &args, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR );
@@ -640,42 +640,38 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,if (backup_cred (cifs_sb)) create_options |=CREATE_OPEN_BACKUP_INTENT ; - rc =CIFSSMBOpen (xid, pTcon, full_path,FILE_CREATE , + rc =CIFSSMBOpen (xid, tcon, full_path,FILE_CREATE ,GENERIC_WRITE , create_options, - &fileHandle, &oplock, buf, cifs_sb->local_nls, + &netfid, &oplock, buf, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR );if (rc) goto mknod_out; -/* BB Do not bother to decode buf since no local inode yet to put -* timestamps in, but we can reuse it safely */ +/* +* BB Do not bother to decode buf since no local inode yet to put +* timestamps in, but we can reuse it safely. +*/ pdev = (struct win_dev *)buf; - io_parms.netfid = fileHandle; + io_parms.netfid = netfid; io_parms.pid = current->tgid; - io_parms.tcon = pTcon; + io_parms.tcon = tcon; io_parms.offset =0 ; io_parms.length =sizeof (struct win_dev );if (S_ISCHR (mode)) {memcpy (pdev->type,"IntxCHR" ,8 ); - pdev->major = -cpu_to_le64 (MAJOR (device_number)); - pdev->minor = -cpu_to_le64 (MINOR (device_number)); - rc =CIFSSMBWrite (xid, &io_parms, - &bytes_written, (char *)pdev, -NULL ,0 ); + pdev->major =cpu_to_le64 (MAJOR (device_number)); + pdev->minor =cpu_to_le64 (MINOR (device_number)); + rc =CIFSSMBWrite (xid, &io_parms, &bytes_written, (char *)pdev, +NULL ,0 ); }else if (S_ISBLK (mode)) {memcpy (pdev->type,"IntxBLK" ,8 ); - pdev->major = -cpu_to_le64 (MAJOR (device_number)); - pdev->minor = -cpu_to_le64 (MINOR (device_number)); - rc =CIFSSMBWrite (xid, &io_parms, - &bytes_written, (char *)pdev, -NULL ,0 ); + pdev->major =cpu_to_le64 (MAJOR (device_number)); + pdev->minor =cpu_to_le64 (MINOR (device_number)); + rc =CIFSSMBWrite (xid, &io_parms, &bytes_written, (char *)pdev, +NULL ,0 ); }/* else if (S_ISFIFO) */ -CIFSSMBClose (xid, pTcon, fileHandle); +CIFSSMBClose (xid, tcon, netfid);d_drop (direntry);/* FIXME: add code here to set EAs */
Signature · 1 line
1.7.10.4
PATCH 3/4 CIFS: Remove extra indentation in cifs_sfu_type
In reply to a message not in the archive--- fs/cifs/inode.c | 97 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 47 deletions(-)
fs/cifs/inode.c +50 -47
@@ -404,7 +404,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, }static int -cifs_sfu_type (struct cifs_fattr *fattr,const unsigned char *path, +cifs_sfu_type (struct cifs_fattr *fattr,const char *path,struct cifs_sb_info *cifs_sb,unsigned int xid) {int rc;
@@ -416,6 +416,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,char buf[24 ];unsigned int bytes_read;char *pbuf; +int buf_type =CIFS_NO_BUFFER ; pbuf = buf;
@@ -441,57 +442,59 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); -if (rc ==0 ) { -int buf_type =CIFS_NO_BUFFER ; -/* Read header */ - io_parms.netfid = netfid; - io_parms.pid = current->tgid; - io_parms.tcon = tcon; - io_parms.offset =0 ; - io_parms.length =24 ; - rc =CIFSSMBRead (xid, &io_parms, &bytes_read, &pbuf, - &buf_type); -if ((rc ==0 ) && (bytes_read >=8 )) { -if (memcmp ("IntxBLK" , pbuf,8 ) ==0 ) { -cifs_dbg (FYI ,"Block device\n" ); - fattr->cf_mode |=S_IFBLK ; - fattr->cf_dtype =DT_BLK ; -if (bytes_read ==24 ) { -/* we have enough to decode dev num */ -__u64 mjr;/* major */ -__u64 mnr;/* minor */ - mjr =le64_to_cpu (*(__le64 *)(pbuf+8 )); - mnr =le64_to_cpu (*(__le64 *)(pbuf+16 )); - fattr->cf_rdev =MKDEV (mjr, mnr); - } - }else if (memcmp ("IntxCHR" , pbuf,8 ) ==0 ) { -cifs_dbg (FYI ,"Char device\n" ); - fattr->cf_mode |=S_IFCHR ; - fattr->cf_dtype =DT_CHR ; -if (bytes_read ==24 ) { -/* we have enough to decode dev num */ -__u64 mjr;/* major */ -__u64 mnr;/* minor */ - mjr =le64_to_cpu (*(__le64 *)(pbuf+8 )); - mnr =le64_to_cpu (*(__le64 *)(pbuf+16 )); - fattr->cf_rdev =MKDEV (mjr, mnr); - } - }else if (memcmp ("IntxLNK" , pbuf,7 ) ==0 ) { -cifs_dbg (FYI ,"Symlink\n" ); - fattr->cf_mode |=S_IFLNK ; - fattr->cf_dtype =DT_LNK ; - }else { - fattr->cf_mode |=S_IFREG ;/* file? */ - fattr->cf_dtype =DT_REG ; - rc = -EOPNOTSUPP ; +if (rc) { +cifs_put_tlink (tlink); +return rc; + } + +/* Read header */ + io_parms.netfid = netfid; + io_parms.pid = current->tgid; + io_parms.tcon = tcon; + io_parms.offset =0 ; + io_parms.length =24 ; + + rc =CIFSSMBRead (xid, &io_parms, &bytes_read, &pbuf, &buf_type); +if ((rc ==0 ) && (bytes_read >=8 )) { +if (memcmp ("IntxBLK" , pbuf,8 ) ==0 ) { +cifs_dbg (FYI ,"Block device\n" ); + fattr->cf_mode |=S_IFBLK ; + fattr->cf_dtype =DT_BLK ; +if (bytes_read ==24 ) { +/* we have enough to decode dev num */ +__u64 mjr;/* major */ +__u64 mnr;/* minor */ + mjr =le64_to_cpu (*(__le64 *)(pbuf+8 )); + mnr =le64_to_cpu (*(__le64 *)(pbuf+16 )); + fattr->cf_rdev =MKDEV (mjr, mnr); + } + }else if (memcmp ("IntxCHR" , pbuf,8 ) ==0 ) { +cifs_dbg (FYI ,"Char device\n" ); + fattr->cf_mode |=S_IFCHR ; + fattr->cf_dtype =DT_CHR ; +if (bytes_read ==24 ) { +/* we have enough to decode dev num */ +__u64 mjr;/* major */ +__u64 mnr;/* minor */ + mjr =le64_to_cpu (*(__le64 *)(pbuf+8 )); + mnr =le64_to_cpu (*(__le64 *)(pbuf+16 )); + fattr->cf_rdev =MKDEV (mjr, mnr); } + }else if (memcmp ("IntxLNK" , pbuf,7 ) ==0 ) { +cifs_dbg (FYI ,"Symlink\n" ); + fattr->cf_mode |=S_IFLNK ; + fattr->cf_dtype =DT_LNK ; }else { - fattr->cf_mode |=S_IFREG ;/* then it is a file */ + fattr->cf_mode |=S_IFREG ;/* file? */ fattr->cf_dtype =DT_REG ; - rc = -EOPNOTSUPP ;/* or some unknown SFU type */ + rc = -EOPNOTSUPP ; } -CIFSSMBClose (xid, tcon, netfid); + }else { + fattr->cf_mode |=S_IFREG ;/* then it is a file */ + fattr->cf_dtype =DT_REG ; + rc = -EOPNOTSUPP ;/* or some unknown SFU type */ } +CIFSSMBClose (xid, tcon, netfid);cifs_put_tlink (tlink);return rc; }
Signature · 1 line
1.7.10.4
PATCH 4/4 CIFS: Cleanup cifs open codepath
In reply to a message not in the archiveRename CIFSSMBOpen to CIFS_open and make it takecifs_open_parms structure as a parm.
--- fs/cifs/cifsacl.c | 40 +++++++++++++++++++--------- fs/cifs/cifsproto.h | 7 ++--- fs/cifs/cifssmb.c | 16 +++++++---- fs/cifs/dir.c | 21 ++++++++++----- fs/cifs/file.c | 2 +- fs/cifs/inode.c | 73 +++++++++++++++++++++++++++++++++------------------ fs/cifs/link.c | 44 ++++++++++++++++++++----------- fs/cifs/smb1ops.c | 71 +++++++++++++++++++++++++++++-------------------- 8 files changed, 174 insertions(+), 100 deletions(-)
fs/cifs/cifsacl.c +28 -12
@@ -895,9 +895,10 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,int oplock =0 ;unsigned int xid;int rc, create_options =0 ; -__u16 fid;struct cifs_tcon *tcon;struct tcon_link *tlink =cifs_sb_tlink (cifs_sb); +struct cifs_fid fid; +struct cifs_open_parms oparms;if (IS_ERR (tlink))return ERR_CAST (tlink);
@@ -908,12 +909,19 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,if (backup_cred (cifs_sb)) create_options |=CREATE_OPEN_BACKUP_INTENT ; - rc =CIFSSMBOpen (xid, tcon, path,FILE_OPEN ,READ_CONTROL , - create_options, &fid, &oplock,NULL , cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR ); + oparms.tcon = tcon; + oparms.cifs_sb = cifs_sb; + oparms.desired_access =READ_CONTROL ; + oparms.create_options = create_options; + oparms.disposition =FILE_OPEN ; + oparms.path = path; + oparms.fid = &fid; + oparms.reconnect = false; + + rc =CIFS_open (xid, &oparms, &oplock,NULL );if (!rc) { - rc =CIFSSMBGetCIFSACL (xid, tcon, fid, &pntsd, pacllen); -CIFSSMBClose (xid, tcon, fid); + rc =CIFSSMBGetCIFSACL (xid, tcon, fid.netfid, &pntsd, pacllen); +CIFSSMBClose (xid, tcon, fid.netfid); }cifs_put_tlink (tlink);
@@ -950,10 +958,11 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,int oplock =0 ;unsigned int xid;int rc, access_flags, create_options =0 ; -__u16 fid;struct cifs_tcon *tcon;struct cifs_sb_info *cifs_sb =CIFS_SB (inode->i_sb);struct tcon_link *tlink =cifs_sb_tlink (cifs_sb); +struct cifs_fid fid; +struct cifs_open_parms oparms;if (IS_ERR (tlink))return PTR_ERR (tlink);
@@ -969,18 +978,25 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,else access_flags =WRITE_DAC ; - rc =CIFSSMBOpen (xid, tcon, path,FILE_OPEN , access_flags, - create_options, &fid, &oplock,NULL , cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR ); + oparms.tcon = tcon; + oparms.cifs_sb = cifs_sb; + oparms.desired_access = access_flags; + oparms.create_options = create_options; + oparms.disposition =FILE_OPEN ; + oparms.path = path; + oparms.fid = &fid; + oparms.reconnect = false; + + rc =CIFS_open (xid, &oparms, &oplock,NULL );if (rc) {cifs_dbg (VFS ,"Unable to open file to set ACL\n" ); goto out; } - rc =CIFSSMBSetCIFSACL (xid, tcon, fid, pnntsd, acllen, aclflag); + rc =CIFSSMBSetCIFSACL (xid, tcon, fid.netfid, pnntsd, acllen, aclflag);cifs_dbg (NOISY ,"SetCIFSACL rc = %d\n" , rc); -CIFSSMBClose (xid, tcon, fid); +CIFSSMBClose (xid, tcon, fid.netfid); out:free_xid (xid);cifs_put_tlink (tlink);
fs/cifs/cifsproto.h +2 -5
@@ -362,11 +362,8 @@ extern int CIFSSMBQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nls_codepage);extern int CIFSSMB_set_compression (const unsigned int xid,struct cifs_tcon *tcon,__u16 fid); -extern int CIFSSMBOpen (const unsigned int xid,struct cifs_tcon *tcon, -const char *path,const int disposition, -const int desired_access,const int create_options, -__u16 *netfid,int *oplock,FILE_ALL_INFO *buf, -const struct nls_table *nls,int remap); +extern int CIFS_open (const unsigned int xid,struct cifs_open_parms *oparms, +int *oplock,FILE_ALL_INFO *buf); extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon, const char *fileName, const int disposition, const int access_flags, const int omode,
fs/cifs/cifssmb.c +11 -5
@@ -1273,10 +1273,8 @@ OldOpenRetry: }int -CIFSSMBOpen (const unsigned int xid,struct cifs_tcon *tcon, -const char *path,const int disposition,const int desired_access, -const int create_options,__u16 *netfid,int *oplock, -FILE_ALL_INFO *buf,const struct nls_table *nls,int remap) +CIFS_open (const unsigned int xid,struct cifs_open_parms *oparms,int *oplock, +FILE_ALL_INFO *buf) {int rc = -EACCES ;OPEN_REQ *req =NULL ;
@@ -1284,6 +1282,14 @@ CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,int bytes_returned;int name_len;__u16 count; +struct cifs_sb_info *cifs_sb = oparms->cifs_sb; +struct cifs_tcon *tcon = oparms->tcon; +int remap = cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR ; +const struct nls_table *nls = cifs_sb->local_nls; +int create_options = oparms->create_options; +int desired_access = oparms->desired_access; +int disposition = oparms->disposition; +const char *path = oparms->path; openRetry: rc = smb_init(SMB_COM_NT_CREATE_ANDX, 24, tcon, (void **)&req,
@@ -1367,7 +1373,7 @@ openRetry:/* 1 byte no need to le_to_cpu */ *oplock = rsp->OplockLevel;/* cifs fid stays in le */ - *netfid = rsp->Fid; + oparms->fid->netfid = rsp->Fid;/* Let caller know file was created so we can set the mode. */ /* Do we care about the CreateAction in any other cases? */
fs/cifs/dir.c +14 -7
@@ -570,7 +570,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,char *full_path =NULL ;struct inode *newinode =NULL ;int oplock =0 ; -u16 netfid; +struct cifs_fid fid; +struct cifs_open_parms oparms;FILE_ALL_INFO *buf =NULL ;unsigned int bytes_written;struct win_dev *pdev;
@@ -640,10 +641,16 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,if (backup_cred (cifs_sb)) create_options |=CREATE_OPEN_BACKUP_INTENT ; - rc =CIFSSMBOpen (xid, tcon, full_path,FILE_CREATE , -GENERIC_WRITE , create_options, - &netfid, &oplock, buf, cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR ); + oparms.tcon = tcon; + oparms.cifs_sb = cifs_sb; + oparms.desired_access =GENERIC_WRITE ; + oparms.create_options = create_options; + oparms.disposition =FILE_CREATE ; + oparms.path = full_path; + oparms.fid = &fid; + oparms.reconnect = false; + + rc =CIFS_open (xid, &oparms, &oplock, buf);if (rc) goto mknod_out;
@@ -653,7 +660,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,*/ pdev = (struct win_dev *)buf; - io_parms.netfid = netfid; + io_parms.netfid = fid.netfid; io_parms.pid = current->tgid; io_parms.tcon = tcon; io_parms.offset =0 ;
@@ -671,7 +678,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, rc =CIFSSMBWrite (xid, &io_parms, &bytes_written, (char *)pdev,NULL ,0 ); }/* else if (S_ISFIFO) */ -CIFSSMBClose (xid, tcon, netfid); +CIFSSMBClose (xid, tcon, fid.netfid);d_drop (direntry);/* FIXME: add code here to set EAs */
fs/cifs/file.c +1 -1
@@ -678,7 +678,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)/* * Can not refresh inode by passing in file_info buf to be returned by -* CIFSSMBOpen and then calling get_inode_info with returned buf since +* ops->open and then calling get_inode_info with returned buf since * file might have write behind data that needs to be flushed and server * version of file size can be stale. If we knew for sure that inode was * not dirty locally we could do this.
fs/cifs/inode.c +47 -26
163 lines not on this page · raw message
fs/cifs/link.c +28 -16
87 lines not on this page · raw message
fs/cifs/smb1ops.c +43 -28
139 lines not on this page · raw message
Signature · 1 line
1.7.10.4
looks reasonable but am getting various minor whitespace errors scanning the patch series
Can you fixup and make sure it is checkpatch clean?
e.g.
ERROR: trailing whitespace
#123: FILE: fs/cifs/dir.c:650:
+^I/*^M$
ERROR: trailing whitespace
#124: FILE: fs/cifs/dir.c:651:
+^I * BB Do not bother to decode buf since no local inode yet to put^M$
ERROR: trailing whitespace
#125: FILE: fs/cifs/dir.c:652:
+^I * timestamps in, but we can reuse it safely.^M$
Quoted 27 lines · Pavel Shilovsky
This patchset includes various cleanups that touch open codepath. This will help to introduce share modes into cifs module easier.
Patches are rebased on top of Sachin's patchset "Clean up MF-Symlink code and add readlink support for DFS shares".
Pavel Shilovsky (4):
CIFS: Cleanup CIFSSMBOpen
CIFS: Cleanupcifs_mknod
CIFS: Remove extra indentation incifs_sfu_type
CIFS: Cleanup cifs open codepathfs/cifs/cifsacl.c | 40 +++++++++---- fs/cifs/cifsproto.h | 7 +-- fs/cifs/cifssmb.c | 158 +++++++++++++++++++++++++++--------------------- fs/cifs/dir.c | 59 +++++++++--------- fs/cifs/file.c | 2 +- fs/cifs/inode.c | 166 +++++++++++++++++++++++++++++---------------------- fs/cifs/link.c | 44 +++++++++----- fs/cifs/smb1ops.c | 71 +++++++++++++--------- 8 files changed, 317 insertions(+), 230 deletions(-)--
1.7.10.4--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Thanks, Steve
A message that is not in the archive (sent off-list or not yet received): CAH2r5muANBSSsG_adMzpwZcbn2-wWJK34xrY+5iRyMrdeGJv+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
2014/1/20 Steve French <[email protected]>:
Quoted 11 lines
looks reasonable but am getting various minor whitespace errors scanning the patch series
Can you fixup and make sure it is checkpatch clean?
e.g.
ERROR: trailing whitespace
#123: FILE:fs/cifs/dir.c:650:
+^I/*^M$
Quoted 8 lines
ERROR: trailing whitespace
#124: FILE:fs/cifs/dir.c:651:
+^I * BB Do not bother to decode buf since no local inode yet to put^M$ERROR: trailing whitespace
#125: FILE:fs/cifs/dir.c:652:
+^I * timestamps in, but we can reuse it safely.^M$
Steve, are you sure you got right variants? I tested my patches with checkpatch.pl and everything was ok. I applied them on top of your current for-next branch and attached.
Signature · 2 lines
Best regards, Pavel Shilovsky.
From patchwork Thu Jan 16 11:53:33 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [1/4] CIFS: Cleanup CIFSSMBOpen
From: Pavel Shilovsky <[email protected]>
X-Patchwork-Id: 3498071
Message-Id: <[email protected]>
To: [email protected]
Date: Thu, 16 Jan 2014 15:53:33 +0400
Remove indentation, fix comment style, rename camel case variables in preparation to make it work with cifs_open_parms structure as a parm.
---fs/cifs/cifsproto.h | 8 +--
fs/cifs/cifssmb.c | 150 ++++++++++++++++++++++++++++----------------------- 2 files changed, 86 insertions(+), 72 deletions(-)
fs/cifs/cifsproto.h +4 -4
@@ -363,10 +363,10 @@ extern int CIFSSMBQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,extern int CIFSSMB_set_compression (const unsigned int xid,struct cifs_tcon *tcon,__u16 fid);extern int CIFSSMBOpen (const unsigned int xid,struct cifs_tcon *tcon, -const char *fileName,const int disposition, -const int access_flags,const int omode, -__u16 *netfid,int *pOplock,FILE_ALL_INFO *, -const struct nls_table *nls_codepage,int remap); +const char *path,const int disposition, +const int desired_access,const int create_options, +__u16 *netfid,int *oplock,FILE_ALL_INFO *buf, +const struct nls_table *nls,int remap); extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon, const char *fileName, const int disposition, const int access_flags, const int omode,
fs/cifs/cifssmb.c +82 -68
185 lines not on this page · raw message
From patchwork Thu Jan 16 11:53:34 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [2/4] CIFS: Cleanup cifs_mknod
From: Pavel Shilovsky <[email protected]>
X-Patchwork-Id: 3498081
Message-Id: <[email protected]>
To: [email protected]
Date: Thu, 16 Jan 2014 15:53:34 +0400
Rename camel case variable and fix comment style.
---fs/cifs/dir.c | 48 ++++++++++++++++++++++--------------------------
1 file changed, 22 insertions(+), 26 deletions(-)
fs/cifs/dir.c +22 -26
97 lines not on this page · raw message
From patchwork Thu Jan 16 11:53:35 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [3/4] CIFS: Remove extra indentation in cifs_sfu_type
From: Pavel Shilovsky <[email protected]>
X-Patchwork-Id: 3498091
Message-Id: <[email protected]>
To: [email protected]
Date: Thu, 16 Jan 2014 15:53:35 +0400
---fs/cifs/inode.c | 97 ++++++++++++++++++++++++++++---------------------------
1 file changed, 50 insertions(+), 47 deletions(-)
fs/cifs/inode.c +50 -47
120 lines not on this page · raw message
From patchwork Thu Jan 16 11:53:36 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [4/4] CIFS: Cleanup cifs open codepath
From: Pavel Shilovsky <[email protected]>
X-Patchwork-Id: 3498101
Message-Id: <[email protected]>
To: [email protected]
Date: Thu, 16 Jan 2014 15:53:36 +0400
Rename CIFSSMBOpen to CIFS_open and make it takecifs_open_parms structure as a parm.
---fs/cifs/cifsacl.c | 40 +++++++++++++++++++---------
fs/cifs/cifsproto.h | 7 ++--- fs/cifs/cifssmb.c | 16 +++++++---- fs/cifs/dir.c | 21 ++++++++++----- fs/cifs/file.c | 2 +- fs/cifs/inode.c | 73 +++++++++++++++++++++++++++++++++------------------ fs/cifs/link.c | 44 ++++++++++++++++++++----------- fs/cifs/smb1ops.c | 71 +++++++++++++++++++++++++++++-------------------- 8 files changed, 174 insertions(+), 100 deletions(-)
fs/cifs/cifsacl.c +28 -12
@@ -895,9 +895,10 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,int oplock =0 ;unsigned int xid;int rc, create_options =0 ; -__u16 fid;struct cifs_tcon *tcon;struct tcon_link *tlink =cifs_sb_tlink (cifs_sb); +struct cifs_fid fid; +struct cifs_open_parms oparms;if (IS_ERR (tlink))return ERR_CAST (tlink);
@@ -908,12 +909,19 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,if (backup_cred (cifs_sb)) create_options |=CREATE_OPEN_BACKUP_INTENT ; - rc =CIFSSMBOpen (xid, tcon, path,FILE_OPEN ,READ_CONTROL , - create_options, &fid, &oplock,NULL , cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR ); + oparms.tcon = tcon; + oparms.cifs_sb = cifs_sb; + oparms.desired_access =READ_CONTROL ; + oparms.create_options = create_options; + oparms.disposition =FILE_OPEN ; + oparms.path = path; + oparms.fid = &fid; + oparms.reconnect = false; + + rc =CIFS_open (xid, &oparms, &oplock,NULL );if (!rc) { - rc =CIFSSMBGetCIFSACL (xid, tcon, fid, &pntsd, pacllen); -CIFSSMBClose (xid, tcon, fid); + rc =CIFSSMBGetCIFSACL (xid, tcon, fid.netfid, &pntsd, pacllen); +CIFSSMBClose (xid, tcon, fid.netfid); }cifs_put_tlink (tlink);
@@ -950,10 +958,11 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,int oplock =0 ;unsigned int xid;int rc, access_flags, create_options =0 ; -__u16 fid;struct cifs_tcon *tcon;struct cifs_sb_info *cifs_sb =CIFS_SB (inode->i_sb);struct tcon_link *tlink =cifs_sb_tlink (cifs_sb); +struct cifs_fid fid; +struct cifs_open_parms oparms;if (IS_ERR (tlink))return PTR_ERR (tlink);
@@ -969,18 +978,25 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,else access_flags =WRITE_DAC ; - rc =CIFSSMBOpen (xid, tcon, path,FILE_OPEN , access_flags, - create_options, &fid, &oplock,NULL , cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR ); + oparms.tcon = tcon; + oparms.cifs_sb = cifs_sb; + oparms.desired_access = access_flags; + oparms.create_options = create_options; + oparms.disposition =FILE_OPEN ; + oparms.path = path; + oparms.fid = &fid; + oparms.reconnect = false; + + rc =CIFS_open (xid, &oparms, &oplock,NULL );if (rc) {cifs_dbg (VFS ,"Unable to open file to set ACL\n" ); goto out; } - rc =CIFSSMBSetCIFSACL (xid, tcon, fid, pnntsd, acllen, aclflag); + rc =CIFSSMBSetCIFSACL (xid, tcon, fid.netfid, pnntsd, acllen, aclflag);cifs_dbg (NOISY ,"SetCIFSACL rc = %d\n" , rc); -CIFSSMBClose (xid, tcon, fid); +CIFSSMBClose (xid, tcon, fid.netfid); out:free_xid (xid);cifs_put_tlink (tlink);
fs/cifs/cifsproto.h +2 -5
@@ -362,11 +362,8 @@ extern int CIFSSMBQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nls_codepage);extern int CIFSSMB_set_compression (const unsigned int xid,struct cifs_tcon *tcon,__u16 fid); -extern int CIFSSMBOpen (const unsigned int xid,struct cifs_tcon *tcon, -const char *path,const int disposition, -const int desired_access,const int create_options, -__u16 *netfid,int *oplock,FILE_ALL_INFO *buf, -const struct nls_table *nls,int remap); +extern int CIFS_open (const unsigned int xid,struct cifs_open_parms *oparms, +int *oplock,FILE_ALL_INFO *buf); extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon, const char *fileName, const int disposition, const int access_flags, const int omode,
fs/cifs/cifssmb.c +11 -5
@@ -1273,10 +1273,8 @@ OldOpenRetry: }int -CIFSSMBOpen (const unsigned int xid,struct cifs_tcon *tcon, -const char *path,const int disposition,const int desired_access, -const int create_options,__u16 *netfid,int *oplock, -FILE_ALL_INFO *buf,const struct nls_table *nls,int remap) +CIFS_open (const unsigned int xid,struct cifs_open_parms *oparms,int *oplock, +FILE_ALL_INFO *buf) {int rc = -EACCES ;OPEN_REQ *req =NULL ;
@@ -1284,6 +1282,14 @@ CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,int bytes_returned;int name_len;__u16 count; +struct cifs_sb_info *cifs_sb = oparms->cifs_sb; +struct cifs_tcon *tcon = oparms->tcon; +int remap = cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR ; +const struct nls_table *nls = cifs_sb->local_nls; +int create_options = oparms->create_options; +int desired_access = oparms->desired_access; +int disposition = oparms->disposition; +const char *path = oparms->path; openRetry: rc = smb_init(SMB_COM_NT_CREATE_ANDX, 24, tcon, (void **)&req,
@@ -1367,7 +1373,7 @@ openRetry:/* 1 byte no need to le_to_cpu */ *oplock = rsp->OplockLevel;/* cifs fid stays in le */ - *netfid = rsp->Fid; + oparms->fid->netfid = rsp->Fid;/* Let caller know file was created so we can set the mode. */ /* Do we care about the CreateAction in any other cases? */
fs/cifs/dir.c +14 -7
@@ -570,7 +570,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,char *full_path =NULL ;struct inode *newinode =NULL ;int oplock =0 ; -u16 netfid; +struct cifs_fid fid; +struct cifs_open_parms oparms;FILE_ALL_INFO *buf =NULL ;unsigned int bytes_written;struct win_dev *pdev;
@@ -640,10 +641,16 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,if (backup_cred (cifs_sb)) create_options |=CREATE_OPEN_BACKUP_INTENT ; - rc =CIFSSMBOpen (xid, tcon, full_path,FILE_CREATE , -GENERIC_WRITE , create_options, - &netfid, &oplock, buf, cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MAP_SPECIAL_CHR ); + oparms.tcon = tcon; + oparms.cifs_sb = cifs_sb; + oparms.desired_access =GENERIC_WRITE ; + oparms.create_options = create_options; + oparms.disposition =FILE_CREATE ; + oparms.path = full_path; + oparms.fid = &fid; + oparms.reconnect = false; + + rc =CIFS_open (xid, &oparms, &oplock, buf);if (rc) goto mknod_out;
@@ -653,7 +660,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,*/ pdev = (struct win_dev *)buf; - io_parms.netfid = netfid; + io_parms.netfid = fid.netfid; io_parms.pid = current->tgid; io_parms.tcon = tcon; io_parms.offset =0 ;
@@ -671,7 +678,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, rc =CIFSSMBWrite (xid, &io_parms, &bytes_written, (char *)pdev,NULL ,0 ); }/* else if (S_ISFIFO) */ -CIFSSMBClose (xid, tcon, netfid); +CIFSSMBClose (xid, tcon, fid.netfid);d_drop (direntry);/* FIXME: add code here to set EAs */
fs/cifs/file.c +1 -1
@@ -678,7 +678,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)/* * Can not refresh inode by passing in file_info buf to be returned by -* CIFSSMBOpen and then calling get_inode_info with returned buf since +* ops->open and then calling get_inode_info with returned buf since * file might have write behind data that needs to be flushed and server * version of file size can be stale. If we knew for sure that inode was * not dirty locally we could do this.
fs/cifs/inode.c +47 -26
163 lines not on this page · raw message
fs/cifs/link.c +28 -16
87 lines not on this page · raw message
fs/cifs/smb1ops.c +43 -28
139 lines not on this page · raw message
A message that is not in the archive (sent off-list or not yet received): CAKywueRQMAhs-on41eLB7ju8L1fz3R7U=Bdi4mHcXcQ3GJOJOg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Steve French
AppliedThose four that you just sent checkpatch clean.
Merged into cifs-2.6.git
Any additional Reviewed-by would be appreciated for those 4.
Quoted 28 lines · Pavel Shilovsky
2014/1/20 Steve French <[email protected]>:
Quoted 11 lines
looks reasonable but am getting various minor whitespace errors scanning the patch series
Can you fixup and make sure it is checkpatch clean?
e.g.
ERROR: trailing whitespace
#123: FILE:fs/cifs/dir.c:650:
+^I/*^M$Quoted 8 lines
ERROR: trailing whitespace
#124: FILE:fs/cifs/dir.c:651:
+^I * BB Do not bother to decode buf since no local inode yet to put^M$ERROR: trailing whitespace
#125: FILE:fs/cifs/dir.c:652:
+^I * timestamps in, but we can reuse it safely.^M$Steve, are you sure you got right variants? I tested my patches with checkpatch.pl and everything was ok. I applied them on top of your current for-next branch and attached.
--
Best regards,
Pavel Shilovsky.
Signature · 3 lines
Thanks, Steve