Re: [RFC PATCH 19/19] tarfs: introduce tar fs

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

 



On Wed, Jan 24, 2024 at 03:26:03PM -0300, Wedson Almeida Filho wrote:
> On Wed, 24 Jan 2024 at 02:23, Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> >
> > On Wed, Jan 24, 2024 at 05:05:43AM +0000, Matthew Wilcox wrote:
> > > On Wed, Oct 18, 2023 at 09:25:18AM -0300, Wedson Almeida Filho wrote:
> > > > +config TARFS_FS
> > > > +   tristate "TAR file system support"
> > > > +   depends on RUST && BLOCK
> > > > +   select BUFFER_HEAD
> > >
> > > I didn't spot anywhere in this that actually uses buffer_heads.  Why
> > > did you add this select?
> >
> > Oh, never mind.  I found bread().
> >
> > I'm not thrilled that you're adding buffer_head wrappers.  We're trying
> > to move away from buffer_heads.  Any chance you could use the page cache
> > directly to read your superblock?
> 
> I used it because I saw it in ext4 and assumed that it was the
> recommended way of doing it. I'm fine to remove it.
> 
> So what is the recommended way? Which file systems are using it (so I
> can do something similar)?

e.g. btrfs_read_dev_one_super(). Essentially, if your superblock is
at block zero in the block device:

	struct address_space *mapping = bdev->bd_inode->i_mapping;

	......

	page = read_cache_page_gfp(mapping, 0, GFP_NOFS);
        if (IS_ERR(page))
                return ERR_CAST(page);

        super = page_address(page);

And now you have a pointer to your in memory buffer containing the
on-disk superblock. If the sueprblock is not at block zero, then
replace the '0' passed to read_cache_page_gfp() with whatever page
cache index the superblock can be found at....

-Dave.

-- 
Dave Chinner
david@xxxxxxxxxxxxx




[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