lkml.org 
[lkml]   [2010]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] bdi: Use parent filesystem BDI for inodes not capable of writeback
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


\
 
 \ /
  Last update: 2010-07-29 14:21    [W:0.090 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site