diff mbox series

[17/20] libceph: export osd_req_op_data() macro

Message ID 20190625144111.11270-18-idryomov@gmail.com (mailing list archive)
State New, archived
Headers show
Series rbd: support for object-map and fast-diff | expand

Commit Message

Ilya Dryomov June 25, 2019, 2:41 p.m. UTC
We already have one exported wrapper around it for extent.osd_data and
rbd_object_map_update_finish() needs another one for cls.request_data.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
---
 include/linux/ceph/osd_client.h | 8 ++++++++
 net/ceph/osd_client.c           | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

Comments

Dongsheng Yang July 1, 2019, 5:29 a.m. UTC | #1
On 06/25/2019 10:41 PM, Ilya Dryomov wrote:
> We already have one exported wrapper around it for extent.osd_data and
> rbd_object_map_update_finish() needs another one for cls.request_data.
>
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>


Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
> ---
>   include/linux/ceph/osd_client.h | 8 ++++++++
>   net/ceph/osd_client.c           | 8 --------
>   2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
> index edb191c40a5c..44100a4f0808 100644
> --- a/include/linux/ceph/osd_client.h
> +++ b/include/linux/ceph/osd_client.h
> @@ -389,6 +389,14 @@ extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
>   void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb);
>   void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err);
>   
> +#define osd_req_op_data(oreq, whch, typ, fld)				\
> +({									\
> +	struct ceph_osd_request *__oreq = (oreq);			\
> +	unsigned int __whch = (whch);					\
> +	BUG_ON(__whch >= __oreq->r_num_ops);				\
> +	&__oreq->r_ops[__whch].typ.fld;					\
> +})
> +
>   extern void osd_req_op_init(struct ceph_osd_request *osd_req,
>   			    unsigned int which, u16 opcode, u32 flags);
>   
> diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> index cc2bf296583d..22e8ccc1f975 100644
> --- a/net/ceph/osd_client.c
> +++ b/net/ceph/osd_client.c
> @@ -171,14 +171,6 @@ static void ceph_osd_data_bvecs_init(struct ceph_osd_data *osd_data,
>   	osd_data->num_bvecs = num_bvecs;
>   }
>   
> -#define osd_req_op_data(oreq, whch, typ, fld)				\
> -({									\
> -	struct ceph_osd_request *__oreq = (oreq);			\
> -	unsigned int __whch = (whch);					\
> -	BUG_ON(__whch >= __oreq->r_num_ops);				\
> -	&__oreq->r_ops[__whch].typ.fld;					\
> -})
> -
>   static struct ceph_osd_data *
>   osd_req_op_raw_data_in(struct ceph_osd_request *osd_req, unsigned int which)
>   {
Jeff Layton July 1, 2019, 11:05 a.m. UTC | #2
On Tue, 2019-06-25 at 16:41 +0200, Ilya Dryomov wrote:
> We already have one exported wrapper around it for extent.osd_data and
> rbd_object_map_update_finish() needs another one for cls.request_data.
> 
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
> ---
>  include/linux/ceph/osd_client.h | 8 ++++++++
>  net/ceph/osd_client.c           | 8 --------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
> index edb191c40a5c..44100a4f0808 100644
> --- a/include/linux/ceph/osd_client.h
> +++ b/include/linux/ceph/osd_client.h
> @@ -389,6 +389,14 @@ extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
>  void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb);
>  void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err);
>  
> +#define osd_req_op_data(oreq, whch, typ, fld)				\
> +({									\
> +	struct ceph_osd_request *__oreq = (oreq);			\
> +	unsigned int __whch = (whch);					\
> +	BUG_ON(__whch >= __oreq->r_num_ops);				\
> +	&__oreq->r_ops[__whch].typ.fld;					\
> +})
> +
>  extern void osd_req_op_init(struct ceph_osd_request *osd_req,
>  			    unsigned int which, u16 opcode, u32 flags);
>  
> diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> index cc2bf296583d..22e8ccc1f975 100644
> --- a/net/ceph/osd_client.c
> +++ b/net/ceph/osd_client.c
> @@ -171,14 +171,6 @@ static void ceph_osd_data_bvecs_init(struct ceph_osd_data *osd_data,
>  	osd_data->num_bvecs = num_bvecs;
>  }
>  
> -#define osd_req_op_data(oreq, whch, typ, fld)				\
> -({									\
> -	struct ceph_osd_request *__oreq = (oreq);			\
> -	unsigned int __whch = (whch);					\
> -	BUG_ON(__whch >= __oreq->r_num_ops);				\
> -	&__oreq->r_ops[__whch].typ.fld;					\
> -})
> -
>  static struct ceph_osd_data *
>  osd_req_op_raw_data_in(struct ceph_osd_request *osd_req, unsigned int which)
>  {

Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff mbox series

Patch

diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index edb191c40a5c..44100a4f0808 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -389,6 +389,14 @@  extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
 void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb);
 void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err);
 
+#define osd_req_op_data(oreq, whch, typ, fld)				\
+({									\
+	struct ceph_osd_request *__oreq = (oreq);			\
+	unsigned int __whch = (whch);					\
+	BUG_ON(__whch >= __oreq->r_num_ops);				\
+	&__oreq->r_ops[__whch].typ.fld;					\
+})
+
 extern void osd_req_op_init(struct ceph_osd_request *osd_req,
 			    unsigned int which, u16 opcode, u32 flags);
 
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index cc2bf296583d..22e8ccc1f975 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -171,14 +171,6 @@  static void ceph_osd_data_bvecs_init(struct ceph_osd_data *osd_data,
 	osd_data->num_bvecs = num_bvecs;
 }
 
-#define osd_req_op_data(oreq, whch, typ, fld)				\
-({									\
-	struct ceph_osd_request *__oreq = (oreq);			\
-	unsigned int __whch = (whch);					\
-	BUG_ON(__whch >= __oreq->r_num_ops);				\
-	&__oreq->r_ops[__whch].typ.fld;					\
-})
-
 static struct ceph_osd_data *
 osd_req_op_raw_data_in(struct ceph_osd_request *osd_req, unsigned int which)
 {