[PATCH 2/2] f2fs: call set_dirty_dir_page if inode is directory.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's more legible and efficient to call set_dirty_dir_page only if
inode->i_mode is directory before calling it.

Signed-off-by: Changman Lee <cm224.lee@xxxxxxxxxxx>
---
 fs/f2fs/checkpoint.c |    3 ---
 fs/f2fs/data.c       |    3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 1e03ca5..cc61962 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -578,9 +578,6 @@ void set_dirty_dir_page(struct inode *inode, struct page *page)
 	struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
 	struct dir_inode_entry *new;
 
-	if (!S_ISDIR(inode->i_mode))
-		return;
-
 	new = f2fs_kmem_cache_alloc(inode_entry_slab, GFP_NOFS);
 	new->inode = inode;
 	INIT_LIST_HEAD(&new->list);
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index acd0159..ecfa674 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1043,7 +1043,8 @@ static int f2fs_set_data_page_dirty(struct page *page)
 
 	if (!PageDirty(page)) {
 		__set_page_dirty_nobuffers(page);
-		set_dirty_dir_page(inode, page);
+		if (S_ISDIR(inode->i_mode))
+			set_dirty_dir_page(inode, page);
 		return 1;
 	}
 	return 0;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux