virtio_fs.c (ca31fef11dc83e672415d5925a134749761329bd) virtio_fs.c (84c215075b5723ab946708a6c74c26bd3c51114c)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * virtio-fs: Virtio Filesystem
4 * Copyright (C) 2018 Red Hat, Inc.
5 */
6
7#include <linux/fs.h>
8#include <linux/dax.h>

--- 83 unchanged lines hidden (view full) ---

92 OPT_DAX,
93};
94
95static const struct fs_parameter_spec virtio_fs_parameters[] = {
96 fsparam_flag("dax", OPT_DAX),
97 {}
98};
99
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * virtio-fs: Virtio Filesystem
4 * Copyright (C) 2018 Red Hat, Inc.
5 */
6
7#include <linux/fs.h>
8#include <linux/dax.h>

--- 83 unchanged lines hidden (view full) ---

92 OPT_DAX,
93};
94
95static const struct fs_parameter_spec virtio_fs_parameters[] = {
96 fsparam_flag("dax", OPT_DAX),
97 {}
98};
99
100static int virtio_fs_parse_param(struct fs_context *fc,
100static int virtio_fs_parse_param(struct fs_context *fsc,
101 struct fs_parameter *param)
102{
103 struct fs_parse_result result;
101 struct fs_parameter *param)
102{
103 struct fs_parse_result result;
104 struct fuse_fs_context *ctx = fc->fs_private;
104 struct fuse_fs_context *ctx = fsc->fs_private;
105 int opt;
106
105 int opt;
106
107 opt = fs_parse(fc, virtio_fs_parameters, param, &result);
107 opt = fs_parse(fsc, virtio_fs_parameters, param, &result);
108 if (opt < 0)
109 return opt;
110
111 switch (opt) {
112 case OPT_DAX:
113 ctx->dax = 1;
114 break;
115 default:
116 return -EINVAL;
117 }
118
119 return 0;
120}
121
108 if (opt < 0)
109 return opt;
110
111 switch (opt) {
112 case OPT_DAX:
113 ctx->dax = 1;
114 break;
115 default:
116 return -EINVAL;
117 }
118
119 return 0;
120}
121
122static void virtio_fs_free_fc(struct fs_context *fc)
122static void virtio_fs_free_fsc(struct fs_context *fsc)
123{
123{
124 struct fuse_fs_context *ctx = fc->fs_private;
124 struct fuse_fs_context *ctx = fsc->fs_private;
125
126 kfree(ctx);
127}
128
129static inline struct virtio_fs_vq *vq_to_fsvq(struct virtqueue *vq)
130{
131 struct virtio_fs *fs = vq->vdev->priv;
132

--- 1350 unchanged lines hidden (view full) ---

1483 kfree(fc);
1484 mutex_lock(&virtio_fs_mutex);
1485 virtio_fs_put(fs);
1486 mutex_unlock(&virtio_fs_mutex);
1487 return err;
1488}
1489
1490static const struct fs_context_operations virtio_fs_context_ops = {
125
126 kfree(ctx);
127}
128
129static inline struct virtio_fs_vq *vq_to_fsvq(struct virtqueue *vq)
130{
131 struct virtio_fs *fs = vq->vdev->priv;
132

--- 1350 unchanged lines hidden (view full) ---

1483 kfree(fc);
1484 mutex_lock(&virtio_fs_mutex);
1485 virtio_fs_put(fs);
1486 mutex_unlock(&virtio_fs_mutex);
1487 return err;
1488}
1489
1490static const struct fs_context_operations virtio_fs_context_ops = {
1491 .free = virtio_fs_free_fc,
1491 .free = virtio_fs_free_fsc,
1492 .parse_param = virtio_fs_parse_param,
1493 .get_tree = virtio_fs_get_tree,
1494};
1495
1496static int virtio_fs_init_fs_context(struct fs_context *fsc)
1497{
1498 struct fuse_fs_context *ctx;
1499

--- 48 unchanged lines hidden ---
1492 .parse_param = virtio_fs_parse_param,
1493 .get_tree = virtio_fs_get_tree,
1494};
1495
1496static int virtio_fs_init_fs_context(struct fs_context *fsc)
1497{
1498 struct fuse_fs_context *ctx;
1499

--- 48 unchanged lines hidden ---