linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "willy@infradead.org" <willy@infradead.org>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	David Howells <dhowells@redhat.com>
Subject: Re:  [PATCH v3 10/9] fs: Remove page_mkwrite_check_truncate()
Date: Mon, 24 Feb 2025 22:24:51 +0000	[thread overview]
Message-ID: <37368dc6d9e561ff610f307b0abce583dae73150.camel@ibm.com> (raw)
In-Reply-To: <20250221204421.3590340-1-willy@infradead.org>

On Fri, 2025-02-21 at 20:44 +0000, Matthew Wilcox (Oracle) wrote:
> All callers of this function have now been converted to use
> folio_mkwrite_check_truncate().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  include/linux/pagemap.h | 28 ----------------------------
>  1 file changed, 28 deletions(-)
> 
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 8c52a637d42b..798e2e39c6e2 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -1579,34 +1579,6 @@ static inline ssize_t folio_mkwrite_check_truncate(struct folio *folio,
>  	return offset;
>  }
>  
> -/**
> - * page_mkwrite_check_truncate - check if page was truncated
> - * @page: the page to check
> - * @inode: the inode to check the page against
> - *
> - * Returns the number of bytes in the page up to EOF,
> - * or -EFAULT if the page was truncated.
> - */
> -static inline int page_mkwrite_check_truncate(struct page *page,
> -					      struct inode *inode)
> -{
> -	loff_t size = i_size_read(inode);
> -	pgoff_t index = size >> PAGE_SHIFT;
> -	int offset = offset_in_page(size);
> -
> -	if (page->mapping != inode->i_mapping)
> -		return -EFAULT;
> -
> -	/* page is wholly inside EOF */
> -	if (page->index < index)
> -		return PAGE_SIZE;
> -	/* page is wholly past EOF */
> -	if (page->index > index || !offset)
> -		return -EFAULT;
> -	/* page is partially inside EOF */
> -	return offset;
> -}
> -
>  /**
>   * i_blocks_per_folio - How many blocks fit in this folio.
>   * @inode: The inode which contains the blocks.

As far as I can see, we exchanged the ceph_page_mkwrite() in [PATCH v3 2/9]:

-		if (page_mkwrite_check_truncate(page, inode) < 0) {
-			unlock_page(page);
+		if (folio_mkwrite_check_truncate(folio, inode) < 0) {
+			folio_unlock(folio);

And it was only user of page_mkwrite_check_truncate(). So, we can remove the
page_mkwrite_check_truncate() functionality.

Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>

Thanks,
Slava.


  parent reply	other threads:[~2025-02-24 22:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 18:51 [PATCH v3 0/9] Remove accesses to page->index from ceph Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 1/9] ceph: Remove ceph_writepage() Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 2/9] ceph: Use a folio in ceph_page_mkwrite() Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 3/9] ceph: Convert ceph_find_incompatible() to take a folio Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 4/9] ceph: Convert ceph_readdir_cache_control to store " Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 5/9] ceph: Convert writepage_nounlock() to write_folio_nounlock() Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 6/9] ceph: Convert ceph_check_page_before_write() to use a folio Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 7/9] ceph: Remove uses of page from ceph_process_folio_batch() Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 8/9] ceph: Convert ceph_move_dirty_page_in_page_array() to move_dirty_folio_in_page_array() Matthew Wilcox (Oracle)
2025-02-17 18:51 ` [PATCH v3 9/9] ceph: Pass a folio to ceph_allocate_page_array() Matthew Wilcox (Oracle)
2025-02-18  0:34 ` [PATCH v3 0/9] Remove accesses to page->index from ceph Viacheslav Dubeyko
2025-02-21 20:44 ` [PATCH v3 10/9] fs: Remove page_mkwrite_check_truncate() Matthew Wilcox (Oracle)
2025-02-21 20:45   ` Matthew Wilcox
2025-02-24 20:11     ` Viacheslav Dubeyko
2025-02-24 20:19       ` Matthew Wilcox
2025-02-24 20:39         ` Viacheslav Dubeyko
2025-02-24 22:24   ` Viacheslav Dubeyko [this message]
2025-02-28 10:22 ` [PATCH v3 0/9] Remove accesses to page->index from ceph Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37368dc6d9e561ff610f307b0abce583dae73150.camel@ibm.com \
    --to=slava.dubeyko@ibm.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).