From: Changman Lee Subject: [PATCH 2/2] f2fs: call set_dirty_dir_page if inode is directory. Date: Wed, 12 Mar 2014 11:27:13 +0900 Message-ID: <1394591233-14080-2-git-send-email-cm224.lee@samsung.com> References: <1394591233-14080-1-git-send-email-cm224.lee@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Return-path: In-reply-to: <1394591233-14080-1-git-send-email-cm224.lee@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net List-Id: linux-fsdevel.vger.kernel.org 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 --- 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 ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech