• Amir Goldstein's avatar
    fuse: implement ioctls to manage backing files · 44350256
    Amir Goldstein authored
    FUSE server calls the FUSE_DEV_IOC_BACKING_OPEN ioctl with a backing file
    descriptor.  If the call succeeds, a backing file identifier is returned.
    
    A later change will be using this backing file id in a reply to OPEN
    request with the flag FOPEN_PASSTHROUGH to setup passthrough of file
    operations on the open FUSE file to the backing file.
    
    The FUSE server should call FUSE_DEV_IOC_BACKING_CLOSE ioctl to close the
    backing file by its id.
    
    This can be done at any time, but if an open reply with FOPEN_PASSTHROUGH
    flag is still in progress, the open may fail if the backing file is
    closed before the fuse file was opened.
    
    Setting up backing files requires a server with CAP_SYS_ADMIN privileges.
    For the backing file to be successfully setup, the backing file must
    implement both read_iter and write_iter file operations.
    
    The limitation on the level of filesystem stacking allowed for the
    backing file is enforced before setting up the backing file.
    Signed-off-by: default avatarAlessio Balsini <balsini@android.com>
    Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    44350256
passthrough.c 3.2 KB