linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Enrico Weigelt, metux IT consult" <info@metux.net>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	viro@zeniv.linux.org.uk
Subject: RFC: generic file operation for fstrim ioctl()
Date: Tue, 22 Jun 2021 14:11:30 +0200	[thread overview]
Message-ID: <20210622121136.4394-1-info@metux.net> (raw)

Hello friends,


here's an RFC for a generic implementation of the FITRIM ioctl:

* introduce a new file_operation call vector for fstrim
* move the generic pieces (eg. cap check, copy from/to userland, etc)
  into a generic implementation that then calls into the fileop
* passing to the old ioctl fileop when fstrim op is NULL
* convert a few fs'es to the new schema

Rationale: it seems that all file systems implement generic stuff like
permission checks and buffer copy from/to userspace, all on their own.
We already have a common place for generic ioctl() handling (do_vfs_ioctl).
I feel its time for factoring this out the common fstrim pieces, too.

The first patch of this series introduces a new file_operation and calls
it on FITRIM (from do_vfs_ioctl) if it's set - otherwise just passes
the ioctl to file_ioctl(), as it had been before. So, this only becomes
active on a fs thats converted to the new file_operation. Subsequent patches
do the conversion for a few file systems.

Note this is just an RFC, don't apply it - there might still be bugs in there.


have fun,

--mtx






             reply	other threads:[~2021-06-22 12:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 12:11 Enrico Weigelt, metux IT consult [this message]
2021-06-22 12:11 ` [RFC PATCH 1/6] fs: generic file operation for fstrim Enrico Weigelt, metux IT consult
2021-06-22 12:11 ` [RFC PATCH 2/6] fs: ext4: move fstrim to file_operation Enrico Weigelt, metux IT consult
2021-06-22 12:11 ` [RFC PATCH 3/6] fs: hpfs: " Enrico Weigelt, metux IT consult
2021-06-22 12:11 ` [RFC PATCH 4/6] fs: btrfs: " Enrico Weigelt, metux IT consult
2021-06-22 12:11 ` [RFC PATCH 5/6] fs: fat: " Enrico Weigelt, metux IT consult
2021-06-22 12:11 ` [RFC PATCH 6/6] fs: f2fs: " Enrico Weigelt, metux IT consult

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=20210622121136.4394-1-info@metux.net \
    --to=info@metux.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).