aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/ntfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ntfs/ntfs.h')
-rw-r--r--fs/ntfs/ntfs.h29
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 */
133extern ntfschar *generate_default_upcase(void); 133extern ntfschar *generate_default_upcase(void);
134 134
135static 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 */