[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c61e6b608f5d5537bb23892be27a52c92e1bd85d.camel@ibm.com>
Date: Thu, 20 Mar 2025 21:48:06 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: "idryomov@...il.com" <idryomov@...il.com>,
David Howells
<dhowells@...hat.com>
CC: "dongsheng.yang@...ystack.cn" <dongsheng.yang@...ystack.cn>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"ceph-devel@...r.kernel.org" <ceph-devel@...r.kernel.org>,
"slava@...eyko.com" <slava@...eyko.com>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
Alex Markuze <amarkuze@...hat.com>,
"jlayton@...nel.org" <jlayton@...nel.org>,
"linux-block@...r.kernel.org"
<linux-block@...r.kernel.org>
Subject: Re: Why use plain numbers and totals rather than predef'd constants for
RPC sizes?
On Thu, 2025-03-20 at 14:59 +0000, David Howells wrote:
> Viacheslav Dubeyko <Slava.Dubeyko@....com> wrote:
>
> > > - dbuf = ceph_databuf_reply_alloc(1, 8 + sizeof(struct ceph_timespec), GFP_NOIO);
> > > - if (!dbuf)
> > > + request = ceph_databuf_reply_alloc(1, 8 + sizeof(struct ceph_timespec), GFP_NOIO);
> >
> > Ditto. Why do we have 8 + sizeof(struct ceph_timespec) here?
>
> Because that's the size of the composite protocol element.
>
> As to why it's using a total of plain integers and sizeofs rather than
> constant macros, Ilya is the person to ask according to git blame;-).
>
> I would probably prefer sizeof(__le64) here over 8, but I didn't want to
> change it too far from the existing code.
>
> If you want macro constants for these sorts of things, someone else who knows
> the protocol better needs to do that. You could probably write something to
> generate them (akin to rpcgen).
>
Yes, make sense. I totally agree with you. :)
Thanks,
Slava.
Powered by blists - more mailing lists