Skip to contentSkip to conversation

f2fs: clean up structure extent_node

PATCH New Chao Yu 1 participant 2 messages Dec 18, 2018 F2FS file system

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/2 f2fs: clean up structure extent_node

The union in struct extent_node wass only to indicate below fields

	struct rb_node rb_node;
	union {
		struct {
			unsigned int fofs;
			unsigned int len;
		...
	...

can be parsed as fields in struct rb_entry, but they were never be used explicitly before, so let's remove them for cleanup.

---
 fs/f2fs/f2fs.h | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
fs/f2fs/f2fs.h +2 -10
index ab69c7454a05..a92e5ed78f53 100644
@@ -559,16 +559,8 @@ struct extent_info {
 };
 
 struct extent_node {
-	struct rb_node rb_node;
-	union {
-		struct {
-			unsigned int fofs;
-			unsigned int len;
-			u32 blk;
-		};
-		struct extent_info ei;	/* extent info */
-
-	};
+	struct rb_node rb_node;		/* rb node located in rb-tree */
+	struct extent_info ei;		/* extent info */
 	struct list_head list;		/* node in global extent list of sbi */
 	struct extent_tree *et;		/* extent tree pointer */
 };
Signature · 1 line
2.18.0.rc1
author
#1 lore raw

PATCH 2/2 f2fs: fix to dirty inode synchronously

If user change inode's i_flags via ioctl, let's add it into global dirty list, so that checkpoint can guarantee its persistence before fsync, it can make checkpoint keeping strong consistency.

---
 fs/f2fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -1
index ca9bdbb8651b..7bf28be811ab 100644
@@ -1685,7 +1685,7 @@ static int __f2fs_ioc_setflags(struct inode *inode, unsigned int flags)
 
 	inode->i_ctime = current_time(inode);
 	f2fs_set_inode_flags(inode);
-	f2fs_mark_inode_dirty_sync(inode, false);
+	f2fs_mark_inode_dirty_sync(inode, true);
 	return 0;
 }
 
Signature · 1 line
2.18.0.rc1