orangefs_bufmap_..._query(): don't bother with refcounts
... just hold the spinlock while fetching the field in question. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
This commit is contained in:
parent
05b39a8b5c
commit
178041848a
1 changed files with 8 additions and 8 deletions
|
@ -91,11 +91,11 @@ int orangefs_bufmap_size_query(void)
|
||||||
{
|
{
|
||||||
struct orangefs_bufmap *bufmap;
|
struct orangefs_bufmap *bufmap;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
bufmap = orangefs_bufmap_ref();
|
spin_lock(&orangefs_bufmap_lock);
|
||||||
if (bufmap) {
|
bufmap = __orangefs_bufmap;
|
||||||
|
if (bufmap)
|
||||||
size = bufmap->desc_size;
|
size = bufmap->desc_size;
|
||||||
orangefs_bufmap_unref(bufmap);
|
spin_unlock(&orangefs_bufmap_lock);
|
||||||
}
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,11 +103,11 @@ int orangefs_bufmap_shift_query(void)
|
||||||
{
|
{
|
||||||
struct orangefs_bufmap *bufmap;
|
struct orangefs_bufmap *bufmap;
|
||||||
int shift = 0;
|
int shift = 0;
|
||||||
bufmap = orangefs_bufmap_ref();
|
spin_lock(&orangefs_bufmap_lock);
|
||||||
if (bufmap) {
|
bufmap = __orangefs_bufmap;
|
||||||
|
if (bufmap)
|
||||||
shift = bufmap->desc_shift;
|
shift = bufmap->desc_shift;
|
||||||
orangefs_bufmap_unref(bufmap);
|
spin_unlock(&orangefs_bufmap_lock);
|
||||||
}
|
|
||||||
return shift;
|
return shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue