fs/ext2: Use ext2_put_page
authorIra Weiny <ira.weiny@intel.com>
Thu, 12 Nov 2020 17:42:44 +0000 (09:42 -0800)
committerJan Kara <jack@suse.cz>
Fri, 13 Nov 2020 10:19:30 +0000 (11:19 +0100)
commita6fbd0ab3d7a1a02e61733a80c22fb01c65819b9
treebf52e9b7de2af835d4066e88569b13a006799dee
parent2356eb80ca42deba0bf2523c62530d4c79dad08f
fs/ext2: Use ext2_put_page

There are 3 places in namei.c where the equivalent of ext2_put_page() is
open coded on a page which was returned from the ext2_get_page() call
[through the use of ext2_find_entry() and ext2_dotdot()].

Move ext2_put_page() to ext2.h and use it in namei.c

Also add a comment regarding the proper way to release the page returned
from ext2_find_entry() and ext2_dotdot().

Link: https://lore.kernel.org/r/20201112174244.701325-1-ira.weiny@intel.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/dir.c
fs/ext2/ext2.h
fs/ext2/namei.c