diff options
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, | |||
382 | } | 382 | } |
383 | } | 383 | } |
384 | 384 | ||
385 | static 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 | */ | ||
400 | static 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 | ||
489 | static 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 | */ | ||
504 | static 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. |