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

Lines Matching refs:sec

11 static int hpfs_alloc_if_possible_nolock(struct super_block *s, secno sec);
18 static int chk_if_allocated(struct super_block *s, secno sec, char *msg)
22 if (!(bmp = hpfs_map_bitmap(s, sec >> 14, &qbh, "chk"))) goto fail;
23 if ((bmp[(sec & 0x3fff) >> 5] >> (sec & 0x1f)) & 1) {
24 hpfs_error(s, "sector '%s' - %08x not allocated in bitmap", msg, sec);
28 if (sec >= hpfs_sb(s)->sb_dirband_start && sec < hpfs_sb(s)->sb_dirband_start + hpfs_sb(s)->sb_dirband_size) {
29 unsigned ssec = (sec - hpfs_sb(s)->sb_dirband_start) / 4;
32 hpfs_error(s, "sector '%s' - %08x not allocated in directory bitmap", msg, sec);
160 secno sec;
173 if ((sec = alloc_in_bmp(s, near, n, f_p ? forward : forward/4))) goto ret;
178 if ((sec = alloc_in_bmp(s, b<<14, n, f_p ? forward : forward/2))) {
182 if (b > 0x10000000) if ((sec = alloc_in_bmp(s, (b&0xfffffff)<<14, n, f_p ? forward : 0))) goto ret;
187 if (near_bmp+i < n_bmps && ((sec = alloc_in_bmp(s, (near_bmp+i) << 14, n, forward)))) {
192 if (near_bmp-i-1 >= 0 && ((sec = alloc_in_bmp(s, (near_bmp-i-1) << 14, n, forward)))) {
197 if (near_bmp+i >= n_bmps && ((sec = alloc_in_bmp(s, (near_bmp+i-n_bmps) << 14, n, forward)))) {
202 if (i == 1 && sbi->sb_c_bitmap != -1 && ((sec = alloc_in_bmp(s, (sbi->sb_c_bitmap) << 14, n, forward)))) {
213 sec = 0;
215 if (sec && f_p) {
217 if (!hpfs_alloc_if_possible_nolock(s, sec + i + 1)) {
218 hpfs_error(s, "Prealloc doesn't work! Wanted %d, allocated at %08x, can't allocate %d", forward, sec, i);
219 sec = 0;
225 return sec;
231 secno sec;
240 sec = alloc_in_bmp(s, (~0x3fff) | nr, 1, 0);
242 if (!sec) return 0;
243 return ((sec & 0x3fff) << 2) + sbi->sb_dirband_start;
248 static int hpfs_alloc_if_possible_nolock(struct super_block *s, secno sec)
253 if (!(bmp = hpfs_map_bitmap(s, sec >> 14, &qbh, "aip"))) goto end;
254 if (bmp[(sec & 0x3fff) >> 5] & (1 << (sec & 0x1f))) {
255 bmp[(sec & 0x3fff) >> 5] &= ~(1 << (sec & 0x1f));
267 int hpfs_alloc_if_possible(struct super_block *s, secno sec)
271 r = hpfs_alloc_if_possible_nolock(s, sec);
278 void hpfs_free_sectors(struct super_block *s, secno sec, unsigned n)
285 if (sec < 0x12) {
286 hpfs_error(s, "Trying to free reserved sector %08x", sec);
293 if (!(bmp = hpfs_map_bitmap(s, sec >> 14, &qbh, "free"))) {
298 if ((bmp[(sec & 0x3fff) >> 5] >> (sec & 0x1f) & 1)) {
299 hpfs_error(s, "sector %08x not allocated", sec);
304 bmp[(sec & 0x3fff) >> 5] |= 1 << (sec & 0x1f);
311 if (!(++sec & 0x3fff)) {