Skip to content

Commit

Permalink
orangefs_bufmap_..._query(): don't bother with refcounts
Browse files Browse the repository at this point in the history
... just hold the spinlock while fetching the field in question.

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Mike Marshall <[email protected]>
  • Loading branch information
Al Viro authored and hubcapsc committed Feb 19, 2016
1 parent 05b39a8 commit 1780418
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions fs/orangefs/orangefs-bufmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,23 @@ int orangefs_bufmap_size_query(void)
{
struct orangefs_bufmap *bufmap;
int size = 0;
bufmap = orangefs_bufmap_ref();
if (bufmap) {
spin_lock(&orangefs_bufmap_lock);
bufmap = __orangefs_bufmap;
if (bufmap)
size = bufmap->desc_size;
orangefs_bufmap_unref(bufmap);
}
spin_unlock(&orangefs_bufmap_lock);
return size;
}

int orangefs_bufmap_shift_query(void)
{
struct orangefs_bufmap *bufmap;
int shift = 0;
bufmap = orangefs_bufmap_ref();
if (bufmap) {
spin_lock(&orangefs_bufmap_lock);
bufmap = __orangefs_bufmap;
if (bufmap)
shift = bufmap->desc_shift;
orangefs_bufmap_unref(bufmap);
}
spin_unlock(&orangefs_bufmap_lock);
return shift;
}

Expand Down

0 comments on commit 1780418

Please sign in to comment.