All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daeho Jeong <daeho43@gmail.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com,
	Daeho Jeong <daehojeong@google.com>
Subject: Re: [f2fs-dev] [PATCH v2 1/2] f2fs: add compress_mode mount option
Date: Tue, 8 Dec 2020 12:59:00 +0900	[thread overview]
Message-ID: <CACOAw_zgytk-a4uGBfZGgEKy5SLzG=nFyL832FiV3hx85cXG3Q@mail.gmail.com> (raw)
In-Reply-To: <X874P2evu7SUgjBA@gmail.com>

compression enabled regular files have different formats of node
metadata on disk. So, using the
"compress_mode=user,compress_extension=*" mount option, we want to
make the metadata of files ready for compression and make them
compressed whenever the user wants using new ioctls.

2020년 12월 8일 (화) 오후 12:51, Eric Biggers <ebiggers@kernel.org>님이 작성:
>
> On Tue, Dec 01, 2020 at 01:08:02PM +0900, Daeho Jeong wrote:
> > From: Daeho Jeong <daehojeong@google.com>
> >
> > We will add a new "compress_mode" mount option to control file
> > compression mode. This supports "fs" and "user". In "fs" mode (default),
> > f2fs does automatic compression on the compression enabled files.
> > In "user" mode, f2fs disables the automaic compression and gives the
> > user discretion of choosing the target file and the timing. It means
> > the user can do manual compression/decompression on the compression
> > enabled files using ioctls.
> >
> > Signed-off-by: Daeho Jeong <daehojeong@google.com>
> > ---
> > v2: changed mount option name and added more explanation of mount option
> > ---
> >  Documentation/filesystems/f2fs.rst | 35 ++++++++++++++++++++++++++++++
> >  fs/f2fs/compress.c                 |  2 +-
> >  fs/f2fs/data.c                     |  2 +-
> >  fs/f2fs/f2fs.h                     | 30 +++++++++++++++++++++++++
> >  fs/f2fs/segment.c                  |  2 +-
> >  fs/f2fs/super.c                    | 23 ++++++++++++++++++++
> >  6 files changed, 91 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
> > index b8ee761c9922..5eb8d63439ec 100644
> > --- a/Documentation/filesystems/f2fs.rst
> > +++ b/Documentation/filesystems/f2fs.rst
> > @@ -260,6 +260,13 @@ compress_extension=%s     Support adding specified extension, so that f2fs can enab
> >                        For other files, we can still enable compression via ioctl.
> >                        Note that, there is one reserved special extension '*', it
> >                        can be set to enable compression for all files.
> > +compress_mode=%s      Control file compression mode. This supports "fs" and "user"
> > +                      modes. In "fs" mode (default), f2fs does automatic compression
> > +                      on the compression enabled files. In "user" mode, f2fs disables
> > +                      the automaic compression and gives the user discretion of
> > +                      choosing the target file and the timing. The user can do manual
> > +                      compression/decompression on the compression enabled files using
> > +                      ioctls.
> >  inlinecrypt           When possible, encrypt/decrypt the contents of encrypted
> >                        files using the blk-crypto framework rather than
> >                        filesystem-layer encryption. This allows the use of
> > @@ -810,6 +817,34 @@ Compress metadata layout::
> >       | data length | data chksum | reserved |      compressed data       |
> >       +-------------+-------------+----------+----------------------------+
> >
> > +Compression mode
> > +--------------------------
> > +
> > +f2fs supports "fs" and "user" compression modes with "compression_mode" mount option.
> > +With this option, f2fs provides a choice to select the way how to compress the
> > +compression enabled files (refer to "Compression implementation" section for how to
> > +enable compression on a regular inode).
> > +
> > +1) compress_mode=fs
> > +This is the default option. f2fs does automatic compression in the writeback of the
> > +compression enabled files.
> > +
> > +2) compress_mode=user
> > +This disables the automaic compression and gives the user discretion of choosing the
> > +target file and the timing. The user can do manual compression/decompression on the
> > +compression enabled files using F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE
> > +ioctls like the below.
> > +
> > +To decompress a file,
> > +
> > +fd = open(filename, O_WRONLY, 0);
> > +ret = ioctl(fd, F2FS_IOC_DECOMPRESS_FILE);
> > +
> > +To compress a file,
> > +
> > +fd = open(filename, O_WRONLY, 0);
> > +ret = ioctl(fd, F2FS_IOC_COMPRESS_FILE);
> > +
>
> Why doesn't compress_mode=user just cause regular files to not inherit the
> compression flag?  Then users could set or clear the compression flag using
> FS_IOC_SETFLAGS, without any need for these new ioctls.
>
> - Eric

WARNING: multiple messages have this Message-ID (diff)
From: Daeho Jeong <daeho43@gmail.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Daeho Jeong <daehojeong@google.com>,
	kernel-team@android.com, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2 1/2] f2fs: add compress_mode mount option
Date: Tue, 8 Dec 2020 12:59:00 +0900	[thread overview]
Message-ID: <CACOAw_zgytk-a4uGBfZGgEKy5SLzG=nFyL832FiV3hx85cXG3Q@mail.gmail.com> (raw)
In-Reply-To: <X874P2evu7SUgjBA@gmail.com>

compression enabled regular files have different formats of node
metadata on disk. So, using the
"compress_mode=user,compress_extension=*" mount option, we want to
make the metadata of files ready for compression and make them
compressed whenever the user wants using new ioctls.

