linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC: generic file operation for fstrim ioctl()
@ 2021-06-22 12:11 Enrico Weigelt, metux IT consult
  2021-06-22 12:11 ` [RFC PATCH 1/6] fs: generic file operation for fstrim Enrico Weigelt, metux IT consult
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2021-06-22 12:11 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, viro

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






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-22 12:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 12:11 RFC: generic file operation for fstrim ioctl() Enrico Weigelt, metux IT consult
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

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).