Skip to content
Commit 782b76d7 authored by Ira Weiny's avatar Ira Weiny Committed by Jan Kara
Browse files

fs/ext2: Replace kmap() with kmap_local_page()

The k[un]map() calls in ext2_[get|put]_page() are localized to a single
thread.  kmap_local_page() is more efficient.

Replace the kmap/kunmap calls with kmap_local_page()/kunmap_local().
kunmap_local() requires the mapping address so return that address from
ext2_get_page() to be used in ext2_put_page().  This works well because
many of the callers need the address anyway so it is not bad to return
it along with the page.

In addition, kmap_local_page()/kunmap_local() require strict nesting
rules to be followed.

Document the new nesting requirements of ext2_get_page() and
ext2_put_page() as well as the relationship between ext2_get_page(),
ext2_find_entry(), and ext2_dotdot().

Adjust one ext2_put_page() call site in ext2_rename() to ensure the new
nesting requirements are met.

Finally, adjust code style for checkpatch.

To: Jan Kara <jack@suse.com>
Link: https://lore.kernel.org/r/20210329065402.3297092-3-ira.weiny@intel.com


Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent e2ebb123
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment