Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751742AbbLPFM5 (ORCPT ); Wed, 16 Dec 2015 00:12:57 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:56252 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750758AbbLPFM4 (ORCPT ); Wed, 16 Dec 2015 00:12:56 -0500 X-AuditID: cbfee61b-f793c6d00000236c-32-5670f2d62b9e From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/7] f2fs: introduce new option for controlling data flush Date: Wed, 16 Dec 2015 13:12:16 +0800 Message-id: <014201d137c0$6bdf7470$439e5d50$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdE3v/rlDKDa9mdWSjGNxxWpQzISxw== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jAd3rnwrCDHYqWDxZP4vZ4tIid4vL u+awOTB7bFrVyeaxe8FnJo/Pm+QCmKO4bFJSczLLUov07RK4Mk6c/sVSsFa04nTHBKYGxm8C XYycHBICJhI/Hs5nh7DFJC7cW8/WxcjFISSwlFFi5efHUM4rRolLfduYQarYBFQklnf8ZwKx RYDsQ4sug3UzC3hINHZ8ZwWxhQV8JdqebQSq5+BgEVCVODCFByTMK2ApsffaMlYIW1Dix+R7 LBCtWhLrdx5ngrDlJTavecsMcZCCxI6zrxkhVulJ/Dv/iRGiRlxi45FbLBMYBWYhGTULyahZ SEbNQtKygJFlFaNEakFyQXFSeq5RXmq5XnFibnFpXrpecn7uJkZwCD+T3sF4eJf7IUYBDkYl Hl6NmIIwIdbEsuLK3EOMEhzMSiK8Bk+BQrwpiZVVqUX58UWlOanFhxilOViUxHn3XYoMExJI TyxJzU5NLUgtgskycXBKNTCWn9ER9rOeXMceUiHMoNwzRVG3dIvV9rofS0u5ipWfuH5UD2s4 9ZeV/Vp8pMU+Ie4lfp3Pbl1+bNlgumatuUJIJcMFR6ceLsOHZ16rxvsuyFNbo3zy4aE9K7+a rV6++MNGKUe9R0eOnp44Z2Hog7TVT/qCOtb/TGU9tStUavWZiwKn9v02lNZVYinOSDTUYi4q TgQAAUoVkF0CAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2897 Lines: 86 Add a new option 'data_flush' to enable data flush functionality. Signed-off-by: Chao Yu --- v2: - rebase last dev-test branch. - fix to set option correctly. --- Documentation/filesystems/f2fs.txt | 2 ++ fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystems/f2fs.txt index ad10494..e1c9f08 100644 --- a/Documentation/filesystems/f2fs.txt +++ b/Documentation/filesystems/f2fs.txt @@ -149,6 +149,8 @@ noextent_cache Disable an extent cache based on rb-tree explicitly, see the above extent_cache mount option. noinline_data Disable the inline data feature, inline data feature is enabled by default. +data_flush Enable data flushing before checkpoint in order to + persist data of regular and symlink. ================================================================================ DEBUGFS ENTRIES diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index e73ddea..e907d9e 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -54,6 +54,7 @@ #define F2FS_MOUNT_FASTBOOT 0x00001000 #define F2FS_MOUNT_EXTENT_CACHE 0x00002000 #define F2FS_MOUNT_FORCE_FG_GC 0x00004000 +#define F2FS_MOUNT_DATA_FLUSH 0x00008000 #define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option) #define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 551688e..1f7f87e 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -67,6 +67,7 @@ enum { Opt_extent_cache, Opt_noextent_cache, Opt_noinline_data, + Opt_data_flush, Opt_err, }; @@ -91,6 +92,7 @@ static match_table_t f2fs_tokens = { {Opt_extent_cache, "extent_cache"}, {Opt_noextent_cache, "noextent_cache"}, {Opt_noinline_data, "noinline_data"}, + {Opt_data_flush, "data_flush"}, {Opt_err, NULL}, }; @@ -406,6 +408,9 @@ static int parse_options(struct super_block *sb, char *options) case Opt_noinline_data: clear_opt(sbi, INLINE_DATA); break; + case Opt_data_flush: + set_opt(sbi, DATA_FLUSH); + break; default: f2fs_msg(sb, KERN_ERR, "Unrecognized mount option \"%s\" or missing value", @@ -687,6 +692,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) seq_puts(seq, ",extent_cache"); else seq_puts(seq, ",noextent_cache"); + if (test_opt(sbi, DATA_FLUSH)) + seq_puts(seq, ",data_flush"); seq_printf(seq, ",active_logs=%u", sbi->active_logs); return 0; -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/