diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2023-09-21 22:07:43 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2023-10-25 20:19:01 +0200 |
commit | f4b830cfceffb05d8feb899fbd28fd592f1bb0ae (patch) | |
tree | a81713e094af85fac91f8a7be60ef55b8e30dff6 /fs/ext2 | |
parent | ext2: Convert ext2_add_link() to use a folio (diff) | |
download | linux-f4b830cfceffb05d8feb899fbd28fd592f1bb0ae.tar.xz linux-f4b830cfceffb05d8feb899fbd28fd592f1bb0ae.zip |
ext2: Convert ext2_empty_dir() to use a folio
Save two calls to compound_head() by using the folio API.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <20230921200746.3303942-6-willy@infradead.org>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/dir.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 31333b23adf3..2fc910e99234 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -669,16 +669,16 @@ fail: /* * routine to check that the specified directory is empty (for rmdir) */ -int ext2_empty_dir (struct inode * inode) +int ext2_empty_dir(struct inode *inode) { - struct page *page; + struct folio *folio; char *kaddr; unsigned long i, npages = dir_pages(inode); for (i = 0; i < npages; i++) { ext2_dirent *de; - kaddr = ext2_get_page(inode, i, 0, &page); + kaddr = ext2_get_folio(inode, i, 0, &folio); if (IS_ERR(kaddr)) return 0; @@ -707,12 +707,12 @@ int ext2_empty_dir (struct inode * inode) } de = ext2_next_entry(de); } - ext2_put_page(page, kaddr); + folio_release_kmap(folio, kaddr); } return 1; not_empty: - ext2_put_page(page, kaddr); + folio_release_kmap(folio, kaddr); return 0; } |