• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/fat/

Lines Matching refs:sbi

27 	struct msdos_sb_info *sbi = MSDOS_SB(sb);
29 WARN_ON(entry < FAT_START_ENT || sbi->max_cluster <= entry);
31 *blocknr = sbi->fat_start + (bytes >> sb->s_blocksize_bits);
37 struct msdos_sb_info *sbi = MSDOS_SB(sb);
38 int bytes = (entry << sbi->fatent_shift);
39 WARN_ON(entry < FAT_START_ENT || sbi->max_cluster <= entry);
41 *blocknr = sbi->fat_start + (bytes >> sb->s_blocksize_bits);
279 static inline void lock_fat(struct msdos_sb_info *sbi)
281 mutex_lock(&sbi->fat_lock);
284 static inline void unlock_fat(struct msdos_sb_info *sbi)
286 mutex_unlock(&sbi->fat_lock);
291 struct msdos_sb_info *sbi = MSDOS_SB(sb);
293 mutex_init(&sbi->fat_lock);
295 switch (sbi->fat_bits) {
297 sbi->fatent_shift = 2;
298 sbi->fatent_ops = &fat32_ops;
301 sbi->fatent_shift = 1;
302 sbi->fatent_ops = &fat16_ops;
305 sbi->fatent_shift = -1;
306 sbi->fatent_ops = &fat12_ops;
315 struct msdos_sb_info *sbi = MSDOS_SB(sb);
316 struct fatent_operations *ops = sbi->fatent_ops;
322 if (sbi->fat_bits == 12) {
344 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
345 struct fatent_operations *ops = sbi->fatent_ops;
349 if (entry < FAT_START_ENT || sbi->max_cluster <= entry) {
370 struct msdos_sb_info *sbi = MSDOS_SB(sb);
375 for (copy = 1; copy < sbi->fats; copy++) {
376 sector_t backup_fat = sbi->fat_length * copy;
386 mark_buffer_dirty_inode(c_bh, sbi->fat_inode);
414 static inline int fat_ent_next(struct msdos_sb_info *sbi,
417 if (sbi->fatent_ops->ent_next(fatent)) {
418 if (fatent->entry < sbi->max_cluster)
457 struct msdos_sb_info *sbi = MSDOS_SB(sb);
458 struct fatent_operations *ops = sbi->fatent_ops;
465 lock_fat(sbi);
466 if (sbi->free_clusters != -1 && sbi->free_clus_valid &&
467 sbi->free_clusters < nr_cluster) {
468 unlock_fat(sbi);
476 fatent_set_entry(&fatent, sbi->prev_free + 1);
477 while (count < sbi->max_cluster) {
478 if (fatent.entry >= sbi->max_cluster)
497 sbi->prev_free = entry;
498 if (sbi->free_clusters != -1)
499 sbi->free_clusters--;
514 if (count == sbi->max_cluster)
516 } while (fat_ent_next(sbi, &fatent));
520 sbi->free_clusters = 0;
521 sbi->free_clus_valid = 1;
526 unlock_fat(sbi);
546 struct msdos_sb_info *sbi = MSDOS_SB(sb);
547 struct fatent_operations *ops = sbi->fatent_ops;
555 lock_fat(sbi);
568 if (sbi->options.discard) {
578 fat_clus_to_blknr(sbi, first_cl),
579 nr_clus * sbi->sec_per_clus);
586 if (sbi->free_clusters != -1) {
587 sbi->free_clusters++;
617 unlock_fat(sbi);
642 struct msdos_sb_info *sbi = MSDOS_SB(sb);
643 struct fatent_operations *ops = sbi->fatent_ops;
648 lock_fat(sbi);
649 if (sbi->free_clusters != -1 && sbi->free_clus_valid)
659 while (fatent.entry < sbi->max_cluster) {
662 unsigned long rest = sbi->fat_length - cur_block;
674 } while (fat_ent_next(sbi, &fatent));
676 sbi->free_clusters = free;
677 sbi->free_clus_valid = 1;
681 unlock_fat(sbi);