Re: [RFC PATCH 19/35] libceph, ceph: Convert users of ceph_pagelist to ceph_databuf

From: David Howells
Date: Tue Mar 18 2025 - 18:27:26 EST


Viacheslav Dubeyko <Slava.Dubeyko@xxxxxxx> wrote:

> > /*
> > - * number of encoded locks is stable, so copy to pagelist
> > + * number of encoded locks is stable, so copy to databuf
> > */
> > struct_len = 2 * sizeof(u32) +
> > (num_fcntl_locks + num_flock_locks) *
>
> I think we have too many mysterious equations in CephFS code. :)

That's not particularly a function of these patches.

> > - err = ceph_pagelist_reserve(pagelist,
> > - sizeof(u64) + sizeof(u32) +
> > - pathlen + sizeof(rec.v1));
> > + err = ceph_databuf_reserve(dbuf,
> > + sizeof(u64) + sizeof(u32) +
> > + pathlen + sizeof(rec.v1),
> > + GFP_NOFS);
>
> Yeah, another mysterious calculation. Why do we add sizeof(u64) and
> sizeof(u32) here?

Protocol element space.

David