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

[Xen-devel] [PATCH v3 07/11] tmem: Make the uint64_t oid[3] a proper structure: tmem_oid



>>> On 28.08.15 at 20:53, <konrad.wilk@xxxxxxxxxx> wrote:
> @@ -2714,7 +2719,7 @@ long do_tmem_op(tmem_cli_op_t uops)
>              write_unlock(&tmem_rwlock);
>              read_lock(&tmem_rwlock);
>  
> -            oidp = (struct oid *)&op.u.gen.oid[0];
> +            oidp = (struct tmem_oid *)&op.u.gen.oid[0];

AIUI this is going to go away later anyway, but generally I think it
would be better to hide explicit casts like this by using container_of()
when possible.

> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -737,6 +737,12 @@ DEFINE_XEN_GUEST_HANDLE(xen_sysctl_psr_cat_op_t);
>  #define XEN_SYSCTL_TMEM_OP_RESTORE_PUT_PAGE       32
>  #define XEN_SYSCTL_TMEM_OP_RESTORE_FLUSH_PAGE     33
>  
> +struct tmem_oid {
> +    uint64_t oid[3];
> +};
> +typedef struct tmem_oid tmem_oid_t;
> +DEFINE_XEN_GUEST_HANDLE(tmem_oid_t);

I know this is going to be a boring mechanical thing, but I'd really
like to see this to be xen_tmem_oid (and alike), especially since
you intend to also use the type for th non-tools part of the
interface.

Jan


_______________________________________________
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®.