staging: erofs: inode.c fix checkpatch issues
PATCH 1/1 staging: erofs: inode.c fix checkpatch issues
This patch solves various checkpatch check issues
Correct indentation on some functions, fix multiple assignments on a single line and brace-placement on a non-single condition statement.
--- drivers/staging/erofs/inode.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)
drivers/staging/erofs/inode.c +17 -16
@@ -25,7 +25,7 @@ static int read_inode(struct inode *inode, void *data)if (unlikely (vi->data_mapping_mode >=EROFS_INODE_LAYOUT_MAX )) {errln ("unknown data mapping mode %u of nid %llu" , - vi->data_mapping_mode, vi->nid); + vi->data_mapping_mode, vi->nid);DBG_BUGON (1 );return -EIO ; }
@@ -38,7 +38,7 @@ static int read_inode(struct inode *inode, void *data) inode->i_mode =le16_to_cpu (v2->i_mode);if (S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode) || -S_ISLNK (inode->i_mode)) { +S_ISLNK (inode->i_mode)) { vi->raw_blkaddr =le32_to_cpu (v2->i_u.raw_blkaddr); }else if (S_ISCHR (inode->i_mode) ||S_ISBLK (inode->i_mode)) { inode->i_rdev =
@@ -54,10 +54,10 @@ static int read_inode(struct inode *inode, void *data)set_nlink (inode,le32_to_cpu (v2->i_nlink));/* ns timestamp */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = -le64_to_cpu (v2->i_ctime); - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = -le32_to_cpu (v2->i_ctime_nsec); + inode->i_mtime.tv_sec =le64_to_cpu (v2->i_ctime); + inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode->i_mtime.tv_nsec =le32_to_cpu (v2->i_ctime_nsec); + inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; inode->i_size =le64_to_cpu (v2->i_size); }else if (__inode_version (advise) ==EROFS_INODE_LAYOUT_V1 ) {
@@ -68,7 +68,7 @@ static int read_inode(struct inode *inode, void *data) inode->i_mode =le16_to_cpu (v1->i_mode);if (S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode) || -S_ISLNK (inode->i_mode)) { +S_ISLNK (inode->i_mode)) { vi->raw_blkaddr =le32_to_cpu (v1->i_u.raw_blkaddr); }else if (S_ISCHR (inode->i_mode) ||S_ISBLK (inode->i_mode)) { inode->i_rdev =
@@ -84,15 +84,15 @@ static int read_inode(struct inode *inode, void *data)set_nlink (inode,le16_to_cpu (v1->i_nlink));/* use build time to derive all file time */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = - sbi->build_time; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = - sbi->build_time_nsec; + inode->i_mtime.tv_sec = sbi->build_time; + inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode->i_mtime.tv_nsec = sbi->build_time_nsec; + inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; inode->i_size =le32_to_cpu (v1->i_size); }else {errln ("unsupported on-disk inode version %u of nid %llu" , -__inode_version (advise), vi->nid); +__inode_version (advise), vi->nid);DBG_BUGON (1 );return -EIO ; }
@@ -173,7 +173,7 @@ static int fill_inode(struct inode *inode, int isdir)if (IS_ERR (page)) {errln ("failed to get inode (nid: %llu) page, err %ld" , - vi->nid,PTR_ERR (page)); + vi->nid,PTR_ERR (page));return PTR_ERR (page); }
@@ -260,7 +260,7 @@ static inline struct inode *erofs_iget_locked(struct super_block *sb, }struct inode *erofs_iget (struct super_block *sb, -erofs_nid_t nid,bool isdir) +erofs_nid_t nid,bool isdir) {struct inode *inode =erofs_iget_locked (sb, nid);
@@ -270,12 +270,13 @@ struct inode *erofs_iget(struct super_block *sb,if (inode->i_state &I_NEW ) {int err;struct erofs_vnode *vi =EROFS_V (inode); + vi->nid = nid; err =fill_inode (inode, isdir); -if (likely (!err)) +if (likely (!err)) {unlock_new_inode (inode); -else { + }else {iget_failed (inode); inode =ERR_PTR (err); }
Signature · 1 line
2.17.1
PATCH 1/1 staging: erofs: inode.c fix checkpatch issues
Hi Julian,
Quoted 6 lines · Julian Merida
This patch solves various checkpatch check issues
Correct indentation on some functions, fix multiple assignments on a single line and brace-placement on a non-single condition statement.
Signed-off-by Julian Merida <julianmr97 at gmail.com>
One patch for one type of checkpatch issues? and could you please check the other erofs source files as well?
Thanks,
Gao Xiang
Quoted 105 lines
--- drivers/staging/erofs/inode.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)drivers/staging/erofs/inode.c +17
-16@@ -25,7 +25,7 @@ static int read_inode(struct inode *inode, void *data)if (unlikely (vi->data_mapping_mode >=EROFS_INODE_LAYOUT_MAX )) {errln ("unknown data mapping mode %u of nid %llu" , - vi->data_mapping_mode, vi->nid); + vi->data_mapping_mode, vi->nid);DBG_BUGON (1 );return -EIO ; }@@ -38,7 +38,7 @@ static int read_inode(struct inode *inode, void *data) inode->i_mode =le16_to_cpu (v2->i_mode);if (S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode) || -S_ISLNK (inode->i_mode)) { +S_ISLNK (inode->i_mode)) { vi->raw_blkaddr =le32_to_cpu (v2->i_u.raw_blkaddr); }else if (S_ISCHR (inode->i_mode) ||S_ISBLK (inode->i_mode)) { inode->i_rdev =@@ -54,10 +54,10 @@ static int read_inode(struct inode *inode, void *data)set_nlink (inode,le32_to_cpu (v2->i_nlink));/* ns timestamp */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = -le64_to_cpu (v2->i_ctime); - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = -le32_to_cpu (v2->i_ctime_nsec); + inode->i_mtime.tv_sec =le64_to_cpu (v2->i_ctime); + inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode->i_mtime.tv_nsec =le32_to_cpu (v2->i_ctime_nsec); + inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; inode->i_size =le64_to_cpu (v2->i_size); }else if (__inode_version (advise) ==EROFS_INODE_LAYOUT_V1 ) {@@ -68,7 +68,7 @@ static int read_inode(struct inode *inode, void *data) inode->i_mode =le16_to_cpu (v1->i_mode);if (S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode) || -S_ISLNK (inode->i_mode)) { +S_ISLNK (inode->i_mode)) { vi->raw_blkaddr =le32_to_cpu (v1->i_u.raw_blkaddr); }else if (S_ISCHR (inode->i_mode) ||S_ISBLK (inode->i_mode)) { inode->i_rdev =@@ -84,15 +84,15 @@ static int read_inode(struct inode *inode, void *data)set_nlink (inode,le16_to_cpu (v1->i_nlink));/* use build time to derive all file time */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = - sbi->build_time; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = - sbi->build_time_nsec; + inode->i_mtime.tv_sec = sbi->build_time; + inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode->i_mtime.tv_nsec = sbi->build_time_nsec; + inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; inode->i_size =le32_to_cpu (v1->i_size); }else {errln ("unsupported on-disk inode version %u of nid %llu" , -__inode_version (advise), vi->nid); +__inode_version (advise), vi->nid);DBG_BUGON (1 );return -EIO ; }@@ -173,7 +173,7 @@ static int fill_inode(struct inode *inode, int isdir)if (IS_ERR (page)) {errln ("failed to get inode (nid: %llu) page, err %ld" , - vi->nid,PTR_ERR (page)); + vi->nid,PTR_ERR (page));return PTR_ERR (page); }@@ -260,7 +260,7 @@ static inline struct inode *erofs_iget_locked(struct super_block *sb, }struct inode *erofs_iget (struct super_block *sb, -erofs_nid_t nid,bool isdir) +erofs_nid_t nid,bool isdir) {struct inode *inode =erofs_iget_locked (sb, nid);@@ -270,12 +270,13 @@ struct inode *erofs_iget(struct super_block *sb,if (inode->i_state &I_NEW ) {int err;struct erofs_vnode *vi =EROFS_V (inode); + vi->nid = nid; err =fill_inode (inode, isdir); -if (likely (!err)) +if (likely (!err)) {unlock_new_inode (inode); -else { + }else {iget_failed (inode); inode =ERR_PTR (err); }
PATCH 1/1 staging: erofs: inode.c fix checkpatch issues
Yes, of course! Thank you very much for your kind reply. I only made this simple patch because this is my first patch ever and I didn't know how you used to work.
I will be sending the rest of the patches to you in the next few days.
Best regards,
Julian M?rida
Quoted 118 lines · On Sun, Mar 10, 2019, 04:52 Gao Xiang <[email protected]> wrote:
Hi Julian,
Quoted 6 lines · Julian Merida
This patch solves various checkpatch check issues
Correct indentation on some functions, fix multiple assignments on a single line and brace-placement on a non-single condition statement.
Signed-off-by Julian Merida <julianmr97 at gmail.com>One patch for one type of checkpatch issues? and could you please check the other erofs source files as well?
Thanks,
Gao XiangReview
Quoted 5 lines
--- drivers/staging/erofs/inode.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)(quoted diff) +0
-0
b/drivers/staging/erofs/inode.cQuoted 13 lines
index
924b8dfc7a8f..be9bfd04df41100644drivers/staging/erofs/inode.c +1
-1@@ -25,7 +25,7 @@ static int read_inode(struct inode *inode, void *data)if (unlikely (vi->data_mapping_mode >=EROFS_INODE_LAYOUT_MAX )) {errln ("unknown data mapping mode %u of nid %llu" , - vi->data_mapping_mode, vi->nid); + vi->data_mapping_mode, vi->nid);DBG_BUGON (1 );return -EIO ; }drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void *data) · line 43
Quoted 7 lines
drivers/staging/erofs/inode.c +1
-1@@ -38,7 +38,7 @@ static int read_inode(struct inode *inode, void *data) inode->i_mode =le16_to_cpu (v2->i_mode);if (S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode) || -S_ISLNK (inode->i_mode)) { +S_ISLNK (inode->i_mode)) { vi->raw_blkaddr =le32_to_cpu (v2->i_u.raw_blkaddr); } else if (S_ISCHR(inode->i_mode) ||
S_ISBLK(inode->i_mode)) {drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void
Quoted 2 lines
drivers/staging/erofs/inode.c +0
-0inode->i_rdev =@@ -54,10 +54,10 @@ static int read_inode(struct inode *inode, void*data)
Quoted 15 lines
drivers/staging/erofs/inode.c +4
-4set_nlink (inode,le32_to_cpu (v2->i_nlink));/* ns timestamp */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = -le64_to_cpu (v2->i_ctime); - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = -le32_to_cpu (v2->i_ctime_nsec); + inode->i_mtime.tv_sec =le64_to_cpu (v2->i_ctime); + inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode->i_mtime.tv_nsec =le32_to_cpu (v2->i_ctime_nsec); + inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; inode->i_size =le64_to_cpu (v2->i_size); }else if (__inode_version (advise) ==EROFS_INODE_LAYOUT_V1 ) {drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void *data) · line 73
Quoted 7 lines
drivers/staging/erofs/inode.c +1
-1@@ -68,7 +68,7 @@ static int read_inode(struct inode *inode, void *data) inode->i_mode =le16_to_cpu (v1->i_mode);if (S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode) || -S_ISLNK (inode->i_mode)) { +S_ISLNK (inode->i_mode)) { vi->raw_blkaddr =le32_to_cpu (v1->i_u.raw_blkaddr); } else if (S_ISCHR(inode->i_mode) ||
S_ISBLK(inode->i_mode)) {drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void
Quoted 2 lines
drivers/staging/erofs/inode.c +0
-0inode->i_rdev =@@ -84,15 +84,15 @@ static int read_inode(struct inode *inode, void*data)
drivers/staging/erofs/inode.c static inline struct inode *erofs_iget_locked(struct
Quoted 30 lines
drivers/staging/erofs/inode.c +6
-6set_nlink (inode,le16_to_cpu (v1->i_nlink));/* use build time to derive all file time */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = - sbi->build_time; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = - sbi->build_time_nsec; + inode->i_mtime.tv_sec = sbi->build_time; + inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode->i_mtime.tv_nsec = sbi->build_time_nsec; + inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; inode->i_size =le32_to_cpu (v1->i_size); }else {errln ("unsupported on-disk inode version %u of nid %llu" , -__inode_version (advise), vi->nid); +__inode_version (advise), vi->nid);DBG_BUGON (1 );return -EIO ; }@@ -173,7 +173,7 @@ static int fill_inode(struct inode *inode, int isdir)if (IS_ERR (page)) {errln ("failed to get inode (nid: %llu) page, err %ld" , - vi->nid,PTR_ERR (page)); + vi->nid,PTR_ERR (page));return PTR_ERR (page); }@@ -260,7 +260,7 @@ static inline struct inode *erofs_iget_locked(struct
super_block*sb,Quoted 15 lines
drivers/staging/erofs/inode.c +2
-1}struct inode *erofs_iget (struct super_block *sb, -erofs_nid_t nid,bool isdir) +erofs_nid_t nid,bool isdir) {struct inode *inode =erofs_iget_locked (sb, nid);@@ -270,12 +270,13 @@ struct inode *erofs_iget(struct super_block *sb,if (inode->i_state &I_NEW ) {int err;struct erofs_vnode *vi =EROFS_V (inode); + vi->nid = nid;
Quoted 10 lines
drivers/staging/erofs/inode.c struct inode *erofs_iget(struct super_block *sb, · line 282
Quoted 9 lines
drivers/staging/erofs/inode.c +2
-2err =fill_inode (inode, isdir); -if (likely (!err)) +if (likely (!err)) {unlock_new_inode (inode); -else { + }else {iget_failed (inode); inode =ERR_PTR (err); }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-erofs/attachments/20190311/baed81d7/attachment.htm>
PATCH 1/1 staging: erofs: inode.c fix checkpatch issues
Quoted 3 lines · Julian Merida
Yes, of course! Thank you very much for your kind reply. I only made this simple patch because this is my first patch ever and I didn't know how you used to work.
I will be sending?the rest of the patches?to you in the next few days.
Yes, I think it' better to seperate your first patch into different type as well, each type needs one patch. and it is preferred to fix a type in one patch for all erofs source files if you have extra time (eg, fix 4 checkpatch types in 4 patches for all erofs source code.)
Thanks,
Gao Xiang
Quoted 128 lines
Best regards,?
Julian M?ridaOn Sun, Mar 10, 2019, 04:52 Gao Xiang <[email protected] <mailto:[email protected]>> wrote:
Hi Julian, On 2019/3/10 10:46, Julian Merida wrote: > This patch solves various checkpatch check issues > > Correct indentation on some functions, fix multiple assignments > on a single line and brace-placement on a non-single condition statement. > > Signed-off-by: Julian Merida <julianmr97 at gmail.com <mailto:julianmr97 at gmail.com>> One patch for one type of checkpatch issues? and could you please check the other erofs source files as well? Thanks, Gao Xiang > --- >? drivers/staging/erofs/inode.c | 33 +++++++++++++++++---------------- >? 1 file changed, 17 insertions(+), 16 deletions(-) > > diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c > index 924b8dfc7a8f..be9bfd04df41 100644 > --- a/drivers/staging/erofs/inode.c > +++ b/drivers/staging/erofs/inode.c > @@ -25,7 +25,7 @@ static int read_inode(struct inode *inode, void *data) >? >? ? ? ?if (unlikely(vi->data_mapping_mode >= EROFS_INODE_LAYOUT_MAX)) { >? ? ? ? ? ? ? ?errln("unknown data mapping mode %u of nid %llu", > -? ? ? ? ? ? ? ? ? ? ?vi->data_mapping_mode, vi->nid); > +? ? ? ? ? ? ? ? ? ?vi->data_mapping_mode, vi->nid); >? ? ? ? ? ? ? ?DBG_BUGON(1); >? ? ? ? ? ? ? ?return -EIO; >? ? ? ?} > @@ -38,7 +38,7 @@ static int read_inode(struct inode *inode, void *data) >? >? ? ? ? ? ? ? ?inode->i_mode = le16_to_cpu(v2->i_mode); >? ? ? ? ? ? ? ?if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || > -? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?S_ISLNK(inode->i_mode)) { > +? ? ? ? ? ? ? ? ?S_ISLNK(inode->i_mode)) { >? ? ? ? ? ? ? ? ? ? ? ?vi->raw_blkaddr = le32_to_cpu(v2->i_u.raw_blkaddr); >? ? ? ? ? ? ? ?} else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) { >? ? ? ? ? ? ? ? ? ? ? ?inode->i_rdev = > @@ -54,10 +54,10 @@ static int read_inode(struct inode *inode, void *data) >? ? ? ? ? ? ? ?set_nlink(inode, le32_to_cpu(v2->i_nlink)); >? >? ? ? ? ? ? ? ?/* ns timestamp */ > -? ? ? ? ? ? ?inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = > -? ? ? ? ? ? ? ? ? ? ?le64_to_cpu(v2->i_ctime); > -? ? ? ? ? ? ?inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = > -? ? ? ? ? ? ? ? ? ? ?le32_to_cpu(v2->i_ctime_nsec); > +? ? ? ? ? ? ?inode->i_mtime.tv_sec = le64_to_cpu(v2->i_ctime); > +? ? ? ? ? ? ?inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; > +? ? ? ? ? ? ?inode->i_mtime.tv_nsec = le32_to_cpu(v2->i_ctime_nsec); > +? ? ? ? ? ? ?inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; >? >? ? ? ? ? ? ? ?inode->i_size = le64_to_cpu(v2->i_size); >? ? ? ?} else if (__inode_version(advise) == EROFS_INODE_LAYOUT_V1) { > @@ -68,7 +68,7 @@ static int read_inode(struct inode *inode, void *data) >? >? ? ? ? ? ? ? ?inode->i_mode = le16_to_cpu(v1->i_mode); >? ? ? ? ? ? ? ?if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || > -? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?S_ISLNK(inode->i_mode)) { > +? ? ? ? ? ? ? ? ?S_ISLNK(inode->i_mode)) { >? ? ? ? ? ? ? ? ? ? ? ?vi->raw_blkaddr = le32_to_cpu(v1->i_u.raw_blkaddr); >? ? ? ? ? ? ? ?} else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) { >? ? ? ? ? ? ? ? ? ? ? ?inode->i_rdev = > @@ -84,15 +84,15 @@ static int read_inode(struct inode *inode, void *data) >? ? ? ? ? ? ? ?set_nlink(inode, le16_to_cpu(v1->i_nlink)); >? >? ? ? ? ? ? ? ?/* use build time to derive all file time */ > -? ? ? ? ? ? ?inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = > -? ? ? ? ? ? ? ? ? ? ?sbi->build_time; > -? ? ? ? ? ? ?inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = > -? ? ? ? ? ? ? ? ? ? ?sbi->build_time_nsec; > +? ? ? ? ? ? ?inode->i_mtime.tv_sec = sbi->build_time; > +? ? ? ? ? ? ?inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; > +? ? ? ? ? ? ?inode->i_mtime.tv_nsec = sbi->build_time_nsec; > +? ? ? ? ? ? ?inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; >? >? ? ? ? ? ? ? ?inode->i_size = le32_to_cpu(v1->i_size); >? ? ? ?} else { >? ? ? ? ? ? ? ?errln("unsupported on-disk inode version %u of nid %llu", > -? ? ? ? ? ? ? ? ? ? ?__inode_version(advise), vi->nid); > +? ? ? ? ? ? ? ? ? ?__inode_version(advise), vi->nid); >? ? ? ? ? ? ? ?DBG_BUGON(1); >? ? ? ? ? ? ? ?return -EIO; >? ? ? ?} > @@ -173,7 +173,7 @@ static int fill_inode(struct inode *inode, int isdir) >? >? ? ? ?if (IS_ERR(page)) { >? ? ? ? ? ? ? ?errln("failed to get inode (nid: %llu) page, err %ld", > -? ? ? ? ? ? ? ? ? ? ?vi->nid, PTR_ERR(page)); > +? ? ? ? ? ? ? ? ? ?vi->nid, PTR_ERR(page)); >? ? ? ? ? ? ? ?return PTR_ERR(page); >? ? ? ?} >? > @@ -260,7 +260,7 @@ static inline struct inode *erofs_iget_locked(struct super_block *sb, >? } >? >? struct inode *erofs_iget(struct super_block *sb, > -? ? ?erofs_nid_t nid, bool isdir) > +? ? ? ? ? ? ? ? ? ? ? erofs_nid_t nid, bool isdir) >? { >? ? ? ?struct inode *inode = erofs_iget_locked(sb, nid); >? > @@ -270,12 +270,13 @@ struct inode *erofs_iget(struct super_block *sb, >? ? ? ?if (inode->i_state & I_NEW) { >? ? ? ? ? ? ? ?int err; >? ? ? ? ? ? ? ?struct erofs_vnode *vi = EROFS_V(inode); > + >? ? ? ? ? ? ? ?vi->nid = nid; >? >? ? ? ? ? ? ? ?err = fill_inode(inode, isdir); > -? ? ? ? ? ? ?if (likely(!err)) > +? ? ? ? ? ? ?if (likely(!err)) { >? ? ? ? ? ? ? ? ? ? ? ?unlock_new_inode(inode); > -? ? ? ? ? ? ?else { > +? ? ? ? ? ? ?} else { >? ? ? ? ? ? ? ? ? ? ? ?iget_failed(inode); >? ? ? ? ? ? ? ? ? ? ? ?inode = ERR_PTR(err); >? ? ? ? ? ? ? ?}
PATCH 1/1 staging: erofs: inode.c fix checkpatch issues
Ok perfect! I'll work that way and correct each type in its own individual patch. Thank you again for your patience and your time.
Regards,
Juli?n M?rida
Quoted 147 lines · On Mon, Mar 11, 2019, 03:38 Gao Xiang <[email protected]> wrote:
Quoted 1 line · Julian Merida
Yes, of course! Thank you very much for your kind reply. I only made
this simple patch because this is my first patch ever and I didn't know how you used to work.
Quoted 2 lines
I will be sending the rest of the patches to you in the next few days.
Yes, I think it' better to seperate your first patch into different type as well, each type needs one patch.
and it is preferred to fix a type in one patch for all erofs source files if you have extra time (eg, fix 4
checkpatch types in 4 patches for all erofs source code.)Thanks,
Gao XiangQuoted 5 lines
Best regards,
Julian M?ridaOn Sun, Mar 10, 2019, 04:52 Gao Xiang <hsiangkao at aol.com <mailto:
Quoted 8 lines · [email protected]>> wrote:
Hi Julian,
On 2019/3/10 10:46, Julian Merida wrote:
> This patch solves various checkpatch check issues
>
> Correct indentation on some functions, fix multiple assignments > on a single line and brace-placement on a non-single conditionstatement.
Quoted 2 lines
Quoted 2 lines
Signed-off-by Julian Merida <julianmr97 at gmail.com <mailto:julianmr97 at gmail.com>>
Quoted 9 lines
One patch for one type of checkpatch issues? and could you please check the other erofs source files as well?
Thanks,
Gao Xiang> ---
>drivers/staging/erofs/inode.c| 33+++++++++++++++++----------------
Quoted 3 lines
Review
Quoted 3 lines
1 file changed, 17 insertions(+), 16 deletions(-)(quoted diff) +0
-0
b/drivers/staging/erofs/inode.cQuoted 4 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void
Quoted 4 lines
index
924b8dfc7a8f..be9bfd04df41100644drivers/staging/erofs/inode.c +0
-0@@ -25,7 +25,7 @@ static int read_inode(struct inode *inode, void*data)
Quoted 2 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void · line 25
Quoted 2 lines
drivers/staging/erofs/inode.c +0
-0if (unlikely(vi->data_mapping_mode >=
EROFS_INODE_LAYOUT_MAX)) {Quoted 7 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void
Quoted 7 lines
drivers/staging/erofs/inode.c +1
-1errln ("unknown data mapping mode %u of nid %llu" , - vi->data_mapping_mode, vi->nid); + vi->data_mapping_mode, vi->nid);DBG_BUGON (1 );return -EIO ; }@@ -38,7 +38,7 @@ static int read_inode(struct inode *inode, void*data)
Quoted 3 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void · line 39
Quoted 3 lines
drivers/staging/erofs/inode.c +0
-0inode->i_mode =le16_to_cpu (v2->i_mode); if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)|| > > -
S_ISLNK(inode->i_mode)) {Quoted 2 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void · line 41
Quoted 2 lines
drivers/staging/erofs/inode.c +1
-0+ S_ISLNK(inode->i_mode)) { vi->raw_blkaddr =
le32_to_cpu(v2->i_u.raw_blkaddr);Quoted 1 line
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void · line 42
Quoted 1 line
drivers/staging/erofs/inode.c +0
-0} else if (S_ISCHR(inode->i_mode) ||
S_ISBLK(inode->i_mode)) {Quoted 2 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode,
Quoted 2 lines
drivers/staging/erofs/inode.c +0
-0inode->i_rdev =@@ -54,10 +54,10 @@ static int read_inode(struct inode *inode,void *data)
Quoted 10 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void *data)
Quoted 10 lines
drivers/staging/erofs/inode.c +3
-4set_nlink (inode,le32_to_cpu (v2->i_nlink));/* ns timestamp */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = -le64_to_cpu (v2->i_ctime); - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = -le32_to_cpu (v2->i_ctime_nsec); + inode->i_mtime.tv_sec =le64_to_cpu (v2->i_ctime); + inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode->i_mtime.tv_nsec =
le32_to_cpu(v2->i_ctime_nsec);Quoted 4 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void *data)
Quoted 4 lines
drivers/staging/erofs/inode.c +1
-0+ inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec; inode->i_size =le64_to_cpu (v2->i_size); }else if (__inode_version (advise) ==EROFS_INODE_LAYOUT_V1 ){
Quoted 1 line
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void
Quoted 1 line
drivers/staging/erofs/inode.c +0
-0@@ -68,7 +68,7 @@ static int read_inode(struct inode *inode, void*data)
Quoted 3 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void · line 69
Quoted 3 lines
drivers/staging/erofs/inode.c +0
-0inode->i_mode =le16_to_cpu (v1->i_mode); if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)|| > > -
S_ISLNK(inode->i_mode)) {Quoted 2 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void · line 71
Quoted 2 lines
drivers/staging/erofs/inode.c +1
-0+ S_ISLNK(inode->i_mode)) { vi->raw_blkaddr =
le32_to_cpu(v1->i_u.raw_blkaddr);Quoted 1 line
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void · line 72
Quoted 1 line
drivers/staging/erofs/inode.c +0
-0} else if (S_ISCHR(inode->i_mode) ||
S_ISBLK(inode->i_mode)) {Quoted 2 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode,
Quoted 2 lines
drivers/staging/erofs/inode.c +0
-0inode->i_rdev =@@ -84,15 +84,15 @@ static int read_inode(struct inode *inode,void *data)
Quoted 12 lines
Quoted 12 lines
drivers/staging/erofs/inode.c +4
-4set_nlink (inode,le16_to_cpu (v1->i_nlink));/* use build time to derive all file time */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = - sbi->build_time; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = - sbi->build_time_nsec; + inode->i_mtime.tv_sec = sbi->build_time; + inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode->i_mtime.tv_nsec = sbi->build_time_nsec; + inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec;Quoted 3 lines
drivers/staging/erofs/inode.c static int read_inode(struct inode *inode, void *data)
Quoted 3 lines
drivers/staging/erofs/inode.c +0
-0inode->i_size =le32_to_cpu (v1->i_size); }else { errln("unsupported on-disk inode version %u of nid%llu",
Quoted 6 lines
drivers/staging/erofs/inode.c static int fill_inode(struct inode *inode, int
Quoted 6 lines
drivers/staging/erofs/inode.c +1
-1- __inode_version(advise), vi->nid); + __inode_version(advise), vi->nid);DBG_BUGON (1 );return -EIO ; }@@ -173,7 +173,7 @@ static int fill_inode(struct inode *inode, intisdir)
Quoted 3 lines
drivers/staging/erofs/inode.c static int fill_inode(struct inode *inode, int · line 174
Quoted 3 lines
drivers/staging/erofs/inode.c +0
-0if (IS_ERR (page)) { errln("failed to get inode (nid: %llu) page, err%ld",
Quoted 6 lines
drivers/staging/erofs/inode.c static inline struct inode
Quoted 6 lines
drivers/staging/erofs/inode.c +1
-1- vi->nid, PTR_ERR(page)); + vi->nid, PTR_ERR(page));return PTR_ERR (page); }@@ -260,7 +260,7 @@ static inline struct inode*erofs_iget_locked(struct
super_block*sb,Quoted 2 lines
Quoted 2 lines
drivers/staging/erofs/inode.c +0
-0}
Quoted 25 lines
Quoted 7 lines
drivers/staging/erofs/inode.c struct inode *erofs_iget(struct super_block
Quoted 7 lines
drivers/staging/erofs/inode.c +1
-1struct inode *erofs_iget (struct super_block *sb, -erofs_nid_t nid,bool isdir) +erofs_nid_t nid,bool isdir) {struct inode *inode =erofs_iget_locked (sb, nid);@@ -270,12 +270,13 @@ struct inode *erofs_iget(struct super_block*sb,
Quoted 16 lines
Quoted 15 lines
drivers/staging/erofs/inode.c +3
-2if (inode->i_state &I_NEW ) {int err;struct erofs_vnode *vi =EROFS_V (inode); + vi->nid = nid; err =fill_inode (inode, isdir); -if (likely (!err)) +if (likely (!err)) {unlock_new_inode (inode); -else { + }else {iget_failed (inode); inode =ERR_PTR (err); }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-erofs/attachments/20190311/6e94dd65/attachment.htm>