diff options
author | attilio <attilio@FreeBSD.org> | 2013-03-02 15:33:54 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-03-02 15:33:54 +0000 |
commit | 44df97db57f445ae083991d3b0923763985673d5 (patch) | |
tree | f2c251656791e363e72e4f525b14deaebd0f6c29 /sys/gnu/fs/xfs/FreeBSD/support/atomic.h | |
parent | 4b0353fc07e5e0a054a50bb98e473e42ae9c961d (diff) | |
download | FreeBSD-src-44df97db57f445ae083991d3b0923763985673d5.zip FreeBSD-src-44df97db57f445ae083991d3b0923763985673d5.tar.gz |
Garbage collect XFS bits which are now already completely disconnected
from the tree since few months.
This is not targeted for MFC.
Diffstat (limited to 'sys/gnu/fs/xfs/FreeBSD/support/atomic.h')
-rw-r--r-- | sys/gnu/fs/xfs/FreeBSD/support/atomic.h | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/sys/gnu/fs/xfs/FreeBSD/support/atomic.h b/sys/gnu/fs/xfs/FreeBSD/support/atomic.h deleted file mode 100644 index 618de8c..0000000 --- a/sys/gnu/fs/xfs/FreeBSD/support/atomic.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef __XFS_SUPPORT_ATOMIC_H__ - -#include <sys/types.h> -#include <machine/atomic.h> - -typedef struct { - volatile unsigned int val; -} atomic_t; - -#define atomic_read(v) ((v)->val) -#define atomic_set(v, i) ((v)->val = (i)) - -#define atomic_add(i, v) atomic_add_int(&(v)->val, (i)) -#define atomic_inc(v) atomic_add_int(&(v)->val, 1) -#define atomic_dec(v) atomic_subtract_int(&(v)->val, 1) -#define atomic_sub(i, v) atomic_subtract_int(&(v)->val, (i)) -#define atomic_dec_and_test(v) (atomic_fetchadd_int(&(v)->val, -1) == 1) - -/* - * This is used for two variables in XFS, one of which is a debug trace - * buffer index. - */ - -static __inline__ int atomicIncWithWrap(volatile unsigned int *ip, int val) -{ - unsigned int oldval, newval; - - do { - oldval = *ip; - newval = (oldval + 1 >= val) ? 0 : oldval + 1; - } while (atomic_cmpset_rel_int(ip, oldval, newval) == 0); - - return oldval; -} - -#endif /* __XFS_SUPPORT_ATOMIC_H__ */ |