Lines Matching defs:sbi
150 static inline bool is_fat12(const struct msdos_sb_info *sbi)
152 return sbi->fat_bits == 12;
155 static inline bool is_fat16(const struct msdos_sb_info *sbi)
157 return sbi->fat_bits == 16;
160 static inline bool is_fat32(const struct msdos_sb_info *sbi)
162 return sbi->fat_bits == 32;
168 struct msdos_sb_info *sbi = MSDOS_SB(sb);
170 return is_fat32(sbi) ? MAX_FAT32 :
171 is_fat16(sbi) ? MAX_FAT16 : MAX_FAT12;
183 * If it's directory and !sbi->options.rodir, ATTR_RO isn't read-only
188 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
192 if (!sbi->options.rodir)
194 mask = ~sbi->options.fs_dmask;
196 mask = ~sbi->options.fs_fmask;
204 static inline umode_t fat_make_mode(struct msdos_sb_info *sbi,
207 if (attrs & ATTR_RO && !((attrs & ATTR_DIR) && !sbi->options.rodir))
211 return (mode & ~sbi->options.fs_dmask) | S_IFDIR;
213 return (mode & ~sbi->options.fs_fmask) | S_IFREG;
246 static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus)
248 return ((sector_t)clus - FAT_START_ENT) * sbi->sec_per_clus
249 + sbi->data_start;
252 static inline void fat_get_blknr_offset(struct msdos_sb_info *sbi,
255 *blknr = i_pos >> sbi->dir_per_block_bits;
256 *offset = i_pos & (sbi->dir_per_block - 1);
259 static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
264 spin_lock(&sbi->inode_hash_lock);
268 spin_unlock(&sbi->inode_hash_lock);
285 static inline int fat_get_start(const struct msdos_sb_info *sbi,
289 if (is_fat32(sbi))
380 static inline bool fat_valid_entry(struct msdos_sb_info *sbi, int entry)
382 return FAT_START_ENT <= entry && entry < sbi->max_cluster;
453 extern void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec64 *ts,
455 extern void fat_time_unix2fat(struct msdos_sb_info *sbi, struct timespec64 *ts,
457 extern struct timespec64 fat_truncate_atime(const struct msdos_sb_info *sbi,
459 extern struct timespec64 fat_truncate_mtime(const struct msdos_sb_info *sbi,