Lines Matching refs:s
11 __le32 *hpfs_map_dnode_bitmap(struct super_block *s, struct quad_buffer_head *qbh) in hpfs_map_dnode_bitmap() argument
13 return hpfs_map_4sectors(s, hpfs_sb(s)->sb_dmap, qbh, 0); in hpfs_map_dnode_bitmap()
16 __le32 *hpfs_map_bitmap(struct super_block *s, unsigned bmp_block, in hpfs_map_bitmap() argument
21 unsigned n_bands = (hpfs_sb(s)->sb_fs_size + 0x3fff) >> 14; in hpfs_map_bitmap()
22 if (hpfs_sb(s)->sb_chk) if (bmp_block >= n_bands) { in hpfs_map_bitmap()
23 hpfs_error(s, "hpfs_map_bitmap called with bad parameter: %08x at %s", bmp_block, id); in hpfs_map_bitmap()
26 sec = le32_to_cpu(hpfs_sb(s)->sb_bmp_dir[bmp_block]); in hpfs_map_bitmap()
27 if (!sec || sec > hpfs_sb(s)->sb_fs_size-4) { in hpfs_map_bitmap()
28 hpfs_error(s, "invalid bitmap block pointer %08x -> %08x at %s", bmp_block, sec, id); in hpfs_map_bitmap()
31 ret = hpfs_map_4sectors(s, sec, qbh, 4); in hpfs_map_bitmap()
32 if (ret) hpfs_prefetch_bitmap(s, bmp_block + 1); in hpfs_map_bitmap()
36 void hpfs_prefetch_bitmap(struct super_block *s, unsigned bmp_block) in hpfs_prefetch_bitmap() argument
39 unsigned n_bands = (hpfs_sb(s)->sb_fs_size + 0x3fff) >> 14; in hpfs_prefetch_bitmap()
42 to_prefetch = le32_to_cpu(hpfs_sb(s)->sb_bmp_dir[bmp_block]); in hpfs_prefetch_bitmap()
46 next_prefetch = le32_to_cpu(hpfs_sb(s)->sb_bmp_dir[bmp_block + 1]); in hpfs_prefetch_bitmap()
47 hpfs_prefetch_sectors(s, to_prefetch, 4 + 4 * (to_prefetch + 4 == next_prefetch)); in hpfs_prefetch_bitmap()
56 unsigned char *hpfs_load_code_page(struct super_block *s, secno cps) in hpfs_load_code_page() argument
65 struct code_page_directory *cp = hpfs_map_sector(s, cps, &bh, 0); in hpfs_load_code_page()
87 if (!(cpd = hpfs_map_sector(s, cpds, &bh, 0))) return NULL; in hpfs_load_code_page()
111 __le32 *hpfs_load_bitmap_directory(struct super_block *s, secno bmp) in hpfs_load_bitmap_directory() argument
114 int n = (hpfs_sb(s)->sb_fs_size + 0x200000 - 1) >> 21; in hpfs_load_bitmap_directory()
122 __le32 *d = hpfs_map_sector(s, bmp+i, &bh, n - i - 1); in hpfs_load_bitmap_directory()
133 void hpfs_load_hotfix_map(struct super_block *s, struct hpfs_spare_block *spareblock) in hpfs_load_hotfix_map() argument
144 hpfs_error(s, "invalid number of hotfixes: %u, used: %u", n_hotfixes, n_used_hotfixes); in hpfs_load_hotfix_map()
147 if (!(directory = hpfs_map_4sectors(s, le32_to_cpu(spareblock->hotfix_map), &qbh, 0))) { in hpfs_load_hotfix_map()
148 hpfs_error(s, "can't load hotfix map"); in hpfs_load_hotfix_map()
152 hpfs_sb(s)->hotfix_from[i] = le32_to_cpu(directory[i]); in hpfs_load_hotfix_map()
153 hpfs_sb(s)->hotfix_to[i] = le32_to_cpu(directory[n_hotfixes + i]); in hpfs_load_hotfix_map()
155 hpfs_sb(s)->n_hotfixes = n_used_hotfixes; in hpfs_load_hotfix_map()
163 struct fnode *hpfs_map_fnode(struct super_block *s, ino_t ino, struct buffer_head **bhp) in hpfs_map_fnode() argument
166 if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, ino, 1, "fnode")) { in hpfs_map_fnode()
169 if ((fnode = hpfs_map_sector(s, ino, bhp, FNODE_RD_AHEAD))) { in hpfs_map_fnode()
170 if (hpfs_sb(s)->sb_chk) { in hpfs_map_fnode()
174 hpfs_error(s, "bad magic on fnode %08lx", in hpfs_map_fnode()
181 hpfs_error(s, in hpfs_map_fnode()
188 hpfs_error(s, in hpfs_map_fnode()
196 hpfs_error(s, in hpfs_map_fnode()
206 hpfs_error(s, "bad EA in fnode %08lx", in hpfs_map_fnode()
220 struct anode *hpfs_map_anode(struct super_block *s, anode_secno ano, struct buffer_head **bhp) in hpfs_map_anode() argument
223 if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, ano, 1, "anode")) return NULL; in hpfs_map_anode()
224 if ((anode = hpfs_map_sector(s, ano, bhp, ANODE_RD_AHEAD))) in hpfs_map_anode()
225 if (hpfs_sb(s)->sb_chk) { in hpfs_map_anode()
227 hpfs_error(s, "bad magic on anode %08x", ano); in hpfs_map_anode()
231 hpfs_error(s, "self pointer invalid on anode %08x", ano); in hpfs_map_anode()
236 hpfs_error(s, "bad number of nodes in anode %08x", ano); in hpfs_map_anode()
241 hpfs_error(s, "bad first_free pointer in anode %08x", ano); in hpfs_map_anode()
255 struct dnode *hpfs_map_dnode(struct super_block *s, unsigned secno, in hpfs_map_dnode() argument
259 if (hpfs_sb(s)->sb_chk) { in hpfs_map_dnode()
260 if (hpfs_chk_sectors(s, secno, 4, "dnode")) return NULL; in hpfs_map_dnode()
262 hpfs_error(s, "dnode %08x not byte-aligned", secno); in hpfs_map_dnode()
266 if ((dnode = hpfs_map_4sectors(s, secno, qbh, DNODE_RD_AHEAD))) in hpfs_map_dnode()
267 if (hpfs_sb(s)->sb_chk) { in hpfs_map_dnode()
272 hpfs_error(s, "bad magic on dnode %08x", secno); in hpfs_map_dnode()
276 hpfs_error(s, "bad self pointer on dnode %08x self = %08x", secno, le32_to_cpu(dnode->self)); in hpfs_map_dnode()
280 hpfs_error(s, "dnode %08x has first_free == %08x", secno, le32_to_cpu(dnode->first_free)); in hpfs_map_dnode()
286 hpfs_error(s, "bad dirent size in dnode %08x, dirent %03x, last %03x", secno, p, pp); in hpfs_map_dnode()
290 …if (((31 + de->namelen + de->down*4 + 3) & ~3) < le16_to_cpu(de->length) && s->s_flags & MS_RDONLY… in hpfs_map_dnode()
291 …hpfs_error(s, "namelen does not match dirent size in dnode %08x, dirent %03x, last %03x", secno, p… in hpfs_map_dnode()
295 if (hpfs_sb(s)->sb_chk >= 2) b |= 1 << de->down; in hpfs_map_dnode()
297 hpfs_error(s, "bad down pointer in dnode %08x, dirent %03x, last %03x", secno, p, pp); in hpfs_map_dnode()
304 hpfs_error(s, "size on last dirent does not match first_free; dnode %08x", secno); in hpfs_map_dnode()
308 hpfs_error(s, "dnode %08x does not end with \\377 entry", secno); in hpfs_map_dnode()
321 dnode_secno hpfs_fnode_dno(struct super_block *s, ino_t ino) in hpfs_fnode_dno() argument
327 fnode = hpfs_map_fnode(s, ino, &bh); in hpfs_fnode_dno()