lkml.org 
[lkml]   [2023]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH 12/53] netfs: Provide tools to create a buffer in an xarray
Date
Jeff Layton <jlayton@kernel.org> wrote:

> Some kerneldoc comments on these new helpers would be nice. I assume
> that "index" and "to" are "start" and "end" for this, but it'd be nice
> to make that explicit.

These are internal to netfs not API functions, so they shouldn't appear in the
API docs. That's why the declaration is in internal.h, not netfs.h.

That said, I could describe them better.

> > + ret = netfs_add_folios_to_buffer(buffer, mapping, want_index,
> > + have_index - 1, gfp_mask);
> > + if (ret < 0)
> > + return ret;
> > + have_folios += have_index - want_index;
> > +
> > + ret = netfs_add_folios_to_buffer(buffer, mapping,
> > + have_index + have_folios,
> > + want_index + want_folios - 1,
> > + gfp_mask);
>
> I don't get it. Why are you calling netfs_add_folios_to_buffer twice
> here? Why not just make one call? Either way, a comment here explaining
> that would also be nice.

The ranges aren't contiguous. They bracket the folios spliced from the
mapping. That being said, I seem to have lost a bit of maths somewhere.

Further, I'm not now using netfs_add_folios_to_buffer(), so I'll remove it.

David

\
 
 \ /
  Last update: 2023-11-20 14:03    [W:0.062 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site