Lines Matching refs:sbi

266 static int __sbi_read_stats(struct exofs_sb_info *sbi)  in __sbi_read_stats()  argument
274 ret = ore_get_io_state(&sbi->layout, &sbi->oc, &ios); in __sbi_read_stats()
305 sbi->s_nextid = le64_to_cpu(ess->s_nextid); in __sbi_read_stats()
306 sbi->s_numfiles = le32_to_cpu(ess->s_numfiles); in __sbi_read_stats()
321 int exofs_sbi_write_stats(struct exofs_sb_info *sbi) in exofs_sbi_write_stats() argument
329 ret = ore_get_io_state(&sbi->layout, &sbi->oc, &ios); in exofs_sbi_write_stats()
335 sbi->s_ess.s_nextid = cpu_to_le64(sbi->s_nextid); in exofs_sbi_write_stats()
336 sbi->s_ess.s_numfiles = cpu_to_le64(sbi->s_numfiles); in exofs_sbi_write_stats()
337 attrs[0].val_ptr = &sbi->s_ess; in exofs_sbi_write_stats()
341 ios->private = sbi; in exofs_sbi_write_stats()
365 struct exofs_sb_info *sbi; in exofs_sync_fs() local
376 sbi = sb->s_fs_info; in exofs_sync_fs()
386 exofs_init_comps(&oc, &one_comp, sbi, EXOFS_SUPER_ID); in exofs_sync_fs()
388 ret = ore_get_io_state(&sbi->layout, &oc, &ios); in exofs_sync_fs()
394 fscb->s_nextid = cpu_to_le64(sbi->s_nextid); in exofs_sync_fs()
395 fscb->s_numfiles = cpu_to_le64(sbi->s_numfiles); in exofs_sync_fs()
408 EXOFS_DBGMSG("s_nextid=0x%llx ret=%d\n", _LLU(sbi->s_nextid), ret); in exofs_sync_fs()
423 static void exofs_free_sbi(struct exofs_sb_info *sbi) in exofs_free_sbi() argument
425 unsigned numdevs = sbi->oc.numdevs; in exofs_free_sbi()
429 struct osd_dev *od = ore_comp_dev(&sbi->oc, i); in exofs_free_sbi()
432 ore_comp_set_dev(&sbi->oc, i, NULL); in exofs_free_sbi()
436 kfree(sbi->oc.ods); in exofs_free_sbi()
437 kfree(sbi); in exofs_free_sbi()
447 struct exofs_sb_info *sbi = sb->s_fs_info; in exofs_put_super() local
450 for (num_pend = atomic_read(&sbi->s_curr_pending); num_pend > 0; in exofs_put_super()
451 num_pend = atomic_read(&sbi->s_curr_pending)) { in exofs_put_super()
459 (atomic_read(&sbi->s_curr_pending) == 0), in exofs_put_super()
463 _exofs_print_device("Unmounting", NULL, ore_comp_dev(&sbi->oc, 0), in exofs_put_super()
464 sbi->one_comp.obj.partition); in exofs_put_super()
466 exofs_sysfs_sb_del(sbi); in exofs_put_super()
467 bdi_destroy(&sbi->bdi); in exofs_put_super()
468 exofs_free_sbi(sbi); in exofs_put_super()
472 static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs, in _read_and_match_data_map() argument
477 sbi->layout.stripe_unit = in _read_and_match_data_map()
479 sbi->layout.group_width = in _read_and_match_data_map()
481 sbi->layout.group_depth = in _read_and_match_data_map()
483 sbi->layout.mirrors_p1 = in _read_and_match_data_map()
485 sbi->layout.raid_algorithm = in _read_and_match_data_map()
488 ret = ore_verify_layout(numdevs, &sbi->layout); in _read_and_match_data_map()
494 sbi->layout.stripe_unit, in _read_and_match_data_map()
495 sbi->layout.group_width, in _read_and_match_data_map()
496 _LLU(sbi->layout.group_depth), in _read_and_match_data_map()
497 sbi->layout.mirrors_p1, in _read_and_match_data_map()
498 sbi->layout.raid_algorithm); in _read_and_match_data_map()
546 static int __alloc_dev_table(struct exofs_sb_info *sbi, unsigned numdevs, in __alloc_dev_table() argument
566 sbi->oc.ods = aoded->oreds; in __alloc_dev_table()
573 static int exofs_read_lookup_dev_table(struct exofs_sb_info *sbi, in exofs_read_lookup_dev_table() argument
592 sbi->oc.numdevs = 0; in exofs_read_lookup_dev_table()
594 comp.obj.partition = sbi->one_comp.obj.partition; in exofs_read_lookup_dev_table()
612 ret = _read_and_match_data_map(sbi, numdevs, dt); in exofs_read_lookup_dev_table()
616 ret = __alloc_dev_table(sbi, numdevs, &eds); in exofs_read_lookup_dev_table()
624 memcpy(&sbi->oc.ods[numdevs], &sbi->oc.ods[0], in exofs_read_lookup_dev_table()
625 (numdevs - 1) * sizeof(sbi->oc.ods[0])); in exofs_read_lookup_dev_table()
631 exofs_sysfs_sb_add(sbi, &dt->dt_dev_table[0]); in exofs_read_lookup_dev_table()
656 ++sbi->oc.numdevs; in exofs_read_lookup_dev_table()
658 exofs_sysfs_odev_add(&eds[i], sbi); in exofs_read_lookup_dev_table()
671 ++sbi->oc.numdevs; in exofs_read_lookup_dev_table()
684 exofs_sysfs_odev_add(&eds[i], sbi); in exofs_read_lookup_dev_table()
709 struct exofs_sb_info *sbi; /*extended info */ in exofs_fill_super() local
716 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in exofs_fill_super()
717 if (!sbi) in exofs_fill_super()
738 sbi->layout.stripe_unit = PAGE_SIZE; in exofs_fill_super()
739 sbi->layout.mirrors_p1 = 1; in exofs_fill_super()
740 sbi->layout.group_width = 1; in exofs_fill_super()
741 sbi->layout.group_depth = -1; in exofs_fill_super()
742 sbi->layout.group_count = 1; in exofs_fill_super()
743 sbi->s_timeout = opts->timeout; in exofs_fill_super()
745 sbi->one_comp.obj.partition = opts->pid; in exofs_fill_super()
746 sbi->one_comp.obj.id = 0; in exofs_fill_super()
747 exofs_make_credential(sbi->one_comp.cred, &sbi->one_comp.obj); in exofs_fill_super()
748 sbi->oc.single_comp = EC_SINGLE_COMP; in exofs_fill_super()
749 sbi->oc.comps = &sbi->one_comp; in exofs_fill_super()
758 atomic_set(&sbi->s_curr_pending, 0); in exofs_fill_super()
762 comp.obj.partition = sbi->one_comp.obj.partition; in exofs_fill_super()
772 sbi->s_nextid = le64_to_cpu(fscb.s_nextid); in exofs_fill_super()
773 sbi->s_numfiles = le32_to_cpu(fscb.s_numfiles); in exofs_fill_super()
790 get_random_bytes(&sbi->s_next_generation, sizeof(u32)); in exofs_fill_super()
791 spin_lock_init(&sbi->s_next_gen_lock); in exofs_fill_super()
795 ret = exofs_read_lookup_dev_table(sbi, od, table_count); in exofs_fill_super()
801 ret = __alloc_dev_table(sbi, 1, &eds); in exofs_fill_super()
805 ore_comp_set_dev(&sbi->oc, 0, od); in exofs_fill_super()
806 sbi->oc.numdevs = 1; in exofs_fill_super()
809 __sbi_read_stats(sbi); in exofs_fill_super()
812 sbi->bdi.ra_pages = __ra_pages(&sbi->layout); in exofs_fill_super()
813 sb->s_bdi = &sbi->bdi; in exofs_fill_super()
814 sb->s_fs_info = sbi; in exofs_fill_super()
839 ret = bdi_setup_and_register(&sbi->bdi, "exofs"); in exofs_fill_super()
849 ore_comp_dev(&sbi->oc, 0), in exofs_fill_super()
850 sbi->one_comp.obj.partition); in exofs_fill_super()
855 opts->dev_name, sbi->one_comp.obj.partition, ret); in exofs_fill_super()
856 exofs_free_sbi(sbi); in exofs_fill_super()
886 struct exofs_sb_info *sbi = sb->s_fs_info; in exofs_statfs() local
898 ret = ore_get_io_state(&sbi->layout, &sbi->oc, &ios); in exofs_statfs()
931 buf->f_files = sbi->s_numfiles; in exofs_statfs()
932 buf->f_ffree = EXOFS_MAX_ID - sbi->s_numfiles; in exofs_statfs()