[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2680900.1742336740@warthog.procyon.org.uk>
Date: Tue, 18 Mar 2025 22:25:40 +0000
From: David Howells <dhowells@...hat.com>
To: Viacheslav Dubeyko <Slava.Dubeyko@....com>
Cc: dhowells@...hat.com, Alex Markuze <amarkuze@...hat.com>,
"slava@...eyko.com" <slava@...eyko.com>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"idryomov@...il.com" <idryomov@...il.com>,
"jlayton@...nel.org" <jlayton@...nel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"ceph-devel@...r.kernel.org" <ceph-devel@...r.kernel.org>,
"dongsheng.yang@...ystack.cn" <dongsheng.yang@...ystack.cn>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 18/35] libceph, rbd: Convert some page arrays to ceph_databuf
Viacheslav Dubeyko <Slava.Dubeyko@....com> wrote:
> > /*
> > * The response data for a STAT call consists of:
> > @@ -2118,14 +2118,12 @@ static int rbd_osd_setup_stat(struct ceph_osd_request *osd_req, int which)
> > * le32 tv_nsec;
> > * } mtime;
> > */
> > - pages = ceph_alloc_page_vector(1, GFP_NOIO);
> > - if (IS_ERR(pages))
> > - return PTR_ERR(pages);
> > + dbuf = ceph_databuf_reply_alloc(1, 8 + sizeof(struct ceph_timespec), GFP_NOIO);
>
> What this 8 + sizeof(struct ceph_timespec) means? Why do we use 8 here? :)
See the comment that's partially obscured by the patch hunk line:
/*
* The response data for a STAT call consists of:
* le64 length;
* struct {
* le32 tv_sec;
* le32 tv_nsec;
* } mtime;
*/
If you want to clean up and formalise all of these sorts of things, you might
need to invest in an rpcgen-like tool. I've occasionally toyed with the idea
for afs in the kernel (I've hand-written all the marshalling/unmarshalling
code in fs/afs/fsclient.c, fs/afs/yfsclient.c and fs/afs/vlclient.c, but there
are some not-so-simple RPC calls to handle - FetchData and StoreData for
example).
David
Powered by blists - more mailing lists