minix.h (2d8ad8719591fa803b0d589ed057fa46f49b7155) | minix.h (61f2e7b0f474225b4226772830ae4b29a3a21f8d) |
---|---|
1#ifndef FS_MINIX_H 2#define FS_MINIX_H 3 4#include <linux/fs.h> 5#include <linux/pagemap.h> 6#include <linux/minix_fs.h> 7 8#define INODE_VERSION(inode) minix_sb(inode->i_sb)->s_version --- 74 unchanged lines hidden (view full) --- 83 return sb->s_fs_info; 84} 85 86static inline struct minix_inode_info *minix_i(struct inode *inode) 87{ 88 return list_entry(inode, struct minix_inode_info, vfs_inode); 89} 90 | 1#ifndef FS_MINIX_H 2#define FS_MINIX_H 3 4#include <linux/fs.h> 5#include <linux/pagemap.h> 6#include <linux/minix_fs.h> 7 8#define INODE_VERSION(inode) minix_sb(inode->i_sb)->s_version --- 74 unchanged lines hidden (view full) --- 83 return sb->s_fs_info; 84} 85 86static inline struct minix_inode_info *minix_i(struct inode *inode) 87{ 88 return list_entry(inode, struct minix_inode_info, vfs_inode); 89} 90 |
91#if defined(CONFIG_MINIX_FS_NATIVE_ENDIAN) && \ 92 defined(CONFIG_MINIX_FS_BIG_ENDIAN_16BIT_INDEXED) 93 94#error Minix file system byte order broken 95 96#elif defined(CONFIG_MINIX_FS_NATIVE_ENDIAN) 97 98/* 99 * big-endian 32 or 64 bit indexed bitmaps on big-endian system or 100 * little-endian bitmaps on little-endian system 101 */ 102 103#define minix_test_and_set_bit(nr, addr) \ 104 __test_and_set_bit((nr), (unsigned long *)(addr)) 105#define minix_set_bit(nr, addr) \ 106 __set_bit((nr), (unsigned long *)(addr)) 107#define minix_test_and_clear_bit(nr, addr) \ 108 __test_and_clear_bit((nr), (unsigned long *)(addr)) 109#define minix_test_bit(nr, addr) \ 110 test_bit((nr), (unsigned long *)(addr)) 111#define minix_find_first_zero_bit(addr, size) \ 112 find_first_zero_bit((unsigned long *)(addr), (size)) 113 114#elif defined(CONFIG_MINIX_FS_BIG_ENDIAN_16BIT_INDEXED) 115 116/* 117 * big-endian 16bit indexed bitmaps 118 */ 119 120static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size) 121{ 122 const unsigned short *p = vaddr, *addr = vaddr; 123 unsigned short num; 124 125 if (!size) 126 return 0; 127 128 size = (size >> 4) + ((size & 15) > 0); 129 while (*p++ == 0xffff) { 130 if (--size == 0) 131 return (p - addr) << 4; 132 } 133 134 num = *--p; 135 return ((p - addr) << 4) + ffz(num); 136} 137 138#define minix_test_and_set_bit(nr, addr) \ 139 __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr)) 140#define minix_set_bit(nr, addr) \ 141 __set_bit((nr) ^ 16, (unsigned long *)(addr)) 142#define minix_test_and_clear_bit(nr, addr) \ 143 __test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr)) 144 145static inline int minix_test_bit(int nr, const void *vaddr) 146{ 147 const unsigned short *p = vaddr; 148 return (p[nr >> 4] & (1U << (nr & 15))) != 0; 149} 150 151#else 152 153/* 154 * little-endian bitmaps 155 */ 156 157#define minix_test_and_set_bit __test_and_set_bit_le 158#define minix_set_bit __set_bit_le 159#define minix_test_and_clear_bit __test_and_clear_bit_le 160#define minix_test_bit test_bit_le 161#define minix_find_first_zero_bit find_first_zero_bit_le 162 163#endif 164 |
|
91#endif /* FS_MINIX_H */ | 165#endif /* FS_MINIX_H */ |