[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 03/16] tmem: cleanup: rm unused tmem_op



On Wed, Nov 20, 2013 at 04:46:12PM +0800, Bob Liu wrote:
> TMEM_READ/TMEM_WRITE/TMEM_XCHG/TMEM_NEW_PAGE are never be used.

You also need to delete them in include/public/tmem.h and rev up the
TMEM_SPEC_VERSION I think?

> 
> Signed-off-by: Bob Liu <bob.liu@xxxxxxxxxx>
> ---
>  xen/common/tmem.c |   21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/xen/common/tmem.c b/xen/common/tmem.c
> index 081772e..c272930 100644
> --- a/xen/common/tmem.c
> +++ b/xen/common/tmem.c
> @@ -2646,11 +2646,6 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
>          rc = do_tmem_new_pool(TMEM_CLI_ID_NULL, 0, op.u.creat.flags,
>                                op.u.creat.uuid[0], op.u.creat.uuid[1]);
>          break;
> -    case TMEM_NEW_PAGE:
> -        tmem_ensure_avail_pages();
> -        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0, 0,
> -                         tmem_cli_buf_null);
> -        break;
>      case TMEM_PUT_PAGE:
>          tmem_ensure_avail_pages();
>          rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0,
> @@ -2676,22 +2671,6 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
>          flush = 1;
>          rc = do_tmem_destroy_pool(op.pool_id);
>          break;
> -    case TMEM_READ:
> -        rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
> -                         op.u.gen.tmem_offset, op.u.gen.pfn_offset,
> -                         op.u.gen.len, tmem_cli_buf_null);
> -        break;
> -    case TMEM_WRITE:
> -        rc = do_tmem_put(pool, oidp,
> -                         op.u.gen.index, op.u.gen.cmfn,
> -                         op.u.gen.tmem_offset, op.u.gen.pfn_offset,
> -                         op.u.gen.len, tmem_cli_buf_null);
> -        break;
> -    case TMEM_XCHG:
> -        /* need to hold global lock to ensure xchg is atomic */
> -        tmem_client_warn("tmem_xchg op not implemented yet\n");
> -        rc = 0;
> -        break;

Hm, they end up at the default which has 'rc=0'. That is incorrect.
It should actually be -ENOSYS.

>      default:
>          tmem_client_warn("tmem: op %d not implemented\n", op.cmd);
>          rc = 0;
> -- 
> 1.7.10.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.