diff options
Diffstat (limited to 'fs/fat/fat.h')
| -rw-r--r-- | fs/fat/fat.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/fat/fat.h b/fs/fat/fat.h index fc35c5c69136..2deeeb86f331 100644 --- a/fs/fat/fat.h +++ b/fs/fat/fat.h | |||
| @@ -217,6 +217,21 @@ static inline void fat16_towchar(wchar_t *dst, const __u8 *src, size_t len) | |||
| 217 | #endif | 217 | #endif |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | static inline int fat_get_start(const struct msdos_sb_info *sbi, | ||
| 221 | const struct msdos_dir_entry *de) | ||
| 222 | { | ||
| 223 | int cluster = le16_to_cpu(de->start); | ||
| 224 | if (sbi->fat_bits == 32) | ||
| 225 | cluster |= (le16_to_cpu(de->starthi) << 16); | ||
| 226 | return cluster; | ||
| 227 | } | ||
| 228 | |||
| 229 | static inline void fat_set_start(struct msdos_dir_entry *de, int cluster) | ||
| 230 | { | ||
| 231 | de->start = cpu_to_le16(cluster); | ||
| 232 | de->starthi = cpu_to_le16(cluster >> 16); | ||
| 233 | } | ||
| 234 | |||
| 220 | static inline void fatwchar_to16(__u8 *dst, const wchar_t *src, size_t len) | 235 | static inline void fatwchar_to16(__u8 *dst, const wchar_t *src, size_t len) |
| 221 | { | 236 | { |
| 222 | #ifdef __BIG_ENDIAN | 237 | #ifdef __BIG_ENDIAN |
