diff mbox series

[RFC,1/2] dlmfs: convert to the new mount API

Message ID 20241028144443.609151-2-sandeen@redhat.com (mailing list archive)
State New
Headers show
Series ocfs2, dlmfs: convert to the new mount API | expand

Commit Message

Eric Sandeen Oct. 28, 2024, 2:41 p.m. UTC
Convert dlmfs to the new mount API.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 fs/ocfs2/dlmfs/dlmfs.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

Comments

Goldwyn Rodrigues Dec. 3, 2024, 4:45 p.m. UTC | #1
On  9:41 28/10, Eric Sandeen wrote:
> Convert dlmfs to the new mount API.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks good.
Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com>

> ---
>  fs/ocfs2/dlmfs/dlmfs.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
> index 7fc0e920eda7..2a7f36643895 100644
> --- a/fs/ocfs2/dlmfs/dlmfs.c
> +++ b/fs/ocfs2/dlmfs/dlmfs.c
> @@ -20,6 +20,7 @@
>  
>  #include <linux/module.h>
>  #include <linux/fs.h>
> +#include <linux/fs_context.h>
>  #include <linux/pagemap.h>
>  #include <linux/types.h>
>  #include <linux/slab.h>
> @@ -506,9 +507,7 @@ static int dlmfs_unlink(struct inode *dir,
>  	return status;
>  }
>  
> -static int dlmfs_fill_super(struct super_block * sb,
> -			    void * data,
> -			    int silent)
> +static int dlmfs_fill_super(struct super_block *sb, struct fs_context *fc)
>  {
>  	sb->s_maxbytes = MAX_LFS_FILESIZE;
>  	sb->s_blocksize = PAGE_SIZE;
> @@ -556,17 +555,27 @@ static const struct inode_operations dlmfs_file_inode_operations = {
>  	.setattr	= dlmfs_file_setattr,
>  };
>  
> -static struct dentry *dlmfs_mount(struct file_system_type *fs_type,
> -	int flags, const char *dev_name, void *data)
> +static int dlmfs_get_tree(struct fs_context *fc)
>  {
> -	return mount_nodev(fs_type, flags, data, dlmfs_fill_super);
> +	return get_tree_nodev(fc, dlmfs_fill_super);
> +}
> +
> +static const struct fs_context_operations dlmfs_context_ops = {
> +	.get_tree       = dlmfs_get_tree,
> +};
> +
> +static int dlmfs_init_fs_context(struct fs_context *fc)
> +{
> +	fc->ops = &dlmfs_context_ops;
> +
> +	return 0;
>  }
>  
>  static struct file_system_type dlmfs_fs_type = {
>  	.owner		= THIS_MODULE,
>  	.name		= "ocfs2_dlmfs",
> -	.mount		= dlmfs_mount,
>  	.kill_sb	= kill_litter_super,
> +	.init_fs_context = dlmfs_init_fs_context,
>  };
>  MODULE_ALIAS_FS("ocfs2_dlmfs");
>  
> -- 
> 2.46.0
> 
>
Joseph Qi Dec. 4, 2024, 12:01 p.m. UTC | #2
On 10/28/24 10:41 PM, Eric Sandeen wrote:
> Convert dlmfs to the new mount API.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>

> ---
>  fs/ocfs2/dlmfs/dlmfs.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
> index 7fc0e920eda7..2a7f36643895 100644
> --- a/fs/ocfs2/dlmfs/dlmfs.c
> +++ b/fs/ocfs2/dlmfs/dlmfs.c
> @@ -20,6 +20,7 @@
>  
>  #include <linux/module.h>
>  #include <linux/fs.h>
> +#include <linux/fs_context.h>
>  #include <linux/pagemap.h>
>  #include <linux/types.h>
>  #include <linux/slab.h>
> @@ -506,9 +507,7 @@ static int dlmfs_unlink(struct inode *dir,
>  	return status;
>  }
>  
> -static int dlmfs_fill_super(struct super_block * sb,
> -			    void * data,
> -			    int silent)
> +static int dlmfs_fill_super(struct super_block *sb, struct fs_context *fc)
>  {
>  	sb->s_maxbytes = MAX_LFS_FILESIZE;
>  	sb->s_blocksize = PAGE_SIZE;
> @@ -556,17 +555,27 @@ static const struct inode_operations dlmfs_file_inode_operations = {
>  	.setattr	= dlmfs_file_setattr,
>  };
>  
> -static struct dentry *dlmfs_mount(struct file_system_type *fs_type,
> -	int flags, const char *dev_name, void *data)
> +static int dlmfs_get_tree(struct fs_context *fc)
>  {
> -	return mount_nodev(fs_type, flags, data, dlmfs_fill_super);
> +	return get_tree_nodev(fc, dlmfs_fill_super);
> +}
> +
> +static const struct fs_context_operations dlmfs_context_ops = {
> +	.get_tree       = dlmfs_get_tree,
> +};
> +
> +static int dlmfs_init_fs_context(struct fs_context *fc)
> +{
> +	fc->ops = &dlmfs_context_ops;
> +
> +	return 0;
>  }
>  
>  static struct file_system_type dlmfs_fs_type = {
>  	.owner		= THIS_MODULE,
>  	.name		= "ocfs2_dlmfs",
> -	.mount		= dlmfs_mount,
>  	.kill_sb	= kill_litter_super,
> +	.init_fs_context = dlmfs_init_fs_context,
>  };
>  MODULE_ALIAS_FS("ocfs2_dlmfs");
>
diff mbox series

Patch

diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 7fc0e920eda7..2a7f36643895 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -20,6 +20,7 @@ 
 
 #include <linux/module.h>
 #include <linux/fs.h>
+#include <linux/fs_context.h>
 #include <linux/pagemap.h>
 #include <linux/types.h>
 #include <linux/slab.h>
@@ -506,9 +507,7 @@  static int dlmfs_unlink(struct inode *dir,
 	return status;
 }
 
-static int dlmfs_fill_super(struct super_block * sb,
-			    void * data,
-			    int silent)
+static int dlmfs_fill_super(struct super_block *sb, struct fs_context *fc)
 {
 	sb->s_maxbytes = MAX_LFS_FILESIZE;
 	sb->s_blocksize = PAGE_SIZE;
@@ -556,17 +555,27 @@  static const struct inode_operations dlmfs_file_inode_operations = {
 	.setattr	= dlmfs_file_setattr,
 };
 
-static struct dentry *dlmfs_mount(struct file_system_type *fs_type,
-	int flags, const char *dev_name, void *data)
+static int dlmfs_get_tree(struct fs_context *fc)
 {
-	return mount_nodev(fs_type, flags, data, dlmfs_fill_super);
+	return get_tree_nodev(fc, dlmfs_fill_super);
+}
+
+static const struct fs_context_operations dlmfs_context_ops = {
+	.get_tree       = dlmfs_get_tree,
+};
+
+static int dlmfs_init_fs_context(struct fs_context *fc)
+{
+	fc->ops = &dlmfs_context_ops;
+
+	return 0;
 }
 
 static struct file_system_type dlmfs_fs_type = {
 	.owner		= THIS_MODULE,
 	.name		= "ocfs2_dlmfs",
-	.mount		= dlmfs_mount,
 	.kill_sb	= kill_litter_super,
+	.init_fs_context = dlmfs_init_fs_context,
 };
 MODULE_ALIAS_FS("ocfs2_dlmfs");