Skip to contentSkip to conversation

f2fs: get rid of f2fs_inode_synced from f2fs_iget

PATCH In review Yufen Yu via Linux-f2fs-devel 3 participants 3 messages Jul 21, 2022 – Jul 24, 2022 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: get rid of f2fs_inode_synced from f2fs_iget

If f2fs_iget cannot search inode from inode cache, it will read the inode from disk. The processing of read from disk and init inode should not dirty the inode, as the commit 530e07042002 ("f2fs:
don't mark compressed inode dirty during f2fs_iget()").

Thus, we can remove the unnecessary f2fs_inode_synced().

---
 fs/f2fs/inode.c | 1 -
 1 file changed, 1 deletion(-)
fs/f2fs/inode.c +0 -1
index fc55f5bd1fcc..ce87b66c6dfe 100644
@@ -562,7 +562,6 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino)
 	return inode;
 
 bad_inode:
-	f2fs_inode_synced(inode);
 	iget_failed(inode);
 	trace_f2fs_iget_exit(inode, ret);
 	return ERR_PTR(ret);
Signature · 8 lines
2.31.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer
#1 lore raw
Quoted 4 lines · Yufen Yu

If f2fs_iget cannot search inode from inode cache, it will read the inode from disk. The processing of read from disk and init inode should not dirty the inode, as the commit 530e07042002 ("f2fs:
don't mark compressed inode dirty during f2fs_iget()").

f2fs_truncate can make this?

552 if (file_should_truncate(inode) &&
553 !is_sbi_flag_set(sbi, SBI_POR_DOING)) {
554 ret = f2fs_truncate(inode);
555 if (ret)
556 goto bad_inode;

Quoted 22 lines

Thus, we can remove the unnecessary f2fs_inode_synced().

---
 fs/f2fs/inode.c | 1 -
 1 file changed, 1 deletion(-)
fs/f2fs/inode.c +0 -1
index fc55f5bd1fcc..ce87b66c6dfe 100644
@@ -562,7 +562,6 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino)
 	return inode;
 
 bad_inode:
-	f2fs_inode_synced(inode);
 	iget_failed(inode);
 	trace_f2fs_iget_exit(inode, ret);
 	return ERR_PTR(ret);
Signature · 1 line
2.31.1

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

maintainer
#2 lore raw
Quoted 6 lines · Jaegeuk Kim
Quoted 4 lines · Yufen Yu

If f2fs_iget cannot search inode from inode cache, it will read the inode from disk. The processing of read from disk and init inode should not dirty the inode, as the commit 530e07042002 ("f2fs:
don't mark compressed inode dirty during f2fs_iget()").

Quoted 7 lines

f2fs_truncate can make this?

552 if (file_should_truncate(inode) &&
553 !is_sbi_flag_set(sbi, SBI_POR_DOING)) {
554 ret = f2fs_truncate(inode);
555 if (ret)
556 goto bad_inode;

__recover_inline_status() can also dirty inode?

Thanks,

Quoted 17 lines
Quoted 17 lines

Thus, we can remove the unnecessary f2fs_inode_synced().

---
  fs/f2fs/inode.c | 1 -
  1 file changed, 1 deletion(-)
fs/f2fs/inode.c +0 -0
index fc55f5bd1fcc..ce87b66c6dfe 100644
@@ -562,7 +562,6 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino)
  	return inode;
 
Quoted 7 lines
Quoted 7 lines
fs/f2fs/inode.c +0 -1
  bad_inode:
-	f2fs_inode_synced(inode);
  	iget_failed(inode);
  	trace_f2fs_iget_exit(inode, ret);
  	return ERR_PTR(ret);
Signature · 1 line
2.31.1

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel