BACKPORT: vfs: Convert dma-buf to use the new mount API

There is no original commit for this. It was done in a merge commit.

Change-Id: I8ec624ba3899e322ac9fa2b0023fa6b8e891e53c
This commit is contained in:
Thomas Turner
2025-08-28 21:08:43 +01:00
committed by bengris32
parent b3cdc77bc0
commit b3824e415d

View File

@@ -38,6 +38,7 @@
#include <linux/fdtable.h>
#include <linux/list_sort.h>
#include <linux/mount.h>
#include <linux/pseudo_fs.h>
#include <uapi/linux/dma-buf.h>
#include <uapi/linux/magic.h>
@@ -112,16 +113,20 @@ static const struct dentry_operations dma_buf_dentry_ops = {
static struct vfsmount *dma_buf_mnt;
static struct dentry *dma_buf_fs_mount(struct file_system_type *fs_type,
int flags, const char *name, void *data)
static int dma_buf_fs_init_context(struct fs_context *fc)
{
return mount_pseudo(fs_type, NULL, &dma_buf_dentry_ops,
DMA_BUF_MAGIC);
struct pseudo_fs_context *ctx;
ctx = init_pseudo(fc, DMA_BUF_MAGIC);
if (!ctx)
return -ENOMEM;
ctx->dops = &dma_buf_dentry_ops;
return 0;
}
static struct file_system_type dma_buf_fs_type = {
.name = "dmabuf",
.mount = dma_buf_fs_mount,
.init_fs_context = dma_buf_fs_init_context,
.kill_sb = kill_anon_super,
};