Commit e3ad61c6 authored by Ross Zwisler's avatar Ross Zwisler Committed by Dave Chinner

dax: consistent variable naming for DAX entries

No functional change.

Consistently use the variable name 'entry' instead of 'ret' for DAX radix
tree entries.  This was already happening in most of the code, so update
get_unlocked_mapping_entry(), grab_mapping_entry() and
dax_unlock_mapping_entry().
Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent aada54f9
...@@ -357,7 +357,7 @@ static inline void *unlock_slot(struct address_space *mapping, void **slot) ...@@ -357,7 +357,7 @@ static inline void *unlock_slot(struct address_space *mapping, void **slot)
static void *get_unlocked_mapping_entry(struct address_space *mapping, static void *get_unlocked_mapping_entry(struct address_space *mapping,
pgoff_t index, void ***slotp) pgoff_t index, void ***slotp)
{ {
void *ret, **slot; void *entry, **slot;
struct wait_exceptional_entry_queue ewait; struct wait_exceptional_entry_queue ewait;
wait_queue_head_t *wq = dax_entry_waitqueue(mapping, index); wait_queue_head_t *wq = dax_entry_waitqueue(mapping, index);
...@@ -367,13 +367,13 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping, ...@@ -367,13 +367,13 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
ewait.key.index = index; ewait.key.index = index;
for (;;) { for (;;) {
ret = __radix_tree_lookup(&mapping->page_tree, index, NULL, entry = __radix_tree_lookup(&mapping->page_tree, index, NULL,
&slot); &slot);
if (!ret || !radix_tree_exceptional_entry(ret) || if (!entry || !radix_tree_exceptional_entry(entry) ||
!slot_locked(mapping, slot)) { !slot_locked(mapping, slot)) {
if (slotp) if (slotp)
*slotp = slot; *slotp = slot;
return ret; return entry;
} }
prepare_to_wait_exclusive(wq, &ewait.wait, prepare_to_wait_exclusive(wq, &ewait.wait,
TASK_UNINTERRUPTIBLE); TASK_UNINTERRUPTIBLE);
...@@ -396,13 +396,13 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping, ...@@ -396,13 +396,13 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
*/ */
static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index) static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index)
{ {
void *ret, **slot; void *entry, **slot;
restart: restart:
spin_lock_irq(&mapping->tree_lock); spin_lock_irq(&mapping->tree_lock);
ret = get_unlocked_mapping_entry(mapping, index, &slot); entry = get_unlocked_mapping_entry(mapping, index, &slot);
/* No entry for given index? Make sure radix tree is big enough. */ /* No entry for given index? Make sure radix tree is big enough. */
if (!ret) { if (!entry) {
int err; int err;
spin_unlock_irq(&mapping->tree_lock); spin_unlock_irq(&mapping->tree_lock);
...@@ -410,10 +410,10 @@ static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index) ...@@ -410,10 +410,10 @@ static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index)
mapping_gfp_mask(mapping) & ~__GFP_HIGHMEM); mapping_gfp_mask(mapping) & ~__GFP_HIGHMEM);
if (err) if (err)
return ERR_PTR(err); return ERR_PTR(err);
ret = (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY | entry = (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY |
RADIX_DAX_ENTRY_LOCK); RADIX_DAX_ENTRY_LOCK);
spin_lock_irq(&mapping->tree_lock); spin_lock_irq(&mapping->tree_lock);
err = radix_tree_insert(&mapping->page_tree, index, ret); err = radix_tree_insert(&mapping->page_tree, index, entry);
radix_tree_preload_end(); radix_tree_preload_end();
if (err) { if (err) {
spin_unlock_irq(&mapping->tree_lock); spin_unlock_irq(&mapping->tree_lock);
...@@ -425,11 +425,11 @@ static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index) ...@@ -425,11 +425,11 @@ static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index)
/* Good, we have inserted empty locked entry into the tree. */ /* Good, we have inserted empty locked entry into the tree. */
mapping->nrexceptional++; mapping->nrexceptional++;
spin_unlock_irq(&mapping->tree_lock); spin_unlock_irq(&mapping->tree_lock);
return ret; return entry;
} }
/* Normal page in radix tree? */ /* Normal page in radix tree? */
if (!radix_tree_exceptional_entry(ret)) { if (!radix_tree_exceptional_entry(entry)) {
struct page *page = ret; struct page *page = entry;
get_page(page); get_page(page);
spin_unlock_irq(&mapping->tree_lock); spin_unlock_irq(&mapping->tree_lock);
...@@ -442,9 +442,9 @@ static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index) ...@@ -442,9 +442,9 @@ static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index)
} }
return page; return page;
} }
ret = lock_slot(mapping, slot); entry = lock_slot(mapping, slot);
spin_unlock_irq(&mapping->tree_lock); spin_unlock_irq(&mapping->tree_lock);
return ret; return entry;
} }
void dax_wake_mapping_entry_waiter(struct address_space *mapping, void dax_wake_mapping_entry_waiter(struct address_space *mapping,
...@@ -469,11 +469,11 @@ void dax_wake_mapping_entry_waiter(struct address_space *mapping, ...@@ -469,11 +469,11 @@ void dax_wake_mapping_entry_waiter(struct address_space *mapping,
void dax_unlock_mapping_entry(struct address_space *mapping, pgoff_t index) void dax_unlock_mapping_entry(struct address_space *mapping, pgoff_t index)
{ {
void *ret, **slot; void *entry, **slot;
spin_lock_irq(&mapping->tree_lock); spin_lock_irq(&mapping->tree_lock);
ret = __radix_tree_lookup(&mapping->page_tree, index, NULL, &slot); entry = __radix_tree_lookup(&mapping->page_tree, index, NULL, &slot);
if (WARN_ON_ONCE(!ret || !radix_tree_exceptional_entry(ret) || if (WARN_ON_ONCE(!entry || !radix_tree_exceptional_entry(entry) ||
!slot_locked(mapping, slot))) { !slot_locked(mapping, slot))) {
spin_unlock_irq(&mapping->tree_lock); spin_unlock_irq(&mapping->tree_lock);
return; return;
......
Markdown is supported
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