Re: [PATCH V12 07/12] famfs: MAP_CREATE ioctl and fmap ingest (ABI 44)

From: John Groves

Date: Fri Aug 07 2026 - 18:19:20 EST


On 26/08/06 03:53PM, John Groves wrote:
> On 26/08/05 10:24PM, Darrick J. Wong wrote:
> > On Mon, Aug 03, 2026 at 02:29:26AM +0000, John Groves wrote:
> > > From: John Groves <John@xxxxxxxxxx>
> > >
> > > Add the famfs file ioctl handler (FAMFSIOC_NOP, FAMFSIOC_MAP_CREATE) and
> > > the KABI-44 self-describing fmap message: the wire ABI in famfs_ioctl.h
> > > (famfs_ioc_fmap_header plus the simple and interleaved extent structs), the
> > > in-core famfs_file_meta, and famfs_file_init_dax(), which copies the
> > > message in, parses both the simple-extent and interleaved (striped) wire
> > > forms into inode->i_private, and sets S_DAX.
> > >
> > > Resolving those mappings to dax-device offsets (iomap_begin) is added in
> > > the following commit; the read/write/fault paths keep their NULL iomap_ops
> > > stub until then.
> > >
> > > Also add famfs ioctls to ioctl-number.rst
> > >
> > > Signed-off-by: John Groves <john@xxxxxxxxxx>
> > > ---
> > > .../userspace-api/ioctl/ioctl-number.rst | 1 +
> > > fs/famfs/famfs_file.c | 326 +++++++++++++++++-
> > > fs/famfs/famfs_inode.c | 1 +
> > > fs/famfs/famfs_internal.h | 46 +++
> > > include/uapi/linux/famfs_ioctl.h | 91 +++++
> > > 5 files changed, 462 insertions(+), 3 deletions(-)
> > > create mode 100644 include/uapi/linux/famfs_ioctl.h
> > >
> > > diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst
> > > index 3f0ef1e27eb0..5e244dec1b98 100644
> > > --- a/Documentation/userspace-api/ioctl/ioctl-number.rst
> > > +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst
> > > @@ -299,6 +299,7 @@ Code Seq# Include File Comments
> > > 'u' 00-2F linux/ublk_cmd.h conflict!
> > > 'u' 20-3F linux/uvcvideo.h USB video class host driver
> > > 'u' 40-4f linux/udmabuf.h userspace dma-buf misc device
> > > +'u' 50-5F linux/famfs_ioctl.h famfs shared memory file system
> > > 'v' 00-1F linux/ext2_fs.h conflict!
> > > 'v' 00-1F linux/fs.h conflict!
> > > 'v' 00-0F linux/sonypi.h conflict!
> > > diff --git a/fs/famfs/famfs_file.c b/fs/famfs/famfs_file.c
> > > index 678f2035fd5f..d710c8a0c923 100644
> > > --- a/fs/famfs/famfs_file.c
> > > +++ b/fs/famfs/famfs_file.c
> > > @@ -13,9 +13,313 @@
> > > #include <linux/mm.h>
> > > #include <linux/dax.h>
> > > #include <linux/iomap.h>
> > > +#include <linux/capability.h>
> > >
> > > +#include <linux/famfs_ioctl.h>
> > > #include "famfs_internal.h"
> > >
> > > +/* Expose famfs kernel abi version as a read-only module parameter */
> > > +static int famfs_kabi_version = FAMFS_KABI_VERSION;
> > > +module_param(famfs_kabi_version, int, 0444);
> > > +MODULE_PARM_DESC(famfs_kabi_version, "famfs kernel abi version");
> >
> > Maybe make the "NOP" ioctl a geometry ioctl that tells you the abi
> > version and (I guess) the page and pmd size? :D
>
> I like it - will do

Err, gonna leave this alone after all. The kabi_version is already exposed
as a module parameter - which is better. That is needed before mount (and
the ioctls can't be called till mounted). The other useful stuff that goes
here is the supported page sizes (which famfs generally calls "allocation
units". But there again, user space needs them prior to mount. So exposing
those as one or more module parameters is ideal.

The NOP ioctl originated to answer the question "is this file famfs", and
it still works fine for that (and user space relies on that in certain
circumstances).

Thanks!
John

<snip>