public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	David Sterba <dsterba@suse.cz>,
	Nikolay Borisov <nborisov@suse.com>,
	Josef Bacik <josef@toxicpanda.com>,
	"linux-btrfs @ vger . kernel . org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v4 1/5] btrfs: use the page-cache for super block reading
Date: Thu, 6 Feb 2020 06:57:59 -0800	[thread overview]
Message-ID: <20200206145759.GA24780@infradead.org> (raw)
In-Reply-To: <SN4PR0401MB359854D81C504BBE28B8B2EB9B1D0@SN4PR0401MB3598.namprd04.prod.outlook.com>

On Thu, Feb 06, 2020 at 08:17:20AM +0000, Johannes Thumshirn wrote:
> >> +	super = kmap(page);
> >>   	if (btrfs_super_bytenr(super) != bytenr ||
> >>   		    btrfs_super_magic(super) != BTRFS_MAGIC) {
> >> -		brelse(bh);
> >> +		kunmap(page);
> >> +		put_page(page);
> >>   		return -EINVAL;
> >>   	}
> >> +	kunmap(page);
> > 
> > Also last time I wondered why we can't leave the page mapped for the
> > caller and also return the virtual address?  That would keep the
> > callers a little cleaner.  Note that you don't need to pass the
> > struct page in that case as the unmap helper can use kmap_to_page (and
> > I think a helper would be really nice for the unmap and put anyway).
> > 
> 
> There's btrfs_release_disk_super() but David didn't like the use of it 
> in v2 of this series. But when using a 'struct btrfs_disk_super' instead 
> of a 'struct page' I think he could be ok.

Also I just noticed don't even need the kmap/kunmap at all given that the
block device mapping is never in highmem.

  reply	other threads:[~2020-02-06 15:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 14:38 [PATCH v4 0/5] btrfs: remove buffer heads form superblock handling Johannes Thumshirn
2020-02-05 14:38 ` [PATCH v4 1/5] btrfs: use the page-cache for super block reading Johannes Thumshirn
2020-02-05 16:53   ` Christoph Hellwig
2020-02-06  8:17     ` Johannes Thumshirn
2020-02-06 14:57       ` Christoph Hellwig [this message]
2020-02-06 15:29         ` Johannes Thumshirn
2020-02-07 16:13           ` David Sterba
2020-02-10  7:16             ` Johannes Thumshirn
2020-02-06  9:29     ` Johannes Thumshirn
2020-02-05 14:38 ` [PATCH v4 2/5] btrfs: use BIOs instead of buffer_heads from superblock writeout Johannes Thumshirn
2020-02-05 18:16   ` Christoph Hellwig
2020-02-06  8:20     ` Johannes Thumshirn
2020-02-06 14:59       ` Christoph Hellwig
2020-02-06 15:18         ` Johannes Thumshirn
2020-02-07 16:08       ` David Sterba
2020-02-05 14:38 ` [PATCH v4 3/5] btrfs: remove btrfsic_submit_bh() Johannes Thumshirn
2020-02-05 14:38 ` [PATCH v4 4/5] btrfs: remove buffer_heads from btrfsic_process_written_block() Johannes Thumshirn
2020-02-05 14:38 ` [PATCH v4 5/5] btrfs: remove buffer_heads form superblock mirror integrity checking Johannes Thumshirn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200206145759.GA24780@infradead.org \
    --to=hch@infradead.org \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox