• Home
  • Raw
  • Download

Lines Matching refs:s

23 static void mark_dirty(struct super_block *s, int remount)  in mark_dirty()  argument
25 if (hpfs_sb(s)->sb_chkdsk && (remount || !sb_rdonly(s))) { in mark_dirty()
28 if ((sb = hpfs_map_sector(s, 17, &bh, 0))) { in mark_dirty()
41 static void unmark_dirty(struct super_block *s) in unmark_dirty() argument
45 if (sb_rdonly(s)) return; in unmark_dirty()
46 sync_blockdev(s->s_bdev); in unmark_dirty()
47 if ((sb = hpfs_map_sector(s, 17, &bh, 0))) { in unmark_dirty()
48 sb->dirty = hpfs_sb(s)->sb_chkdsk > 1 - hpfs_sb(s)->sb_was_error; in unmark_dirty()
49 sb->old_wrote = hpfs_sb(s)->sb_chkdsk >= 2 && !hpfs_sb(s)->sb_was_error; in unmark_dirty()
57 void hpfs_error(struct super_block *s, const char *fmt, ...) in hpfs_error() argument
71 if (!hpfs_sb(s)->sb_was_error) { in hpfs_error()
72 if (hpfs_sb(s)->sb_err == 2) { in hpfs_error()
74 mark_dirty(s, 0); in hpfs_error()
76 } else if (hpfs_sb(s)->sb_err == 1) { in hpfs_error()
77 if (sb_rdonly(s)) in hpfs_error()
81 mark_dirty(s, 0); in hpfs_error()
82 s->s_flags |= SB_RDONLY; in hpfs_error()
84 } else if (sb_rdonly(s)) in hpfs_error()
90 hpfs_sb(s)->sb_was_error = 1; in hpfs_error()
101 int hpfs_stop_cycles(struct super_block *s, int key, int *c1, int *c2, in hpfs_stop_cycles() argument
105 hpfs_error(s, "cycle detected on key %08x in %s", key, msg); in hpfs_stop_cycles()
125 static void hpfs_put_super(struct super_block *s) in hpfs_put_super() argument
127 hpfs_lock(s); in hpfs_put_super()
128 unmark_dirty(s); in hpfs_put_super()
129 hpfs_unlock(s); in hpfs_put_super()
130 call_rcu(&hpfs_sb(s)->rcu, lazy_free_sbi); in hpfs_put_super()
133 static unsigned hpfs_count_one_bitmap(struct super_block *s, secno secno) in hpfs_count_one_bitmap() argument
139 bits = hpfs_map_4sectors(s, secno, &qbh, 0); in hpfs_count_one_bitmap()
147 static unsigned count_bitmaps(struct super_block *s) in count_bitmaps() argument
150 n_bands = (hpfs_sb(s)->sb_fs_size + 0x3fff) >> 14; in count_bitmaps()
153 hpfs_prefetch_bitmap(s, n); in count_bitmaps()
157 hpfs_prefetch_bitmap(s, n + COUNT_RD_AHEAD); in count_bitmaps()
158 c = hpfs_count_one_bitmap(s, le32_to_cpu(hpfs_sb(s)->sb_bmp_dir[n])); in count_bitmaps()
165 unsigned hpfs_get_free_dnodes(struct super_block *s) in hpfs_get_free_dnodes() argument
167 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_get_free_dnodes()
169 unsigned c = hpfs_count_one_bitmap(s, sbi->sb_dmap); in hpfs_get_free_dnodes()
179 struct super_block *s = dentry->d_sb; in hpfs_statfs() local
180 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_statfs()
181 u64 id = huge_encode_dev(s->s_bdev->bd_dev); in hpfs_statfs()
183 hpfs_lock(s); in hpfs_statfs()
186 sbi->sb_n_free = count_bitmaps(s); in hpfs_statfs()
188 buf->f_type = s->s_magic; in hpfs_statfs()
194 buf->f_ffree = hpfs_get_free_dnodes(s); in hpfs_statfs()
198 hpfs_unlock(s); in hpfs_statfs()
442 static int hpfs_remount_fs(struct super_block *s, int *flags, char *data) in hpfs_remount_fs() argument
449 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_remount_fs()
451 sync_filesystem(s); in hpfs_remount_fs()
455 hpfs_lock(s); in hpfs_remount_fs()
476 unmark_dirty(s); in hpfs_remount_fs()
484 if (!(*flags & SB_RDONLY)) mark_dirty(s, 1); in hpfs_remount_fs()
486 hpfs_unlock(s); in hpfs_remount_fs()
490 hpfs_unlock(s); in hpfs_remount_fs()
537 static int hpfs_fill_super(struct super_block *s, void *options, int silent) in hpfs_fill_super() argument
561 s->s_fs_info = sbi; in hpfs_fill_super()
564 hpfs_lock(s); in hpfs_fill_super()
587 sb_set_blocksize(s, 512); in hpfs_fill_super()
589 if (!(bootblock = hpfs_map_sector(s, 0, &bh0, 0))) goto bail1; in hpfs_fill_super()
590 if (!(superblock = hpfs_map_sector(s, 16, &bh1, 1))) goto bail2; in hpfs_fill_super()
591 if (!(spareblock = hpfs_map_sector(s, 17, &bh2, 0))) goto bail3; in hpfs_fill_super()
603 if (!sb_rdonly(s) && superblock->funcversion != 2 && superblock->funcversion != 3) { in hpfs_fill_super()
610 s->s_flags |= SB_NOATIME; in hpfs_fill_super()
613 s->s_magic = HPFS_SUPER_MAGIC; in hpfs_fill_super()
614 s->s_op = &hpfs_sops; in hpfs_fill_super()
615 s->s_d_op = &hpfs_dentry_operations; in hpfs_fill_super()
616 s->s_time_min = local_to_gmt(s, 0); in hpfs_fill_super()
617 s->s_time_max = local_to_gmt(s, U32_MAX); in hpfs_fill_super()
642 hpfs_error(s, "invalid size in superblock: %08x", in hpfs_fill_super()
648 hpfs_load_hotfix_map(s, spareblock); in hpfs_fill_super()
651 if (!(sbi->sb_bmp_dir = hpfs_load_bitmap_directory(s, le32_to_cpu(superblock->bitmaps)))) in hpfs_fill_super()
660 hpfs_error(s, "improperly stopped"); in hpfs_fill_super()
663 if (!sb_rdonly(s)) { in hpfs_fill_super()
672 mark_dirty(s, 0); in hpfs_fill_super()
675 hpfs_error(s, "warning: spare dnodes used, try chkdsk"); in hpfs_fill_super()
683 …hpfs_error(s, "dir band size mismatch: dir_band_start==%08x, dir_band_end==%08x, n_dir_band==%08x", in hpfs_fill_super()
689 …if (hpfs_chk_sectors(s, le32_to_cpu(superblock->dir_band_start), le32_to_cpu(superblock->n_dir_ban… in hpfs_fill_super()
690 hpfs_chk_sectors(s, le32_to_cpu(superblock->dir_band_bitmap), 4, "dir_band_bitmap") || in hpfs_fill_super()
691 hpfs_chk_sectors(s, le32_to_cpu(superblock->bitmaps), 4, "bitmaps")) { in hpfs_fill_super()
692 mark_dirty(s, 0); in hpfs_fill_super()
701 if (!(sbi->sb_cp_table = hpfs_load_code_page(s, le32_to_cpu(spareblock->code_page_dir)))) in hpfs_fill_super()
708 root = iget_locked(s, sbi->sb_root); in hpfs_fill_super()
714 s->s_root = d_make_root(root); in hpfs_fill_super()
715 if (!s->s_root) in hpfs_fill_super()
722 root_dno = hpfs_fnode_dno(s, sbi->sb_root); in hpfs_fill_super()
726 hpfs_error(s, "unable to find root dir"); in hpfs_fill_super()
728 root->i_atime.tv_sec = local_to_gmt(s, le32_to_cpu(de->read_date)); in hpfs_fill_super()
730 root->i_mtime.tv_sec = local_to_gmt(s, le32_to_cpu(de->write_date)); in hpfs_fill_super()
732 root->i_ctime.tv_sec = local_to_gmt(s, le32_to_cpu(de->creation_date)); in hpfs_fill_super()
742 hpfs_unlock(s); in hpfs_fill_super()
750 hpfs_unlock(s); in hpfs_fill_super()