lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 06/11] filemap: cap PTE range to be created to i_size in folio_map_range()
On Thu, Apr 25, 2024 at 09:24:33PM +0100, Matthew Wilcox wrote:
> On Thu, Apr 25, 2024 at 01:37:41PM +0200, Pankaj Raghav (Samsung) wrote:
> > do {
> > unsigned long end;
> > + unsigned long i_size;
>
> Usually i_size is the name of a variable that contains an loff_t, not a
> page count. Not sure what to call this though. Also, can't we move
> this outside the loop?
You are right, this can move out as i_size is not going to change. I
will make this change. Thanks!
>
> pgoff_t file_end = DIV_ROUND_UP(i_size_read(mapping->host),
> PAGE_SIZE) - 1;
>
> if (end_pgoff > file_end)
> end_pgoff = file_end;

--
Pankaj

\
 
 \ /
  Last update: 2024-05-27 18:04    [W:0.264 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site