lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <FE9117E6-D432-439D-836F-9805986C29DD@oracle.com>
Date:   Tue, 7 Apr 2020 13:09:31 -0600
From:   William Kucharski <william.kucharski@...cle.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC] Renaming page_offset() to page_pos()

page_pos seems quite reasonable to me.

Reviewed-by: William Kucharski <william.kucharski@...cle.com>


> On Apr 3, 2020, at 9:33 AM, Matthew Wilcox <willy@...radead.org> wrote:
> 
> Without looking at the source, can you tell me what page_offset() does?
> 
> At least one regular contributor thought it meant the pgoff_t of this
> page within the file.  It's actually the byte offset of this page into
> the file.
> 
> We have a perfectly good name for byte offset into the file --
> file->f_pos.  So I propose renaming it to page_pos().  To minimise
> disruption to other development, I'm going to send Linus a pull request
> at the end of the merge window with the results of this coccinelle script:
> 
> @@ expression a; @@
> -       page_offset(a)
> +       page_pos(a)
> 
> I've reviewed the output and the only slight weirdness is an extra space
> in casts:
> 
>                btrfs_warn(BTRFS_I(page->mapping->host)->root->fs_info,
>                           "page private not zero on page %llu",
> -                          (unsigned long long)page_offset(page));
> +                          (unsigned long long) page_pos(page));
> 
> Sometimes Coccinelle fixes the surrounding whitespace to be better
> than it currently is:
> 
> -               ow->bv[i].bv_len = min(page_offset(ow->pages[i]) + PAGE_SIZE,
> -                   ow->off + ow->len) -
> -                   max(ow->off, page_offset(ow->pages[i]));
> +               ow->bv[i].bv_len = min(page_pos(ow->pages[i]) + PAGE_SIZE,
> +                                      ow->off + ow->len) -
> +                   max(ow->off, page_pos(ow->pages[i]));
> 
> (it's still bad, but it's an improvement)
> 
> Any objections?  Anyone got a better name than page_pos()?
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