inode.c (95f8020459fd2f07ae6980d524c21d4d912fef59) inode.c (3325b4d85799957aa53514e69bed5c9df7771caf)
1// SPDX-License-Identifier: GPL-1.0+
2/*
3 * Hypervisor filesystem for Linux on s390.
4 *
5 * Copyright IBM Corp. 2006, 2008
6 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
7 */
8

--- 39 unchanged lines hidden (view full) ---

48static struct dentry *hypfs_last_dentry;
49
50static void hypfs_update_update(struct super_block *sb)
51{
52 struct hypfs_sb_info *sb_info = sb->s_fs_info;
53 struct inode *inode = d_inode(sb_info->update_file);
54
55 sb_info->last_update = ktime_get_seconds();
1// SPDX-License-Identifier: GPL-1.0+
2/*
3 * Hypervisor filesystem for Linux on s390.
4 *
5 * Copyright IBM Corp. 2006, 2008
6 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
7 */
8

--- 39 unchanged lines hidden (view full) ---

48static struct dentry *hypfs_last_dentry;
49
50static void hypfs_update_update(struct super_block *sb)
51{
52 struct hypfs_sb_info *sb_info = sb->s_fs_info;
53 struct inode *inode = d_inode(sb_info->update_file);
54
55 sb_info->last_update = ktime_get_seconds();
56 inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode);
56 inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
57}
58
59/* directory tree removal functions */
60
61static void hypfs_add_dentry(struct dentry *dentry)
62{
63 dentry->d_fsdata = hypfs_last_dentry;
64 hypfs_last_dentry = dentry;

--- 31 unchanged lines hidden (view full) ---

96 struct inode *ret = new_inode(sb);
97
98 if (ret) {
99 struct hypfs_sb_info *hypfs_info = sb->s_fs_info;
100 ret->i_ino = get_next_ino();
101 ret->i_mode = mode;
102 ret->i_uid = hypfs_info->uid;
103 ret->i_gid = hypfs_info->gid;
57}
58
59/* directory tree removal functions */
60
61static void hypfs_add_dentry(struct dentry *dentry)
62{
63 dentry->d_fsdata = hypfs_last_dentry;
64 hypfs_last_dentry = dentry;

--- 31 unchanged lines hidden (view full) ---

96 struct inode *ret = new_inode(sb);
97
98 if (ret) {
99 struct hypfs_sb_info *hypfs_info = sb->s_fs_info;
100 ret->i_ino = get_next_ino();
101 ret->i_mode = mode;
102 ret->i_uid = hypfs_info->uid;
103 ret->i_gid = hypfs_info->gid;
104 ret->i_atime = ret->i_mtime = inode_set_ctime_current(ret);
104 ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret);
105 if (S_ISDIR(mode))
106 set_nlink(ret, 2);
107 }
108 return ret;
109}
110
111static void hypfs_evict_inode(struct inode *inode)
112{

--- 342 unchanged lines hidden (view full) ---

455};
456
457static const struct super_operations hypfs_s_ops = {
458 .statfs = simple_statfs,
459 .evict_inode = hypfs_evict_inode,
460 .show_options = hypfs_show_options,
461};
462
105 if (S_ISDIR(mode))
106 set_nlink(ret, 2);
107 }
108 return ret;
109}
110
111static void hypfs_evict_inode(struct inode *inode)
112{

--- 342 unchanged lines hidden (view full) ---

455};
456
457static const struct super_operations hypfs_s_ops = {
458 .statfs = simple_statfs,
459 .evict_inode = hypfs_evict_inode,
460 .show_options = hypfs_show_options,
461};
462
463static int __init hypfs_init(void)
463int __init __hypfs_fs_init(void)
464{
465 int rc;
466
464{
465 int rc;
466
467 hypfs_dbfs_init();
468
469 if (hypfs_diag_init()) {
470 rc = -ENODATA;
471 goto fail_dbfs_exit;
472 }
473 if (hypfs_vm_init()) {
474 rc = -ENODATA;
475 goto fail_hypfs_diag_exit;
476 }
477 hypfs_sprp_init();
478 if (hypfs_diag0c_init()) {
479 rc = -ENODATA;
480 goto fail_hypfs_sprp_exit;
481 }
482 rc = sysfs_create_mount_point(hypervisor_kobj, "s390");
483 if (rc)
467 rc = sysfs_create_mount_point(hypervisor_kobj, "s390");
468 if (rc)
484 goto fail_hypfs_diag0c_exit;
469 return rc;
485 rc = register_filesystem(&hypfs_type);
486 if (rc)
470 rc = register_filesystem(&hypfs_type);
471 if (rc)
487 goto fail_filesystem;
472 goto fail;
488 return 0;
473 return 0;
489
490fail_filesystem:
474fail:
491 sysfs_remove_mount_point(hypervisor_kobj, "s390");
475 sysfs_remove_mount_point(hypervisor_kobj, "s390");
492fail_hypfs_diag0c_exit:
493 hypfs_diag0c_exit();
494fail_hypfs_sprp_exit:
495 hypfs_sprp_exit();
496 hypfs_vm_exit();
497fail_hypfs_diag_exit:
498 hypfs_diag_exit();
499 pr_err("Initialization of hypfs failed with rc=%i\n", rc);
500fail_dbfs_exit:
501 hypfs_dbfs_exit();
502 return rc;
503}
476 return rc;
477}
504device_initcall(hypfs_init)