2020년 12월 8일 (화) 오후 12:51, Eric Biggers <ebiggers@kernel.org>님이 작성:
>
> On Tue, Dec 01, 2020 at 01:08:02PM +0900, Daeho Jeong wrote:
> > From: Daeho Jeong <daehojeong@google.com>
> >
> > We will add a new "compress_mode" mount option to control file
> > compression mode. This supports "fs" and "user". In "fs" mode (default),
> > f2fs does automatic compression on the compression enabled files.
> > In "user" mode, f2fs disables the automaic compression and gives the
> > user discretion of choosing the target file and the timing. It means
> > the user can do manual compression/decompression on the compression
> > enabled files using ioctls.
> >
> > Signed-off-by: Daeho Jeong <daehojeong@google.com>
> > ---
> > v2: changed mount option name and added more explanation of mount option
> > ---
> >  Documentation/filesystems/f2fs.rst | 35 ++++++++++++++++++++++++++++++
> >  fs/f2fs/compress.c                 |  2 +-
> >  fs/f2fs/data.c                     |  2 +-
> >  fs/f2fs/f2fs.h                     | 30 +++++++++++++++++++++++++
> >  fs/f2fs/segment.c                  |  2 +-
> >  fs/f2fs/super.c                    | 23 ++++++++++++++++++++
> >  6 files changed, 91 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
> > index b8ee761c9922..5eb8d63439ec 100644
> > --- a/Documentation/filesystems/f2fs.rst
> > +++ b/Documentation/filesystems/f2fs.rst
> > @@ -260,6 +260,13 @@ compress_extension=%s     Support adding specified extension, so that f2fs can enab
> >                        For other files, we can still enable compression via ioctl.
> >                        Note that, there is one reserved special extension '*', it
> >                        can be set to enable compression for all files.
> > +compress_mode=%s      Control file compression mode. This supports "fs" and "user"
> > +                      modes. In "fs" mode (default), f2fs does automatic compression
> > +                      on the compression enabled files. In "user" mode, f2fs disables
> > +                      the automaic compression and gives the user discretion of
> > +                      choosing the target file and the timing. The user can do manual
> > +                      compression/decompression on the compression enabled files using
> > +                      ioctls.
> >  inlinecrypt           When possible, encrypt/decrypt the contents of encrypted
> >                        files using the blk-crypto framework rather than
> >                        filesystem-layer encryption. This allows the use of
> > @@ -810,6 +817,34 @@ Compress metadata layout::
> >       | data length | data chksum | reserved |      compressed data       |
> >       +-------------+-------------+----------+----------------------------+
> >
> > +Compression mode
> > +--------------------------
> > +
> > +f2fs supports "fs" and "user" compression modes with "compression_mode" mount option.
> > +With this option, f2fs provides a choice to select the way how to compress the
> > +compression enabled files (refer to "Compression implementation" section for how to
> > +enable compression on a regular inode).
> > +
> > +1) compress_mode=fs
> > +This is the default option. f2fs does automatic compression in the writeback of the
> > +compression enabled files.
> > +
> > +2) compress_mode=user
> > +This disables the automaic compression and gives the user discretion of choosing the
> > +target file and the timing. The user can do manual compression/decompression on the
> > +compression enabled files using F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE
> > +ioctls like the below.
> > +
> > +To decompress a file,
> > +
> > +fd = open(filename, O_WRONLY, 0);
> > +ret = ioctl(fd, F2FS_IOC_DECOMPRESS_FILE);
> > +
> > +To compress a file,
> > +
> > +fd = open(filename, O_WRONLY, 0);
> > +ret = ioctl(fd, F2FS_IOC_COMPRESS_FILE);
> > +
>
> Why doesn't compress_mode=user just cause regular files to not inherit the
> compression flag?  Then users could set or clear the compression flag using
> FS_IOC_SETFLAGS, without any need for these new ioctls.
>
> - Eric


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2020-12-08  3:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01  4:08 [PATCH v2 1/2] f2fs: add compress_mode mount option Daeho Jeong
2020-12-01  4:08 ` [f2fs-dev] " Daeho Jeong
2020-12-01  4:08 ` [PATCH v2 2/2] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE Daeho Jeong
2020-12-01  4:08   ` [f2fs-dev] " Daeho Jeong
2020-12-02  6:40   ` Chao Yu
2020-12-02  6:40     ` Chao Yu
2020-12-02  6:31 ` [f2fs-dev] [PATCH v2 1/2] f2fs: add compress_mode mount option Chao Yu
2020-12-02  6:31   ` Chao Yu
     [not found]   ` <CACOAw_xafxyUZe1g-nXjTrkisbUqCvSk7js7amhqw3zADAq22Q@mail.gmail.com>
2020-12-03  1:15     ` Chao Yu
2020-12-03  1:15       ` Chao Yu
2020-12-03  1:23       ` Daeho Jeong
2020-12-03  1:23         ` Daeho Jeong
2020-12-03  1:30         ` Chao Yu
2020-12-03  1:30           ` Chao Yu
2020-12-03  7:05 ` Chao Yu
2020-12-03  7:05   ` Chao Yu
2020-12-08  3:51 ` Eric Biggers
2020-12-08  3:51   ` Eric Biggers
2020-12-08  3:59   ` Daeho Jeong [this message]
2020-12-08  3:59     ` Daeho Jeong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACOAw_zgytk-a4uGBfZGgEKy5SLzG=nFyL832FiV3hx85cXG3Q@mail.gmail.com' \
    --to=daeho43@gmail.com \
    --cc=daehojeong@google.com \
    --cc=ebiggers@kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.