Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17804184 authored by Al Viro's avatar Al Viro Committed by Mike Marshall
Browse files

orangefs_bufmap_..._query(): don't bother with refcounts



... just hold the spinlock while fetching the field in question.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent 05b39a8b
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -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;
}
}