Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210896
b: refs/heads/master
c: 692ebd1
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara authored and Jens Axboe committed Sep 22, 2010
1 parent 984907f commit 834a3bd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 371d217ee1ff8b418b8f73fb2a34990f951ec2d4
refs/heads/master: 692ebd17c2905313fff3c504c249c6a0faad16ec
23 changes: 21 additions & 2 deletions trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ struct wb_writeback_work {
#define CREATE_TRACE_POINTS
#include <trace/events/writeback.h>

#define inode_to_bdi(inode) ((inode)->i_mapping->backing_dev_info)

/*
* We don't actually have pdflush, but this one is exported though /proc...
*/
Expand All @@ -71,6 +69,27 @@ int writeback_in_progress(struct backing_dev_info *bdi)
return test_bit(BDI_writeback_running, &bdi->state);
}

static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
{
struct super_block *sb = inode->i_sb;
struct backing_dev_info *bdi = inode->i_mapping->backing_dev_info;

/*
* For inodes on standard filesystems, we use superblock's bdi. For
* inodes on virtual filesystems, we want to use inode mapping's bdi
* because they can possibly point to something useful (think about
* block_dev filesystem).
*/
if (sb->s_bdi && sb->s_bdi != &noop_backing_dev_info) {
/* Some device inodes could play dirty tricks. Catch them... */
WARN(bdi != sb->s_bdi && bdi_cap_writeback_dirty(bdi),
"Dirtiable inode bdi %s != sb bdi %s\n",
bdi->name, sb->s_bdi->name);
return sb->s_bdi;
}
return bdi;
}

static void bdi_queue_work(struct backing_dev_info *bdi,
struct wb_writeback_work *work)
{
Expand Down

0 comments on commit 834a3bd

Please sign in to comment.