mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-12 21:41:07 +00:00
Add a little header for inline convenience functions. Signed-off-by: Zach Brown <zab@versity.com>
21 lines
322 B
C
21 lines
322 B
C
#ifndef _SCOUTFS_UTIL_H_
|
|
#define _SCOUTFS_UTIL_H_
|
|
|
|
/*
|
|
* Little utility helpers that probably belong upstream.
|
|
*/
|
|
|
|
static inline void down_write_two(struct rw_semaphore *a,
|
|
struct rw_semaphore *b)
|
|
{
|
|
BUG_ON(a == b);
|
|
|
|
if (a > b)
|
|
swap(a, b);
|
|
|
|
down_write(a);
|
|
down_write_nested(b, SINGLE_DEPTH_NESTING);
|
|
}
|
|
|
|
#endif
|