]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
vfs: Convert ocxlflash to use the new mount API
authorDavid Howells <dhowells@redhat.com>
Mon, 25 Mar 2019 16:38:25 +0000 (16:38 +0000)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 25 May 2019 22:06:15 +0000 (18:06 -0400)
Convert the ocxlflash filesystem to the new internal mount API as the old
one will be obsoleted and removed.  This allows greater flexibility in
communication of mount parameters between userspace, the VFS and the
filesystem.

See Documentation/filesystems/mount_api.txt for more information.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
cc: "Manoj N. Kumar" <manoj@linux.ibm.com>
cc: Uma Krishnan <ukrishn@linux.ibm.com>
cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
cc: "Martin K. Petersen" <martin.petersen@oracle.com>
cc: linux-scsi@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/scsi/cxlflash/ocxl_hw.c

index 38e1fbd2b406ab6eaa84620cd41f26d6bc3fb5d3..e5af37ee9b6ea52b39f96d51a251d1683e0361b9 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/idr.h>
 #include <linux/module.h>
 #include <linux/mount.h>
+#include <linux/pseudo_fs.h>
 #include <linux/poll.h>
 #include <linux/sched/signal.h>
 
 static int ocxlflash_fs_cnt;
 static struct vfsmount *ocxlflash_vfs_mount;
 
-/*
- * ocxlflash_fs_mount() - mount the pseudo-filesystem
- * @fs_type:   File system type.
- * @flags:     Flags for the filesystem.
- * @dev_name:  Device name associated with the filesystem.
- * @data:      Data pointer.
- *
- * Return: pointer to the directory entry structure
- */
-static struct dentry *ocxlflash_fs_mount(struct file_system_type *fs_type,
-                                        int flags, const char *dev_name,
-                                        void *data)
+static int ocxlflash_fs_init_fs_context(struct fs_context *fc)
 {
-       return mount_pseudo(fs_type, NULL, NULL, OCXLFLASH_FS_MAGIC);
+       return init_pseudo(fc, OCXLFLASH_FS_MAGIC) ? 0 : -ENOMEM;
 }
 
 static struct file_system_type ocxlflash_fs_type = {
        .name           = "ocxlflash",
        .owner          = THIS_MODULE,
-       .mount          = ocxlflash_fs_mount,
+       .init_fs_context = ocxlflash_fs_init_fs_context,
        .kill_sb        = kill_anon_super,
 };