diff options
author | Ross Zwisler <ross.zwisler@linux.intel.com> | 2016-11-08 11:33:44 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-11-08 11:33:44 +1100 |
commit | 422476c4641ec65906406f3d266b69a91dd3170c (patch) | |
tree | 2c519c1dcca3c877b91c0166fe0812b10b944915 /fs/dax.c | |
parent | fa28f7296a7ce38ed15dc06bd2149e04c8db9d4b (diff) | |
download | talos-obmc-linux-422476c4641ec65906406f3d266b69a91dd3170c.tar.gz talos-obmc-linux-422476c4641ec65906406f3d266b69a91dd3170c.zip |
dax: move put_(un)locked_mapping_entry() in dax.c
No functional change.
The static functions put_locked_mapping_entry() and
put_unlocked_mapping_entry() will soon be used in error cases in
grab_mapping_entry(), so move their definitions above this function.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/dax.c')
-rw-r--r-- | fs/dax.c | 50 |
1 files changed, 25 insertions, 25 deletions
@@ -382,6 +382,31 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping, } } +static void put_locked_mapping_entry(struct address_space *mapping, + pgoff_t index, void *entry) +{ + if (!radix_tree_exceptional_entry(entry)) { + unlock_page(entry); + put_page(entry); + } else { + dax_unlock_mapping_entry(mapping, index); + } +} + +/* + * Called when we are done with radix tree entry we looked up via + * get_unlocked_mapping_entry() and which we didn't lock in the end. + */ +static void put_unlocked_mapping_entry(struct address_space *mapping, + pgoff_t index, void *entry) +{ + if (!radix_tree_exceptional_entry(entry)) + return; + + /* We have to wake up next waiter for the radix tree entry lock */ + dax_wake_mapping_entry_waiter(mapping, index, entry, false); +} + /* * Find radix tree entry at given index. If it points to a page, return with * the page locked. If it points to the exceptional entry, return with the @@ -486,31 +511,6 @@ void dax_unlock_mapping_entry(struct address_space *mapping, pgoff_t index) dax_wake_mapping_entry_waiter(mapping, index, entry, false); } -static void put_locked_mapping_entry(struct address_space *mapping, - pgoff_t index, void *entry) -{ - if (!radix_tree_exceptional_entry(entry)) { - unlock_page(entry); - put_page(entry); - } else { - dax_unlock_mapping_entry(mapping, index); - } -} - -/* - * Called when we are done with radix tree entry we looked up via - * get_unlocked_mapping_entry() and which we didn't lock in the end. - */ -static void put_unlocked_mapping_entry(struct address_space *mapping, - pgoff_t index, void *entry) -{ - if (!radix_tree_exceptional_entry(entry)) - return; - - /* We have to wake up next waiter for the radix tree entry lock */ - dax_wake_mapping_entry_waiter(mapping, index, entry, false); -} - /* * Delete exceptional DAX entry at @index from @mapping. Wait for radix tree * entry to get unlocked before deleting it. |