diff options
Diffstat (limited to 'mm/backing-dev.c')
-rw-r--r-- | mm/backing-dev.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 74b52dfd5852..b5f940ce0143 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -113,11 +113,23 @@ static const struct file_operations bdi_debug_stats_fops = { | |||
113 | .release = single_release, | 113 | .release = single_release, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static void bdi_debug_register(struct backing_dev_info *bdi, const char *name) | 116 | static int bdi_debug_register(struct backing_dev_info *bdi, const char *name) |
117 | { | 117 | { |
118 | if (!bdi_debug_root) | ||
119 | return -ENOMEM; | ||
120 | |||
118 | bdi->debug_dir = debugfs_create_dir(name, bdi_debug_root); | 121 | bdi->debug_dir = debugfs_create_dir(name, bdi_debug_root); |
122 | if (!bdi->debug_dir) | ||
123 | return -ENOMEM; | ||
124 | |||
119 | bdi->debug_stats = debugfs_create_file("stats", 0444, bdi->debug_dir, | 125 | bdi->debug_stats = debugfs_create_file("stats", 0444, bdi->debug_dir, |
120 | bdi, &bdi_debug_stats_fops); | 126 | bdi, &bdi_debug_stats_fops); |
127 | if (!bdi->debug_stats) { | ||
128 | debugfs_remove(bdi->debug_dir); | ||
129 | return -ENOMEM; | ||
130 | } | ||
131 | |||
132 | return 0; | ||
121 | } | 133 | } |
122 | 134 | ||
123 | static void bdi_debug_unregister(struct backing_dev_info *bdi) | 135 | static void bdi_debug_unregister(struct backing_dev_info *bdi) |
@@ -129,9 +141,10 @@ static void bdi_debug_unregister(struct backing_dev_info *bdi) | |||
129 | static inline void bdi_debug_init(void) | 141 | static inline void bdi_debug_init(void) |
130 | { | 142 | { |
131 | } | 143 | } |
132 | static inline void bdi_debug_register(struct backing_dev_info *bdi, | 144 | static inline int bdi_debug_register(struct backing_dev_info *bdi, |
133 | const char *name) | 145 | const char *name) |
134 | { | 146 | { |
147 | return 0; | ||
135 | } | 148 | } |
136 | static inline void bdi_debug_unregister(struct backing_dev_info *bdi) | 149 | static inline void bdi_debug_unregister(struct backing_dev_info *bdi) |
137 | { | 150 | { |