From: Sankar P <psankar@novell.com>
Subject: novfs: backing device info initialization
References: bnc#623472
Patch-mainline: no

The patch initializes and destroys the backing device info struct
for the novfs properly. Fixes an OOPS as well.

Acked-by: Jan Kara <jack@novell.com>
Acked-by: Sankar P <psankar@novell.com>
Signed-off-by: Anders Johansson <ajohansson@novell.com>

---
 fs/novfs/inode.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- a/fs/novfs/inode.c
+++ b/fs/novfs/inode.c
@@ -3977,6 +3977,17 @@ int __init init_novfs(void)
 	inHAX = 0;
 	inHAXTime = get_nanosecond_time();
 
+	retCode = bdi_init(&novfs_backing_dev_info);
+
+	if(!retCode)
+		retCode = bdi_register(&novfs_backing_dev_info, NULL, "novfs-map");
+	if (retCode) {
+		bdi_destroy(&novfs_backing_dev_info);
+		goto bdi_fail;
+	}
+
+	
+
 	retCode = novfs_proc_init();
 
 	novfs_profile_init();
@@ -3992,6 +4003,8 @@ int __init init_novfs(void)
 			novfs_scope_exit();
 		}
 	}
+
+bdi_fail:
 	return (retCode);
 }
 
@@ -4007,6 +4020,8 @@ void __exit exit_novfs(void)
 		kfree(novfs_current_mnt);
 		novfs_current_mnt = NULL;
 	}
+
+	bdi_destroy(&novfs_backing_dev_info);
 }
 
 int novfs_lock_inode_cache(struct inode *i)
