Skip to contentSkip to conversation

f2fs: remove duplicated code in the f2fs_lookup()

PATCH In review Taehee Yoo 2 participants 3 messages Apr 16, 2015 F2FS file system

lore
Share & tools
lore

Taehee Yoo

author
#0 lore raw

PATCH 1/1 f2fs: remove duplicated code in the f2fs_lookup()

in the f2fs_lookup(), checks that inode isn't null but d_splice_alias() has same routine at first line. so i remove this routine.

---
 fs/f2fs/namei.c | 2 --
 1 file changed, 2 deletions(-)
fs/f2fs/namei.c +0 -2
index e79639a9..f17b4b5 100644
@@ -204,8 +204,6 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
 		f2fs_put_page(page, 0);
 
 		inode = f2fs_iget(dir->i_sb, ino);
-		if (IS_ERR(inode))
-			return ERR_CAST(inode);
 	}
 
 	return d_splice_alias(inode, dentry);
Signature · 9 lines
1.9.1


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
maintainer
#1 lore raw

Hi Taehee,

Quoted 3 lines · Taehee Yoo

in the f2fs_lookup(), checks that inode isn't null but d_splice_alias() has same routine at first line. so i remove this routine.

In the latest f2fs, we cannot merge this patch.
Since some inline_dots codes were added with a valid inode before d_splice_alias.

Thanks,

Quoted 21 lines
---
 fs/f2fs/namei.c | 2 --
 1 file changed, 2 deletions(-)
fs/f2fs/namei.c +0 -2
index e79639a9..f17b4b5 100644
@@ -204,8 +204,6 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
 		f2fs_put_page(page, 0);
 
 		inode = f2fs_iget(dir->i_sb, ino);
-		if (IS_ERR(inode))
-			return ERR_CAST(inode);
 	}
 
 	return d_splice_alias(inode, dentry);
Signature · 1 line
1.9.1

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF

author
#2 lore raw

2015-04-17 2:00 GMT+09:00 Jaegeuk Kim <[email protected]>:

Quoted 26 lines

Hi Taehee,

Quoted 3 lines · Taehee Yoo

in the f2fs_lookup(), checks that inode isn't null but d_splice_alias() has same routine at first line. so i remove this routine.

In the latest f2fs, we cannot merge this patch.
Since some inline_dots codes were added with a valid inode before d_splice_alias.

Thanks,

Quoted 13 lines
---
 fs/f2fs/namei.c | 2 --
 1 file changed, 2 deletions(-)
fs/f2fs/namei.c +0 -0
index e79639a9..f17b4b5 100644
@@ -204,8 +204,6 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
              f2fs_put_page(page, 0);
 
Quoted 8 lines
Quoted 8 lines
fs/f2fs/namei.c +0 -3
              inode = f2fs_iget(dir->i_sb, ino);
-             if (IS_ERR(inode))
-                     return ERR_CAST(inode);
      }
 
      return d_splice_alias(inode, dentry);
--

1.9.1

apologize about imperfect patch.
Thank you for your review!

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF