[sheepdog] [PATCH 04/12] dog: add nfs command
Hitoshi Mitake
mitake.hitoshi at gmail.com
Wed Jan 29 03:30:57 CET 2014
At Wed, 29 Jan 2014 04:19:04 +0800,
Liu Yuan wrote:
> diff --git a/sheep/ops.c b/sheep/ops.c
> index 1e9bc1e..ad8847a 100644
> --- a/sheep/ops.c
> +++ b/sheep/ops.c
> @@ -998,7 +998,16 @@ static int local_set_loglevel(struct request *req)
> set_loglevel(new_level);
>
> return SD_RES_SUCCESS;
> +}
> +
> +static int local_nfs_create(struct request *req)
> +{
> + return nfs_create(req->data);
> +}
>
> +static int local_nfs_delete(struct request *req)
> +{
> + return nfs_delete(req->data);
> }
>
> static struct sd_op_template sd_ops[] = {
> @@ -1285,6 +1294,20 @@ static struct sd_op_template sd_ops[] = {
> .process_work = local_set_loglevel,
> },
>
> + [SD_OP_NFS_CREATE] = {
> + .name = "NFS_CREATE",
> + .type = SD_OP_TYPE_LOCAL,
> + .force = false,
> + .process_work = local_nfs_create,
> + },
> +
> + [SD_OP_NFS_DELETE] = {
> + .name = "NFS_DELETE",
> + .type = SD_OP_TYPE_LOCAL,
> + .force = false,
> + .process_work = local_nfs_delete,
> + },
> +
These opts should be excluded by #ifdef HAVE_NFS, or
>
> #ifdef HAVE_NFS
> int nfs_init(const char *options);
> +int nfs_create(const char *name);
> +int nfs_delete(const char *name);
> #else
> static inline int nfs_init(const char *options)
> {
you need to add empty definitions of nfs_create() and nfs_delete()
here just for returning error.
Thanks,
Hitoshi
More information about the sheepdog
mailing list