diff options
| author | 2019-11-06 10:52:10 +0100 | |
|---|---|---|
| committer | 2019-11-06 10:52:10 +0100 | |
| commit | dae82c7fd0926840c832151f3258ba751f73d348 (patch) | |
| tree | 5cdef8359f6cfb964919ffb0bfa36d2de60140b1 /include/linux/bitops.h | |
| parent | reiserfs: replace open-coded atomic_dec_and_mutex_lock() (diff) | |
| parent | quota: Handle quotas without quota inodes in dquot_get_state() (diff) | |
Pull series refactoring quota enabling and disabling code.
Diffstat (limited to 'include/linux/bitops.h')
| -rw-r--r-- | include/linux/bitops.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index cf074bce3eb3..c94a9ff9f082 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -4,6 +4,13 @@ #include <asm/types.h> #include <linux/bits.h> +/* Set bits in the first 'n' bytes when loaded from memory */ +#ifdef __LITTLE_ENDIAN +# define aligned_byte_mask(n) ((1UL << 8*(n))-1) +#else +# define aligned_byte_mask(n) (~0xffUL << (BITS_PER_LONG - 8 - 8*(n))) +#endif + #define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(long)) |
