aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dax.c
diff options
context:
space:
mode:
authorRoss Zwisler <ross.zwisler@linux.intel.com>2016-11-07 19:33:44 -0500
committerDave Chinner <david@fromorbit.com>2016-11-07 19:33:44 -0500
commit422476c4641ec65906406f3d266b69a91dd3170c (patch)
tree2c519c1dcca3c877b91c0166fe0812b10b944915 /fs/dax.c
parentfa28f7296a7ce38ed15dc06bd2149e04c8db9d4b (diff)
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.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/fs/dax.c b/fs/dax.c
index c45cc4d8e996..0582c7c2ae40 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -382,6 +382,31 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
382 } 382 }
383} 383}
384 384
385static void put_locked_mapping_entry(struct address_space *mapping,
386 pgoff_t index, void *entry)
387{
388 if (!radix_tree_exceptional_entry(entry)) {
389 unlock_page(entry);
390 put_page(entry);
391 } else {
392 dax_unlock_mapping_entry(mapping, index);
393 }
394}
395
396/*
397 * Called when we are done with radix tree entry we looked up via
398 * get_unlocked_mapping_entry() and which we didn't lock in the end.
399 */
400static void put_unlocked_mapping_entry(struct address_space *mapping,
401 pgoff_t index, void *entry)
402{
403 if (!radix_tree_exceptional_entry(entry))
404 return;
405
406 /* We have to wake up next waiter for the radix tree entry lock */
407 dax_wake_mapping_entry_waiter(mapping, index, entry, false);
408}
409
385/* 410/*
386 * Find radix tree entry at given index. If it points to a page, return with 411 * Find radix tree entry at given index. If it points to a page, return with
387 * the page locked. If it points to the exceptional entry, return with the 412 * 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)
486 dax_wake_mapping_entry_waiter(mapping, index, entry, false); 511 dax_wake_mapping_entry_waiter(mapping, index, entry, false);
487} 512}
488 513
489static void put_locked_mapping_entry(struct address_space *mapping,
490 pgoff_t index, void *entry)
491{
492 if (!radix_tree_exceptional_entry(entry)) {
493 unlock_page(entry);
494 put_page(entry);
495 } else {
496 dax_unlock_mapping_entry(mapping, index);
497 }
498}
499
500/*
501 * Called when we are done with radix tree entry we looked up via
502 * get_unlocked_mapping_entry() and which we didn't lock in the end.
503 */
504static void put_unlocked_mapping_entry(struct address_space *mapping,
505 pgoff_t index, void *entry)
506{
507 if (!radix_tree_exceptional_entry(entry))
508 return;
509
510 /* We have to wake up next waiter for the radix tree entry lock */
511 dax_wake_mapping_entry_waiter(mapping, index, entry, false);
512}
513
514/* 514/*
515 * Delete exceptional DAX entry at @index from @mapping. Wait for radix tree 515 * Delete exceptional DAX entry at @index from @mapping. Wait for radix tree
516 * entry to get unlocked before deleting it. 516 * entry to get unlocked before deleting it.