summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/orangefs/orangefs-bufmap.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c
index 1819dee58433..cd484665bf72 100644
--- a/fs/orangefs/orangefs-bufmap.c
+++ b/fs/orangefs/orangefs-bufmap.c
@@ -91,11 +91,11 @@ 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;
}
@@ -103,11 +103,11 @@ 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;
}