Lines Matching refs:sbi
14 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_claim_alloc() local
15 if (sbi->sb_n_free != (unsigned)-1) { in hpfs_claim_alloc()
16 if (unlikely(!sbi->sb_n_free)) { in hpfs_claim_alloc()
18 sbi->sb_n_free = -1; in hpfs_claim_alloc()
21 sbi->sb_n_free--; in hpfs_claim_alloc()
27 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_claim_free() local
28 if (sbi->sb_n_free != (unsigned)-1) { in hpfs_claim_free()
29 if (unlikely(sbi->sb_n_free >= sbi->sb_fs_size)) { in hpfs_claim_free()
31 sbi->sb_n_free = -1; in hpfs_claim_free()
34 sbi->sb_n_free++; in hpfs_claim_free()
40 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_claim_dirband_alloc() local
41 if (sbi->sb_n_free_dnodes != (unsigned)-1) { in hpfs_claim_dirband_alloc()
42 if (unlikely(!sbi->sb_n_free_dnodes)) { in hpfs_claim_dirband_alloc()
44 sbi->sb_n_free_dnodes = -1; in hpfs_claim_dirband_alloc()
47 sbi->sb_n_free_dnodes--; in hpfs_claim_dirband_alloc()
53 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_claim_dirband_free() local
54 if (sbi->sb_n_free_dnodes != (unsigned)-1) { in hpfs_claim_dirband_free()
55 if (unlikely(sbi->sb_n_free_dnodes >= sbi->sb_dirband_size / 4)) { in hpfs_claim_dirband_free()
57 sbi->sb_n_free_dnodes = -1; in hpfs_claim_dirband_free()
60 sbi->sb_n_free_dnodes++; in hpfs_claim_dirband_free()
208 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_alloc_sector() local
215 n_bmps = (sbi->sb_fs_size + 0x4000 - 1) >> 14; in hpfs_alloc_sector()
216 if (near && near < sbi->sb_fs_size) { in hpfs_alloc_sector()
228 if (!f_p) if (forward > sbi->sb_max_fwd_alloc) forward = sbi->sb_max_fwd_alloc; in hpfs_alloc_sector()
232 sbi->sb_c_bitmap = near_bmp+i; in hpfs_alloc_sector()
237 sbi->sb_c_bitmap = near_bmp-i-1; in hpfs_alloc_sector()
242 sbi->sb_c_bitmap = near_bmp+i-n_bmps; in hpfs_alloc_sector()
246 …if (i == 1 && sbi->sb_c_bitmap != -1 && ((sec = alloc_in_bmp(s, (sbi->sb_c_bitmap) << 14, n, forwa… in hpfs_alloc_sector()
252 sbi->sb_max_fwd_alloc = forward * 3 / 4; in hpfs_alloc_sector()
281 struct hpfs_sb_info *sbi = hpfs_sb(s); in alloc_in_dirband() local
282 if (nr < sbi->sb_dirband_start) in alloc_in_dirband()
283 nr = sbi->sb_dirband_start; in alloc_in_dirband()
284 if (nr >= sbi->sb_dirband_start + sbi->sb_dirband_size) in alloc_in_dirband()
285 nr = sbi->sb_dirband_start + sbi->sb_dirband_size - 4; in alloc_in_dirband()
286 nr -= sbi->sb_dirband_start; in alloc_in_dirband()
291 return ((sec & 0x3fff) << 2) + sbi->sb_dirband_start; in alloc_in_dirband()
319 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_free_sectors() local
326 sbi->sb_max_fwd_alloc += n > 0xffff ? 0xffff : n; in hpfs_free_sectors()
327 if (sbi->sb_max_fwd_alloc > 0xffffff) sbi->sb_max_fwd_alloc = 0xffffff; in hpfs_free_sectors()
528 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_trim_fs() local
534 if (!end || end > sbi->sb_fs_size) in hpfs_trim_fs()
535 end = sbi->sb_fs_size; in hpfs_trim_fs()
536 if (start >= sbi->sb_fs_size) in hpfs_trim_fs()
540 if (start < sbi->sb_dirband_start + sbi->sb_dirband_size && end > sbi->sb_dirband_start) { in hpfs_trim_fs()
552 err = do_trim(s, sbi->sb_dirband_start + idx * 4, len * 4, start, end, minlen, result); in hpfs_trim_fs()