Skip to content

Commit 9dcef93

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
fs: Remove page_mkwrite_check_truncate()
All callers of this function have now been converted to use folio_mkwrite_check_truncate(). Signed-off-by: "Matthew Wilcox (Oracle)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Viacheslav Dubeyko <[email protected]> Reviewed-by: Viacheslav Dubeyko <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent d1b4526 commit 9dcef93

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

include/linux/pagemap.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,34 +1602,6 @@ static inline ssize_t folio_mkwrite_check_truncate(struct folio *folio,
16021602
return offset;
16031603
}
16041604

1605-
/**
1606-
* page_mkwrite_check_truncate - check if page was truncated
1607-
* @page: the page to check
1608-
* @inode: the inode to check the page against
1609-
*
1610-
* Returns the number of bytes in the page up to EOF,
1611-
* or -EFAULT if the page was truncated.
1612-
*/
1613-
static inline int page_mkwrite_check_truncate(struct page *page,
1614-
struct inode *inode)
1615-
{
1616-
loff_t size = i_size_read(inode);
1617-
pgoff_t index = size >> PAGE_SHIFT;
1618-
int offset = offset_in_page(size);
1619-
1620-
if (page->mapping != inode->i_mapping)
1621-
return -EFAULT;
1622-
1623-
/* page is wholly inside EOF */
1624-
if (page->index < index)
1625-
return PAGE_SIZE;
1626-
/* page is wholly past EOF */
1627-
if (page->index > index || !offset)
1628-
return -EFAULT;
1629-
/* page is partially inside EOF */
1630-
return offset;
1631-
}
1632-
16331605
/**
16341606
* i_blocks_per_folio - How many blocks fit in this folio.
16351607
* @inode: The inode which contains the blocks.

0 commit comments

Comments
 (0)