* [f2fs-dev] [PATCH] mkfs.f2fs: set project quota by default for -g android @ 2022-02-03 17:44 Jaegeuk Kim 2022-02-08 3:01 ` Chao Yu 2022-02-08 23:39 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim 0 siblings, 2 replies; 7+ messages in thread From: Jaegeuk Kim @ 2022-02-03 17:44 UTC (permalink / raw) To: linux-f2fs-devel; +Cc: Jaegeuk Kim With this patch, "-g android" enables project quota only. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> --- mkfs/f2fs_format_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index 8d4dbe1a28b1..c5bbfeb4b807 100644 --- a/mkfs/f2fs_format_main.c +++ b/mkfs/f2fs_format_main.c @@ -119,7 +119,8 @@ static void add_default_options(void) return; c.feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT); - c.feature |= cpu_to_le32(F2FS_FEATURE_QUOTA_INO); + c.feature |= cpu_to_le32(F2FS_FEATURE_PRJQUOTA); + c.feature |= cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR); c.feature |= cpu_to_le32(F2FS_FEATURE_VERITY); break; } @@ -128,7 +129,6 @@ static void add_default_options(void) c.feature |= cpu_to_le32(F2FS_FEATURE_CASEFOLD); #endif #ifdef CONF_PROJID - c.feature |= cpu_to_le32(F2FS_FEATURE_QUOTA_INO); c.feature |= cpu_to_le32(F2FS_FEATURE_PRJQUOTA); c.feature |= cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR); #endif -- 2.35.0.263.gb82422642f-goog _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [f2fs-dev] [PATCH] mkfs.f2fs: set project quota by default for -g android 2022-02-03 17:44 [f2fs-dev] [PATCH] mkfs.f2fs: set project quota by default for -g android Jaegeuk Kim @ 2022-02-08 3:01 ` Chao Yu 2022-02-08 23:39 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim 1 sibling, 0 replies; 7+ messages in thread From: Chao Yu @ 2022-02-08 3:01 UTC (permalink / raw) To: Jaegeuk Kim, linux-f2fs-devel On 2022/2/4 1:44, Jaegeuk Kim wrote: > With this patch, "-g android" enables project quota only. > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Reviewed-by: Chao Yu <chao@kernel.org> Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: set project quota by default for -g android 2022-02-03 17:44 [f2fs-dev] [PATCH] mkfs.f2fs: set project quota by default for -g android Jaegeuk Kim 2022-02-08 3:01 ` Chao Yu @ 2022-02-08 23:39 ` Jaegeuk Kim 2022-02-09 22:17 ` [f2fs-dev] [PATCH v3] " Jaegeuk Kim 2022-02-25 3:07 ` [f2fs-dev] [PATCH v2] " Chao Yu 1 sibling, 2 replies; 7+ messages in thread From: Jaegeuk Kim @ 2022-02-08 23:39 UTC (permalink / raw) To: linux-f2fs-devel With this patch, "-g android" enables usr/grp/proj quota by default. 1) -O quota : enables usr/grp 2) -O project_quota -O extra_attr : enabled prj 3) -O quota -O project_quota -O extra_attr : enables usr/grp/proj 4) -g android : enables usr/grp/proj 5) -g android -O project_quota -O extra_attr : enables usr/grp/proj Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> --- Change log from v1: - enable all quotas to keep backward compatibility mkfs/f2fs_format_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index 8d4dbe1a28b1..8e65139b45fb 100644 --- a/mkfs/f2fs_format_main.c +++ b/mkfs/f2fs_format_main.c @@ -120,6 +120,8 @@ static void add_default_options(void) c.feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT); c.feature |= cpu_to_le32(F2FS_FEATURE_QUOTA_INO); + c.feature |= cpu_to_le32(F2FS_FEATURE_PRJQUOTA); + c.feature |= cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR); c.feature |= cpu_to_le32(F2FS_FEATURE_VERITY); break; } -- 2.35.0.263.gb82422642f-goog _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [f2fs-dev] [PATCH v3] mkfs.f2fs: set project quota by default for -g android 2022-02-08 23:39 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim @ 2022-02-09 22:17 ` Jaegeuk Kim 2022-02-25 3:07 ` [f2fs-dev] [PATCH v2] " Chao Yu 1 sibling, 0 replies; 7+ messages in thread From: Jaegeuk Kim @ 2022-02-09 22:17 UTC (permalink / raw) To: linux-f2fs-devel With this patch, "-g android" enables project quota only by default, if the kernel is over v4.14. Otherwise, it enables usr/grp/proj all together. 1) -O quota : enables usr/grp 2) -O project_quota -O extra_attr : enabled prj 3) -O quota -O project_quota -O extra_attr : enables usr/grp/proj 4) -g android : enables proj (4.14+), usr/grp/proj (old kernel) 5) -g android -O project_quota -O extra_attr : enables usr/grp/proj Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> --- Change log from v2: - disable usr/grp for old kernels below 4.14 Change log from v1: - enable all quotas to keep backward compatibility mkfs/f2fs_format_main.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index 8d4dbe1a28b1..6efe35fff2d2 100644 --- a/mkfs/f2fs_format_main.c +++ b/mkfs/f2fs_format_main.c @@ -31,6 +31,9 @@ #include "quota.h" #include "f2fs_format_utils.h" +#ifdef HAVE_SYS_UTSNAME_H +#include <sys/utsname.h> +#endif #ifdef WITH_ANDROID #include <sparse/sparse.h> extern struct sparse_file *f2fs_sparse_file; @@ -104,11 +107,34 @@ static void f2fs_show_info() MSG(0, "Info: Enable Compression\n"); } +#if defined(ANDROID_TARGET) && defined(HAVE_SYS_UTSNAME_H) +static bool kernel_version_over(unsigned int min_major, unsigned int min_minor) +{ + unsigned int major, minor; + struct utsname uts; + + if ((uname(&uts) != 0) || + (sscanf(uts.release, "%u.%u", &major, &minor) != 2)) + return false; + if (major > min_major) + return true; + if (major == min_major && minor >= min_minor) + return true; + return false; +} +#else +static bool kernel_version_over(unsigned int UNUSED(min_major), + unsigned int UNUSED(min_minor)) +{ + return false; +} +#endif + static void add_default_options(void) { switch (c.defset) { case CONF_ANDROID: - /* -d1 -f -O encrypt -O quota -O verity -w 4096 -R 0:0 */ + /* -d1 -f -w 4096 -R 0:0 */ c.dbg_lv = 1; force_overwrite = 1; c.wanted_sector_size = 4096; @@ -118,8 +144,12 @@ static void add_default_options(void) if (c.feature & cpu_to_le32(F2FS_FEATURE_RO)) return; + /* -O encrypt -O project_quota,extra_attr,{quota} -O verity */ c.feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT); - c.feature |= cpu_to_le32(F2FS_FEATURE_QUOTA_INO); + if (!kernel_version_over(4, 14)) + c.feature |= cpu_to_le32(F2FS_FEATURE_QUOTA_INO); + c.feature |= cpu_to_le32(F2FS_FEATURE_PRJQUOTA); + c.feature |= cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR); c.feature |= cpu_to_le32(F2FS_FEATURE_VERITY); break; } -- 2.35.0.263.gb82422642f-goog _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: set project quota by default for -g android 2022-02-08 23:39 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim 2022-02-09 22:17 ` [f2fs-dev] [PATCH v3] " Jaegeuk Kim @ 2022-02-25 3:07 ` Chao Yu 2022-02-25 18:36 ` Jaegeuk Kim 1 sibling, 1 reply; 7+ messages in thread From: Chao Yu @ 2022-02-25 3:07 UTC (permalink / raw) To: Jaegeuk Kim, linux-f2fs-devel On 2022/2/9 7:39, Jaegeuk Kim wrote: > With this patch, "-g android" enables usr/grp/proj quota by default. > > 1) -O quota : enables usr/grp > 2) -O project_quota -O extra_attr : enabled prj > 3) -O quota -O project_quota -O extra_attr : enables usr/grp/proj > 4) -g android : enables usr/grp/proj > 5) -g android -O project_quota -O extra_attr : enables usr/grp/proj > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Reviewed-by: Chao Yu <chao@kernel.org> Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: set project quota by default for -g android 2022-02-25 3:07 ` [f2fs-dev] [PATCH v2] " Chao Yu @ 2022-02-25 18:36 ` Jaegeuk Kim 2022-03-02 3:31 ` Chao Yu 0 siblings, 1 reply; 7+ messages in thread From: Jaegeuk Kim @ 2022-02-25 18:36 UTC (permalink / raw) To: Chao Yu; +Cc: linux-f2fs-devel On 02/25, Chao Yu wrote: > On 2022/2/9 7:39, Jaegeuk Kim wrote: > > With this patch, "-g android" enables usr/grp/proj quota by default. > > > > 1) -O quota : enables usr/grp > > 2) -O project_quota -O extra_attr : enabled prj > > 3) -O quota -O project_quota -O extra_attr : enables usr/grp/proj > > 4) -g android : enables usr/grp/proj > > 5) -g android -O project_quota -O extra_attr : enables usr/grp/proj > > > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> > > Reviewed-by: Chao Yu <chao@kernel.org> Is this for v3? > > Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: set project quota by default for -g android 2022-02-25 18:36 ` Jaegeuk Kim @ 2022-03-02 3:31 ` Chao Yu 0 siblings, 0 replies; 7+ messages in thread From: Chao Yu @ 2022-03-02 3:31 UTC (permalink / raw) To: Jaegeuk Kim; +Cc: linux-f2fs-devel On 2022/2/26 2:36, Jaegeuk Kim wrote: > On 02/25, Chao Yu wrote: >> On 2022/2/9 7:39, Jaegeuk Kim wrote: >>> With this patch, "-g android" enables usr/grp/proj quota by default. >>> >>> 1) -O quota : enables usr/grp >>> 2) -O project_quota -O extra_attr : enabled prj >>> 3) -O quota -O project_quota -O extra_attr : enables usr/grp/proj >>> 4) -g android : enables usr/grp/proj >>> 5) -g android -O project_quota -O extra_attr : enables usr/grp/proj >>> >>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> >> >> Reviewed-by: Chao Yu <chao@kernel.org> > > Is this for v3? Yup, :) Thanks, > >> >> Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-03-02 3:31 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-02-03 17:44 [f2fs-dev] [PATCH] mkfs.f2fs: set project quota by default for -g android Jaegeuk Kim 2022-02-08 3:01 ` Chao Yu 2022-02-08 23:39 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim 2022-02-09 22:17 ` [f2fs-dev] [PATCH v3] " Jaegeuk Kim 2022-02-25 3:07 ` [f2fs-dev] [PATCH v2] " Chao Yu 2022-02-25 18:36 ` Jaegeuk Kim 2022-03-02 3:31 ` Chao Yu
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.