mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: bdi: Fix warnings in __mark_inode_dirty for /dev/zero and friends char: Mark /dev/zero and /dev/kmem as not capable of writeback bdi: Initialize noop_backing_dev_info properly cfq-iosched: fix a kernel OOPs when usb key is inserted block: fix blk_rq_map_kern bio direction flag cciss: freeing uninitialized data on error path
This commit is contained in:
commit
b68e9d4581
7 changed files with 43 additions and 9 deletions
|
|
@ -40,7 +40,9 @@ struct backing_dev_info directly_mappable_cdev_bdi = {
|
|||
#endif
|
||||
/* permit direct mmap, for read, write or exec */
|
||||
BDI_CAP_MAP_DIRECT |
|
||||
BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP),
|
||||
BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP |
|
||||
/* no writeback happens */
|
||||
BDI_CAP_NO_ACCT_AND_WRITEBACK),
|
||||
};
|
||||
|
||||
static struct kobj_map *cdev_map;
|
||||
|
|
|
|||
|
|
@ -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...
|
||||
*/
|
||||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue