On 26/01/07 09:33AM, John Groves wrote:
> On completion of GET_FMAP message/response, setup the full famfs
> metadata such that it's possible to handle read/write/mmap directly to
> dax. Note that the devdax_iomap plumbing is not in yet...
>
> * Add famfs_kfmap.h: in-memory structures for resolving famfs file maps
> (fmaps) to dax.
> * famfs.c: allocate, initialize and free fmaps
> * inode.c: only allow famfs mode if the fuse server has CAP_SYS_RAWIO
> * Update MAINTAINERS for the new files.
>
> Signed-off-by: John Groves <[email protected]>
> ---
> MAINTAINERS | 1 +
> fs/fuse/famfs.c | 355 +++++++++++++++++++++++++++++++++++++-
> fs/fuse/famfs_kfmap.h | 67 +++++++
> fs/fuse/fuse_i.h | 22 ++-
> fs/fuse/inode.c | 21 ++-
> include/uapi/linux/fuse.h | 56 ++++++
> 6 files changed, 510 insertions(+), 12 deletions(-)
> create mode 100644 fs/fuse/famfs_kfmap.h
>
[ ... ]
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index 9e121a1d63b7..391ead26bfa2 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -121,7 +121,7 @@ static struct inode *fuse_alloc_inode(struct super_block
> *sb)
> fuse_inode_backing_set(fi, NULL);
>
> if (IS_ENABLED(CONFIG_FUSE_FAMFS_DAX))
> - famfs_meta_set(fi, NULL);
> + famfs_meta_init(fi);
>
> return &fi->inode;
>
> @@ -1485,8 +1485,21 @@ static void process_init_reply(struct fuse_mount *fm,
> struct fuse_args *args,
> timeout = arg->request_timeout;
>
> if (IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) &&
> - flags & FUSE_DAX_FMAP)
> - fc->famfs_iomap = 1;
> + flags & FUSE_DAX_FMAP) {
> + /* famfs_iomap is only allowed if the fuse
> + * server has CAP_SYS_RAWIO. This was checked
> + * in fuse_send_init, and FUSE_DAX_IOMAP was
> + * set in in_flags if so. Only allow enablement
> + * if we find it there. This function is
> + * normally not running in fuse server context,
> + * so we can do the capability check here...
^^^
Oops: this should be "can't" - we can't do the capability check here since
we're not in
fuse server context. Will fix before merge...
[ ... ]
John