diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-04 11:15:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-04 11:15:33 -0500 |
commit | 0f2cc4ecd81dc1917a041dc93db0ada28f8356fa (patch) | |
tree | f128b50f48f50f0cda6d2b20b53e9ad6e2dfded3 /arch/s390/hypfs/inode.c | |
parent | 1fae4cfb97302289bb5df6a8195eb28385d0b002 (diff) | |
parent | 9643f5d94aadd47a5fa9754fb60f2c957de05903 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits)
init: Open /dev/console from rootfs
mqueue: fix typo "failues" -> "failures"
mqueue: only set error codes if they are really necessary
mqueue: simplify do_open() error handling
mqueue: apply mathematics distributivity on mq_bytes calculation
mqueue: remove unneeded info->messages initialization
mqueue: fix mq_open() file descriptor leak on user-space processes
fix race in d_splice_alias()
set S_DEAD on unlink() and non-directory rename() victims
vfs: add NOFOLLOW flag to umount(2)
get rid of ->mnt_parent in tomoyo/realpath
hppfs can use existing proc_mnt, no need for do_kern_mount() in there
Mirror MS_KERNMOUNT in ->mnt_flags
get rid of useless vfsmount_lock use in put_mnt_ns()
Take vfsmount_lock to fs/internal.h
get rid of insanity with namespace roots in tomoyo
take check for new events in namespace (guts of mounts_poll()) to namespace.c
Don't mess with generic_permission() under ->d_lock in hpfs
sanitize const/signedness for udf
nilfs: sanitize const/signedness in dealing with ->d_name.name
...
Fix up fairly trivial (famous last words...) conflicts in
drivers/infiniband/core/uverbs_main.c and security/tomoyo/realpath.c
Diffstat (limited to 'arch/s390/hypfs/inode.c')
-rw-r--r-- | arch/s390/hypfs/inode.c | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 341aff2687a5..cd128b07beda 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -288,46 +288,30 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent) | |||
288 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 288 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
289 | sb->s_magic = HYPFS_MAGIC; | 289 | sb->s_magic = HYPFS_MAGIC; |
290 | sb->s_op = &hypfs_s_ops; | 290 | sb->s_op = &hypfs_s_ops; |
291 | if (hypfs_parse_options(data, sb)) { | 291 | if (hypfs_parse_options(data, sb)) |
292 | rc = -EINVAL; | 292 | return -EINVAL; |
293 | goto err_alloc; | ||
294 | } | ||
295 | root_inode = hypfs_make_inode(sb, S_IFDIR | 0755); | 293 | root_inode = hypfs_make_inode(sb, S_IFDIR | 0755); |
296 | if (!root_inode) { | 294 | if (!root_inode) |
297 | rc = -ENOMEM; | 295 | return -ENOMEM; |
298 | goto err_alloc; | ||
299 | } | ||
300 | root_inode->i_op = &simple_dir_inode_operations; | 296 | root_inode->i_op = &simple_dir_inode_operations; |
301 | root_inode->i_fop = &simple_dir_operations; | 297 | root_inode->i_fop = &simple_dir_operations; |
302 | root_dentry = d_alloc_root(root_inode); | 298 | sb->s_root = root_dentry = d_alloc_root(root_inode); |
303 | if (!root_dentry) { | 299 | if (!root_dentry) { |
304 | iput(root_inode); | 300 | iput(root_inode); |
305 | rc = -ENOMEM; | 301 | return -ENOMEM; |
306 | goto err_alloc; | ||
307 | } | 302 | } |
308 | if (MACHINE_IS_VM) | 303 | if (MACHINE_IS_VM) |
309 | rc = hypfs_vm_create_files(sb, root_dentry); | 304 | rc = hypfs_vm_create_files(sb, root_dentry); |
310 | else | 305 | else |
311 | rc = hypfs_diag_create_files(sb, root_dentry); | 306 | rc = hypfs_diag_create_files(sb, root_dentry); |
312 | if (rc) | 307 | if (rc) |
313 | goto err_tree; | 308 | return rc; |
314 | sbi->update_file = hypfs_create_update_file(sb, root_dentry); | 309 | sbi->update_file = hypfs_create_update_file(sb, root_dentry); |
315 | if (IS_ERR(sbi->update_file)) { | 310 | if (IS_ERR(sbi->update_file)) |
316 | rc = PTR_ERR(sbi->update_file); | 311 | return PTR_ERR(sbi->update_file); |
317 | goto err_tree; | ||
318 | } | ||
319 | hypfs_update_update(sb); | 312 | hypfs_update_update(sb); |
320 | sb->s_root = root_dentry; | ||
321 | pr_info("Hypervisor filesystem mounted\n"); | 313 | pr_info("Hypervisor filesystem mounted\n"); |
322 | return 0; | 314 | return 0; |
323 | |||
324 | err_tree: | ||
325 | hypfs_delete_tree(root_dentry); | ||
326 | d_genocide(root_dentry); | ||
327 | dput(root_dentry); | ||
328 | err_alloc: | ||
329 | kfree(sbi); | ||
330 | return rc; | ||
331 | } | 315 | } |
332 | 316 | ||
333 | static int hypfs_get_super(struct file_system_type *fst, int flags, | 317 | static int hypfs_get_super(struct file_system_type *fst, int flags, |
@@ -340,12 +324,12 @@ static void hypfs_kill_super(struct super_block *sb) | |||
340 | { | 324 | { |
341 | struct hypfs_sb_info *sb_info = sb->s_fs_info; | 325 | struct hypfs_sb_info *sb_info = sb->s_fs_info; |
342 | 326 | ||
343 | if (sb->s_root) { | 327 | if (sb->s_root) |
344 | hypfs_delete_tree(sb->s_root); | 328 | hypfs_delete_tree(sb->s_root); |
329 | if (sb_info->update_file) | ||
345 | hypfs_remove(sb_info->update_file); | 330 | hypfs_remove(sb_info->update_file); |
346 | kfree(sb->s_fs_info); | 331 | kfree(sb->s_fs_info); |
347 | sb->s_fs_info = NULL; | 332 | sb->s_fs_info = NULL; |
348 | } | ||
349 | kill_litter_super(sb); | 333 | kill_litter_super(sb); |
350 | } | 334 | } |
351 | 335 | ||