diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-03-26 04:39:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:57:15 -0500 |
commit | b9a2838cc26c4c5369fbd2482acbc5ab60573479 (patch) | |
tree | 3569c6b2edc1cf11cc2f34ed185b79009a86c620 /fs/ntfs/ntfs.h | |
parent | 55b0f8a68ab475cc68f88d1e7a873490869d022e (diff) |
[PATCH] bitops: ntfs: remove generic_ffs()
Now the only user who are using generic_ffs() is ntfs filesystem. This patch
isolates generic_ffs() as ntfs_ffs() for ntfs.
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Cc: Anton Altaparmakov <aia21@cantab.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ntfs/ntfs.h')
-rw-r--r-- | fs/ntfs/ntfs.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h index 0624c8ef4d9c..166142960b53 100644 --- a/fs/ntfs/ntfs.h +++ b/fs/ntfs/ntfs.h | |||
@@ -132,4 +132,33 @@ extern int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins, | |||
132 | /* From fs/ntfs/upcase.c */ | 132 | /* From fs/ntfs/upcase.c */ |
133 | extern ntfschar *generate_default_upcase(void); | 133 | extern ntfschar *generate_default_upcase(void); |
134 | 134 | ||
135 | static inline int ntfs_ffs(int x) | ||
136 | { | ||
137 | int r = 1; | ||
138 | |||
139 | if (!x) | ||
140 | return 0; | ||
141 | if (!(x & 0xffff)) { | ||
142 | x >>= 16; | ||
143 | r += 16; | ||
144 | } | ||
145 | if (!(x & 0xff)) { | ||
146 | x >>= 8; | ||
147 | r += 8; | ||
148 | } | ||
149 | if (!(x & 0xf)) { | ||
150 | x >>= 4; | ||
151 | r += 4; | ||
152 | } | ||
153 | if (!(x & 3)) { | ||
154 | x >>= 2; | ||
155 | r += 2; | ||
156 | } | ||
157 | if (!(x & 1)) { | ||
158 | x >>= 1; | ||
159 | r += 1; | ||
160 | } | ||
161 | return r; | ||
162 | } | ||
163 | |||
135 | #endif /* _LINUX_NTFS_H */ | 164 | #endif /* _LINUX_NTFS_H */ |