[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3188326.1742508102@warthog.procyon.org.uk>
Date: Thu, 20 Mar 2025 22:01:42 +0000
From: David Howells <dhowells@...hat.com>
To: Viacheslav Dubeyko <Slava.Dubeyko@....com>
Cc: dhowells@...hat.com, "slava@...eyko.com" <slava@...eyko.com>,
"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>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Alex Markuze <amarkuze@...hat.com>,
"jlayton@...nel.org" <jlayton@...nel.org>,
"idryomov@...il.com" <idryomov@...il.com>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>
Subject: Re: [RFC PATCH 04/35] ceph: Convert ceph_mds_request::r_pagelist to a databuf
Viacheslav Dubeyko <Slava.Dubeyko@....com> wrote:
> > > > + if (ceph_databuf_insert_frag(dbuf, 0, sizeof(*header),
> > > > GFP_KERNEL) < 0)
> > > > + goto out;
> > > > + if (ceph_databuf_insert_frag(dbuf, 1, PAGE_SIZE, GFP_KERNEL)
> > > > < 0)
> > > > goto out;
> > > >
> > > > + iov_iter_bvec(&iter, ITER_DEST, &dbuf->bvec[1], 1, len);
> > >
> > > Is it correct &dbuf->bvec[1]? Why do we work with item #1? I think it
> > > looks confusing.
> >
> > Because you have a protocol element (in dbuf->bvec[0]) and a buffer (in
> > dbuf->bvec[1]).
>
> It sounds to me that we need to have two declarations (something like this):
>
> #define PROTOCOL_ELEMENT_INDEX 0
> #define BUFFER_INDEX 1
But that's specific to this particular usage. There may or may not be a
frag/page allocated to a protocol element and there may or may not be buffer
parts and may be multiple buffer parts. There could even be multiple pages
allocated to protocol elements.
David
Powered by blists - more mailing lists