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

David Howells
2025-03-18T22:27:14Z

Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> 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