Re: [PATCH v3 8/9] fuse: introduce inode io modes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 9, 2024 at 12:56 PM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>
> On Fri, 9 Feb 2024 at 11:35, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>
> > No reason apart from "symmetry" with the other io mode FOPEN flags.
> > I will use an internal flag.
>
> Okay.
>
> Other ff->open_flags are set at open time and never changed.
> FOPEN_CACHE_IO doesn't fit into that pattern.
>
> > I added io_open to fix a bug in an earlier version where fuse_file_release()
> > was called on the error path after fuse_file_io_open() failed.
> >
> > The simple change would be to replace FOPEN_CACHE_IO flag
> > with ff->io_cache_opened bit.
>
> Right.
>
> >
> > I assume you meant to change ff->io_opened to an enum:
> > { FUSE_IO_NONE, FUSE_IO_CACHE, FUSE_IO_DIRECT,
> >   FUSE_IO_PASSTHROUGH }
> >
> > Is that what you mean?
>
> I just meant ff->io_cache_opened is only set when the cache counter
> needs decrementing.  The logic is simpler and is trivially right.
>

Ok. but I'll leave it named io_opened because with fuse passthrough
io_opened means either positive or negative refcount:

void fuse_file_io_release(struct fuse_file *ff, struct inode *inode)
{
        if (!ff->io_opened)
                return;

        /*
         * Last caching file close allows passthrough open of inode and
         * Last passthrough file close allows caching open of inode.
         */
        if (ff->open_flags & FOPEN_PASSTHROUGH)
                fuse_file_uncached_io_end(inode);
        else
                fuse_file_cached_io_end(inode);

        ff->io_opened = false;
}

Thanks,
Amir.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux