writeback: add name to backing_dev_info
authorJens Axboe <jens.axboe@oracle.com>
Fri, 12 Jun 2009 12:45:52 +0000 (14:45 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 11 Sep 2009 07:20:26 +0000 (09:20 +0200)
This enables us to track who does what and print info. Its main use
is catching dirty inodes on the default_backing_dev_info, so we can
fix that up.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 files changed:
block/blk-core.c
drivers/block/aoe/aoeblk.c
drivers/char/mem.c
fs/btrfs/disk-io.c
fs/char_dev.c
fs/configfs/inode.c
fs/fuse/inode.c
fs/hugetlbfs/inode.c
fs/nfs/client.c
fs/ocfs2/dlm/dlmfs.c
fs/ramfs/inode.c
fs/sysfs/inode.c
fs/ubifs/super.c
include/linux/backing-dev.h
kernel/cgroup.c
mm/backing-dev.c
mm/swap_state.c

index e3299a77a0d8b44d08944d9577d309dc4e40011a..e695634882a61200c50a3ee9dc5be650abfbc632 100644 (file)
@@ -501,6 +501,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
                        (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
        q->backing_dev_info.state = 0;
        q->backing_dev_info.capabilities = BDI_CAP_MAP_COPY;
+       q->backing_dev_info.name = "block";
 
        err = bdi_init(&q->backing_dev_info);
        if (err) {
index 1e15889c4b9819f837076c1b17df34fc8ef881c2..95d344971edaed461aad93cd0f18f232260b3d4f 100644 (file)
@@ -268,6 +268,7 @@ aoeblk_gdalloc(void *vp)
        if (!d->blkq)
                goto err_mempool;
        blk_queue_make_request(d->blkq, aoeblk_make_request);
+       d->blkq->backing_dev_info.name = "aoe";
        if (bdi_init(&d->blkq->backing_dev_info))
                goto err_blkq;
        spin_lock_irqsave(&d->lock, flags);
index afa8813e737a31cd630d9bdd890b878175b993e6..645237bda68266fe89cf8eca7f42ae3c9240579c 100644 (file)
@@ -822,6 +822,7 @@ static const struct file_operations zero_fops = {
  * - permits private mappings, "copies" are taken of the source of zeros
  */
 static struct backing_dev_info zero_bdi = {
+       .name           = "char/mem",
        .capabilities   = BDI_CAP_MAP_COPY,
 };
 
index e83be2e4602c256f959a2b9daf0c3da2b8e9bcab..15831d5c73676ef79804f5308997f44745c33da3 100644 (file)
@@ -1352,6 +1352,7 @@ static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi)
 {
        int err;
 
+       bdi->name = "btrfs";
        bdi->capabilities = BDI_CAP_MAP_COPY;
        err = bdi_init(bdi);
        if (err)
index a173551e19d79da5ae6132be9eaa24522abd4580..7c27a8ebef6a573a0f7210f4a6474f7919340ff2 100644 (file)
@@ -31,6 +31,7 @@
  * - no readahead or I/O queue unplugging required
  */
 struct backing_dev_info directly_mappable_cdev_bdi = {
+       .name = "char",
        .capabilities   = (
 #ifdef CONFIG_MMU
                /* permit private copies of the data to be taken */
index 4921e7426d95b4d3aed71a1dc0e0d7c89d1e2100..a2f746066c5da12fc8dc3623d47c04592141a055 100644 (file)
@@ -51,6 +51,7 @@ static const struct address_space_operations configfs_aops = {
 };
 
 static struct backing_dev_info configfs_backing_dev_info = {
+       .name           = "configfs",
        .ra_pages       = 0,    /* No readahead */
        .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK,
 };
index f91ccc4a189de18b52450f8d847b4983ac5e4311..4567db6f94308d41242dc29bc40458e36bf8300d 100644 (file)
@@ -801,6 +801,7 @@ static int fuse_bdi_init(struct fuse_conn *fc, struct super_block *sb)
 {
        int err;
 
+       fc->bdi.name = "fuse";
        fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
        fc->bdi.unplug_io_fn = default_unplug_io_fn;
        /* fuse does it's own writeback accounting */
index cb88dac8ccaae6f43dfc25edbcaa202fa0cb26cb..a93b885311d82f472c306451c3ff686d5afc9ea3 100644 (file)
@@ -44,6 +44,7 @@ static const struct inode_operations hugetlbfs_dir_inode_operations;
 static const struct inode_operations hugetlbfs_inode_operations;
 
 static struct backing_dev_info hugetlbfs_backing_dev_info = {
+       .name           = "hugetlbfs",
        .ra_pages       = 0,    /* No readahead */
        .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK,
 };
index 8d25ccb2d51d514a27a5098cfd13ad872cb46dc8..c6be84a161f61a12d022a8574677b6ad813f0436 100644 (file)
@@ -879,6 +879,7 @@ static void nfs_server_set_fsinfo(struct nfs_server *server, struct nfs_fsinfo *
                server->rsize = NFS_MAX_FILE_IO_SIZE;
        server->rpages = (server->rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 
+       server->backing_dev_info.name = "nfs";
        server->backing_dev_info.ra_pages = server->rpages * NFS_MAX_READAHEAD;
 
        if (server->wsize > max_rpc_payload)
index 1c9efb406a96b98a36fa5ae5450198b6e8e8a067..02bf17808bdc50d1c8f72aa8f8a13664bed5a146 100644 (file)
@@ -325,6 +325,7 @@ clear_fields:
 }
 
 static struct backing_dev_info dlmfs_backing_dev_info = {
+       .name           = "ocfs2-dlmfs",
        .ra_pages       = 0,    /* No readahead */
        .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK,
 };
index 0ff7566c767c5dfcccbe6d2ea771fd43ba7781e8..a7f0110fca4c546eb6c4941d513fb0983082560f 100644 (file)
@@ -46,6 +46,7 @@ static const struct super_operations ramfs_ops;
 static const struct inode_operations ramfs_dir_inode_operations;
 
 static struct backing_dev_info ramfs_backing_dev_info = {
+       .name           = "ramfs",
        .ra_pages       = 0,    /* No readahead */
        .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK |
                          BDI_CAP_MAP_DIRECT | BDI_CAP_MAP_COPY |
index 555f0ff988df1379638d0372ebced2349db25848..e57f98e54fce2439393243099bd24a2fc00ec991 100644 (file)
@@ -29,6 +29,7 @@ static const struct address_space_operations sysfs_aops = {
 };
 
 static struct backing_dev_info sysfs_backing_dev_info = {
+       .name           = "sysfs",
        .ra_pages       = 0,    /* No readahead */
        .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK,
 };
index 8d6050a5966c8d7c936dff54220946f1a8b8830a..51763aa8f4dec59890553f9331475f7fa1f4aed0 100644 (file)
@@ -1965,6 +1965,7 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
         *
         * Read-ahead will be disabled because @c->bdi.ra_pages is 0.
         */
+       c->bdi.name = "ubifs",
        c->bdi.capabilities = BDI_CAP_MAP_COPY;
        c->bdi.unplug_io_fn = default_unplug_io_fn;
        err  = bdi_init(&c->bdi);
index d045f5f615c731412eb7868e21d6808dc7deb453..2f218b7cb063a72fc7619f1e87a6fc27ca63a8ec 100644 (file)
@@ -66,6 +66,8 @@ struct backing_dev_info {
        void (*unplug_io_fn)(struct backing_dev_info *, struct page *);
        void *unplug_io_data;
 
+       char *name;
+
        struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
 
        struct prop_local_percpu completions;
index b6eadfe30e7be1627e81b8158e1d581c4575b11f..c7ece8f027f2bca3200199fc323c65939cee0453 100644 (file)
@@ -600,6 +600,7 @@ static struct inode_operations cgroup_dir_inode_operations;
 static struct file_operations proc_cgroupstats_operations;
 
 static struct backing_dev_info cgroup_backing_dev_info = {
+       .name           = "cgroup",
        .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK,
 };
 
index 22c45e932e3a6ffaccec76ab6f2a89c17aedd4a7..5cb32c5b93d829b25d120cc2b8aa6ddd919e52bc 100644 (file)
@@ -17,6 +17,7 @@ void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
 EXPORT_SYMBOL(default_unplug_io_fn);
 
 struct backing_dev_info default_backing_dev_info = {
+       .name           = "default",
        .ra_pages       = VM_MAX_READAHEAD * 1024 / PAGE_CACHE_SIZE,
        .state          = 0,
        .capabilities   = BDI_CAP_MAP_COPY,
index 42cd38eba79f1ffb096db8683bc11dd5604fe367..5ae6b8b78c801d821d41003917b720116c938bd0 100644 (file)
@@ -34,6 +34,7 @@ static const struct address_space_operations swap_aops = {
 };
 
 static struct backing_dev_info swap_backing_dev_info = {
+       .name           = "swap",
        .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK | BDI_CAP_SWAP_BACKED,
        .unplug_io_fn   = swap_unplug_io_fn,
 };