diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-02-12 22:08:01 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:37 -0400 |
commit | 318ceed088497d1ca839b1172518ac4cc7096b82 (patch) | |
tree | 7dfd07bfb5e8c5d5dbb0ba4ea523f334c98c66bb /fs/pstore | |
parent | ca85c07809ca19de3391cb79ee1198f3dd91fa8d (diff) |
tidy up after d_make_root() conversion
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pstore')
-rw-r--r-- | fs/pstore/inode.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index ec7d1fb6f35a..f37c32b94525 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c | |||
@@ -278,9 +278,7 @@ fail: | |||
278 | 278 | ||
279 | int pstore_fill_super(struct super_block *sb, void *data, int silent) | 279 | int pstore_fill_super(struct super_block *sb, void *data, int silent) |
280 | { | 280 | { |
281 | struct inode *inode = NULL; | 281 | struct inode *inode; |
282 | struct dentry *root; | ||
283 | int err; | ||
284 | 282 | ||
285 | save_mount_options(sb, data); | 283 | save_mount_options(sb, data); |
286 | 284 | ||
@@ -296,25 +294,17 @@ int pstore_fill_super(struct super_block *sb, void *data, int silent) | |||
296 | parse_options(data); | 294 | parse_options(data); |
297 | 295 | ||
298 | inode = pstore_get_inode(sb, NULL, S_IFDIR | 0755, 0); | 296 | inode = pstore_get_inode(sb, NULL, S_IFDIR | 0755, 0); |
299 | if (!inode) { | 297 | if (inode) { |
300 | err = -ENOMEM; | 298 | /* override ramfs "dir" options so we catch unlink(2) */ |
301 | goto fail; | 299 | inode->i_op = &pstore_dir_inode_operations; |
302 | } | ||
303 | /* override ramfs "dir" options so we catch unlink(2) */ | ||
304 | inode->i_op = &pstore_dir_inode_operations; | ||
305 | |||
306 | root = d_make_root(inode); | ||
307 | sb->s_root = root; | ||
308 | if (!root) { | ||
309 | err = -ENOMEM; | ||
310 | goto fail; | ||
311 | } | 300 | } |
301 | sb->s_root = d_make_root(inode); | ||
302 | if (!sb->s_root) | ||
303 | return -ENOMEM; | ||
312 | 304 | ||
313 | pstore_get_records(0); | 305 | pstore_get_records(0); |
314 | 306 | ||
315 | return 0; | 307 | return 0; |
316 | fail: | ||
317 | return err; | ||
318 | } | 308 | } |
319 | 309 | ||
320 | static struct dentry *pstore_mount(struct file_system_type *fs_type, | 310 | static struct dentry *pstore_mount(struct file_system_type *fs_type, |