[PATCH 12/23] containers: bdi init hooks

From: Peter Zijlstra
Date: Tue Sep 11 2007 - 16:11:45 EST


split off from the large bdi_init patch because containers are not slated
for mainline any time soon.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
kernel/container.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

Index: linux-2.6/kernel/container.c
===================================================================
--- linux-2.6.orig/kernel/container.c
+++ linux-2.6/kernel/container.c
@@ -567,12 +567,13 @@ static int container_populate_dir(struct
static struct inode_operations container_dir_inode_operations;
static struct file_operations proc_containerstats_operations;

+static struct backing_dev_info container_backing_dev_info = {
+ .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
+};
+
static struct inode *container_new_inode(mode_t mode, struct super_block *sb)
{
struct inode *inode = new_inode(sb);
- static struct backing_dev_info container_backing_dev_info = {
- .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
- };

if (inode) {
inode->i_mode = mode;
@@ -2261,6 +2262,10 @@ int __init container_init(void)
int i;
struct proc_dir_entry *entry;

+ err = bdi_init(&container_backing_dev_info);
+ if (err)
+ return err;
+
for (i = 0; i < CONTAINER_SUBSYS_COUNT; i++) {
struct container_subsys *ss = subsys[i];
if (!ss->early_init)
@@ -2276,6 +2281,9 @@ int __init container_init(void)
entry->proc_fops = &proc_containerstats_operations;

out:
+ if (err)
+ bdi_destroy(&container_backing_dev_info);
+
return err;
}


--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/