Re: [PATCHv2 for-next 5/5] RDMA/rtrs-clt: Rename rtrs_clt to rtrs_clt_sess

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

 



On Tue, Jan 4, 2022 at 8:09 AM Guoqing Jiang <guoqing.jiang@xxxxxxxxx> wrote:
>
>
>
> On 1/3/22 9:33 PM, Jack Wang wrote:
> > From: Vaishali Thakkar<vaishali.thakkar@xxxxxxxxx>
> >
> > Structure rtrs_clt is used for sessions. So to
> > avoid confusions rename it to rtrs_clt_sess.
> >
> > Transformations are done with the help of
> > following coccinelle script.
> >
> > @@
> > @@
> > struct
> > - rtrs_clt
> > + rtrs_clt_sess
> >
> > Signed-off-by: Vaishali Thakkar<vaishali.thakkar@xxxxxxxxx>
> > Signed-off-by: Jack Wang<jinpu.wang@xxxxxxxxx>
> > ---
> >   drivers/block/rnbd/rnbd-clt.c                |  4 +-
> >   drivers/block/rnbd/rnbd-clt.h                |  2 +-
> >   drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c | 24 +++---
> >   drivers/infiniband/ulp/rtrs/rtrs-clt.c       | 78 ++++++++++----------
> >   drivers/infiniband/ulp/rtrs/rtrs-clt.h       | 19 ++---
> >   drivers/infiniband/ulp/rtrs/rtrs.h           | 21 +++---
> >   6 files changed, 77 insertions(+), 71 deletions(-)
> >
> > diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
> > index 2df0657cdf00..70bbbdb81db1 100644
> > --- a/drivers/block/rnbd/rnbd-clt.c
> > +++ b/drivers/block/rnbd/rnbd-clt.c
> > @@ -433,7 +433,7 @@ static void msg_conf(void *priv, int errno)
> >       schedule_work(&iu->work);
> >   }
> >
> > -static int send_usr_msg(struct rtrs_clt *rtrs, int dir,
> > +static int send_usr_msg(struct rtrs_clt_sess *rtrs, int dir,
> >                       struct rnbd_iu *iu, struct kvec *vec,
> >                       size_t len, struct scatterlist *sg, unsigned int sg_len,
> >                       void (*conf)(struct work_struct *work),
> > @@ -1010,7 +1010,7 @@ static int rnbd_client_xfer_request(struct rnbd_clt_dev *dev,
> >                                    struct request *rq,
> >                                    struct rnbd_iu *iu)
> >   {
> > -     struct rtrs_clt *rtrs = dev->sess->rtrs;
> > +     struct rtrs_clt_sess *rtrs = dev->sess->rtrs;
> >       struct rtrs_permit *permit = iu->permit;
> >       struct rnbd_msg_io msg;
> >       struct rtrs_clt_req_ops req_ops;
> > diff --git a/drivers/block/rnbd/rnbd-clt.h b/drivers/block/rnbd/rnbd-clt.h
> > index 9ef8c4f306f2..0c2cae7f39b9 100644
> > --- a/drivers/block/rnbd/rnbd-clt.h
> > +++ b/drivers/block/rnbd/rnbd-clt.h
> > @@ -75,7 +75,7 @@ struct rnbd_cpu_qlist {
> >
> >   struct rnbd_clt_session {
> >       struct list_head        list;
> > -     struct rtrs_clt        *rtrs;
> > +     struct rtrs_clt_sess        *rtrs;
>
> While at it, how about change it to clt_sess? Otherwise there is symbol name
> pollution between rnbd_clt_session and rnbd_srv_session.
>
> [ ...]
>
> >               /*
> > @@ -743,7 +744,7 @@ static int post_recv_path(struct rtrs_clt_path *clt_path)
> >   struct path_it {
> >       int i;
> >       struct list_head skip_list;
> > -     struct rtrs_clt *clt;
> > +     struct rtrs_clt_sess *clt;
>
> To align with the change of type, s/clt/clt_sess? If so, it applies to
> others as well.
>
> [ ... ]
>
> > --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.h
> > +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.h
> > @@ -126,7 +126,7 @@ struct rtrs_rbuf {
> >
> >   struct rtrs_clt_path {
> >       struct rtrs_path        s;
> > -     struct rtrs_clt *clt;
> > +     struct rtrs_clt_sess    **clt*;
>
> Ditto.
>
> [ ... ]
>
> > -struct rtrs_clt *rtrs_clt_open(struct rtrs_clt_ops *ops,
> > +struct rtrs_clt_sess *rtrs_clt_open(struct rtrs_clt_ops *ops,
> >                                const char *pathname,
> >                                const struct rtrs_addr *paths,
> >                                size_t path_cnt, u16 port,
> >                                size_t pdu_sz, u8 reconnect_delay_sec,
> >                                s16 max_reconnect_attempts, u32 nr_poll_queues);
> >
> > -void rtrs_clt_close(struct rtrs_clt *clt_path);
> > +void rtrs_clt_close(struct rtrs_clt_sess *clt_path);
>
> void rtrs_clt_close(struct rtrs_clt_sess *clt_sess);
>
> or
>
> void rtrs_clt_close(struct rtrs_clt_path *clt_path);

Good catch. Actually this should be

void rtrs_clt_close(struct rtrs_clt_sess *clt);

>
> Maybe rename those functions to rtrs_clt_session_{open,close} to resolve
> the ambiguous
> completely, or we can live with current name I am not sure.

For this series, I think we can live with the current name. :)

> BTW, I suppose the series deserve beer from Danil 😉

:)

> Thanks,
> Guoqing
>




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux