]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
zsfold: Convert zsfold to use the new mount API
authorDavid Howells <dhowells@redhat.com>
Tue, 21 May 2019 06:55:45 +0000 (07:55 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 25 May 2019 22:06:01 +0000 (18:06 -0400)
Convert the zsfold 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>
include/uapi/linux/magic.h
mm/z3fold.c

index f8c00045d537e4b810a768ace70211d0bc0e3686..85c1119d0b0b124cc4953b90eb1457bc8a80dda3 100644 (file)
@@ -91,5 +91,6 @@
 #define UDF_SUPER_MAGIC                0x15013346
 #define BALLOON_KVM_MAGIC      0x13661366
 #define ZSMALLOC_MAGIC         0x58295829
+#define Z3FOLD_MAGIC           0x33
 
 #endif /* __LINUX_MAGIC_H__ */
index abeb5bcbea573bf97bc26933a36c936b65dfa038..a43e8bfcaaea9117d4f2e71dba9cf0729068673c 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/atomic.h>
 #include <linux/sched.h>
 #include <linux/cpumask.h>
-#include <linux/dcache.h>
 #include <linux/list.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/compaction.h>
 #include <linux/percpu.h>
 #include <linux/mount.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs.h>
 #include <linux/preempt.h>
 #include <linux/workqueue.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/zpool.h>
+#include <linux/magic.h>
 
 /*
  * NCHUNKS_ORDER determines the internal allocation granularity, effectively
@@ -239,15 +240,14 @@ static inline void free_handle(unsigned long handle)
        }
 }
 
-static struct dentry *z3fold_do_mount(struct file_system_type *fs_type,
-                               int flags, const char *dev_name, void *data)
+static int z3fold_init_fs_context(struct fs_context *fc)
 {
-       return mount_pseudo(fs_type, NULL, NULL, 0x33);
+       return init_pseudo(fc, Z3FOLD_MAGIC) ? 0 : -ENOMEM;
 }
 
 static struct file_system_type z3fold_fs = {
        .name           = "z3fold",
-       .mount          = z3fold_do_mount,
+       .init_fs_context = z3fold_init_fs_context,
        .kill_sb        = kill_anon_super,
 };