diff options
Diffstat (limited to 'fs/fuse/dax.c')
-rw-r--r-- | fs/fuse/dax.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c new file mode 100644 index 000000000000..9660d01f49a5 --- /dev/null +++ b/fs/fuse/dax.c @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * dax: direct host memory access + * Copyright (C) 2020 Red Hat, Inc. + */ + +#include "fuse_i.h" + +#include <linux/dax.h> + +struct fuse_conn_dax { + /* DAX device */ + struct dax_device *dev; +}; + +void fuse_dax_conn_free(struct fuse_conn *fc) +{ + kfree(fc->dax); +} + +int fuse_dax_conn_alloc(struct fuse_conn *fc, struct dax_device *dax_dev) +{ + struct fuse_conn_dax *fcd; + + if (!dax_dev) + return 0; + + fcd = kzalloc(sizeof(*fcd), GFP_KERNEL); + if (!fcd) + return -ENOMEM; + + fcd->dev = dax_dev; + + fc->dax = fcd; + return 0; +} |