public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>, LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/3] bdi: Use parent filesystem BDI for inodes not capable of writeback
Date: Thu, 29 Jul 2010 14:17:21 +0200	[thread overview]
Message-ID: <20100729121721.GC3757@quack.suse.cz> (raw)
In-Reply-To: <20100729081210.GA395@infradead.org>

On Thu 29-07-10 04:12:10, Christoph Hellwig wrote:
> Given that we only need the per-mapping one for the bdev fs what about
> doing:
> 
> /*
>  * Return the writeback-relevant backing device for this inode.
>  *
>  * For a normal filesystem this must always be the bdi hanging off the
>  * superblock, given that we only expect one bdi per filesystems in
>  * the per-superblock sync functions.  But the block device special
>  * filesystem requires a quick given that it contains the internal
>  * I/O inodes for block devices on a single superblock.  This works
>  * because the block deevice filesystem inodes are never user visible
>  * and we will never do a per-superblock sync on it.
>  */
> static struct backing_dev_info *inode_to_bdi(struct inode *inode)
> {
> 	if (inode->i_sb == blockdev_superblock)
> 		return inode->i_mapping->backing_dev_info;
> 	return inode->i_sb->s_bdi;
> }
> 
> that also avoids the need for doing the bdi capabilities audit ASAP.
  Well, but I'm not sure we'll help ourselves with having to do audit this
way. Some other pseudofilesystems can play tricks with backing_dev_info as
well and thus inode->i_mapping->backing_dev_info != inode->i_sb->s_bdi. In
particular MTD seems to do such things. As I'm looking at the code, it
looks like a similar case as blockdev filesystem.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2010-07-29 12:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27 17:04 [PATCH 0/3] Fix warnings in __mark_inode_dirty Jan Kara
2010-07-27 17:04 ` [PATCH 1/3] bdi: Use parent filesystem BDI for inodes not capable of writeback Jan Kara
2010-07-27 17:09   ` Christoph Hellwig
2010-07-27 17:24     ` Jan Kara
2010-07-27 17:27       ` Christoph Hellwig
2010-07-27 18:01         ` Jan Kara
2010-07-27 20:12           ` Christoph Hellwig
2010-07-27 20:21             ` Christoph Hellwig
2010-07-27 20:44               ` Jan Kara
2010-07-27 20:46                 ` Christoph Hellwig
2010-07-29  8:12   ` Christoph Hellwig
2010-07-29 12:17     ` Jan Kara [this message]
2010-07-27 17:05 ` [PATCH 2/3] char: Mark /dev/zero and /dev/kmem as " Jan Kara
2010-07-27 17:05 ` [PATCH 3/3] bdi: Initialize noop_backing_dev_info properly Jan Kara
2010-07-27 17:09   ` Christoph Hellwig
2010-07-27 17:17     ` Jan Kara

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=20100729121721.GC3757@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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