hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/misc/cxl/api.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright 2014 IBM Corp.
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version
7
- * 2 of the License, or (at your option) any later version.
84 */
95
106 #include <linux/pci.h>
....@@ -13,6 +9,7 @@
139 #include <misc/cxl.h>
1410 #include <linux/module.h>
1511 #include <linux/mount.h>
12
+#include <linux/pseudo_fs.h>
1613 #include <linux/sched/mm.h>
1714 #include <linux/mmu_context.h>
1815
....@@ -37,21 +34,15 @@
3734 static int cxl_fs_cnt;
3835 static struct vfsmount *cxl_vfs_mount;
3936
40
-static const struct dentry_operations cxl_fs_dops = {
41
- .d_dname = simple_dname,
42
-};
43
-
44
-static struct dentry *cxl_fs_mount(struct file_system_type *fs_type, int flags,
45
- const char *dev_name, void *data)
37
+static int cxl_fs_init_fs_context(struct fs_context *fc)
4638 {
47
- return mount_pseudo(fs_type, "cxl:", NULL, &cxl_fs_dops,
48
- CXL_PSEUDO_FS_MAGIC);
39
+ return init_pseudo(fc, CXL_PSEUDO_FS_MAGIC) ? 0 : -ENOMEM;
4940 }
5041
5142 static struct file_system_type cxl_fs_type = {
5243 .name = "cxl",
5344 .owner = THIS_MODULE,
54
- .mount = cxl_fs_mount,
45
+ .init_fs_context = cxl_fs_init_fs_context,
5546 .kill_sb = kill_anon_super,
5647 };
5748