Lines Matching refs:osb
95 static void ocfs2_delete_osb(struct ocfs2_super *osb);
101 static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb);
102 static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb);
103 static void ocfs2_release_system_inodes(struct ocfs2_super *osb);
104 static int ocfs2_check_volume(struct ocfs2_super *osb);
119 static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend);
120 static int ocfs2_enable_quotas(struct ocfs2_super *osb);
121 static void ocfs2_disable_quotas(struct ocfs2_super *osb);
216 static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len)
218 struct ocfs2_cluster_connection *cconn = osb->cconn;
219 struct ocfs2_recovery_map *rm = osb->recovery_map;
220 struct ocfs2_orphan_scan *os = &osb->osb_orphan_scan;
226 "Device", osb->dev_str, osb->uuid_str,
227 osb->fs_generation, osb->vol_label);
231 atomic_read(&osb->vol_state), osb->osb_flags);
235 osb->sb->s_blocksize, osb->s_clustersize);
240 "Features", osb->s_feature_compat,
241 osb->s_feature_incompat, osb->s_feature_ro_compat);
245 osb->s_mount_opt, osb->s_atime_quantum);
251 (*osb->osb_cluster_stack == '\0' ?
252 "o2cb" : osb->osb_cluster_stack),
258 spin_lock_irqsave(&osb->dc_task_lock, flags);
262 (osb->dc_task ? task_pid_nr(osb->dc_task) : -1),
263 osb->blocked_lock_count, osb->dc_wake_sequence,
264 osb->dc_work_sequence);
265 spin_unlock_irqrestore(&osb->dc_task_lock, flags);
267 spin_lock(&osb->osb_lock);
270 (osb->recovery_thread_task ?
271 task_pid_nr(osb->recovery_thread_task) : -1));
280 spin_unlock(&osb->osb_lock);
284 (osb->commit_task ? task_pid_nr(osb->commit_task) : -1),
285 osb->osb_commit_interval);
289 "Journal", osb->journal->j_state,
290 osb->journal->j_trans_id,
291 atomic_read(&osb->journal->j_num_trans));
297 atomic_read(&osb->alloc_stats.bitmap_data),
298 atomic_read(&osb->alloc_stats.local_data),
299 atomic_read(&osb->alloc_stats.bg_allocs),
300 atomic_read(&osb->alloc_stats.moves),
301 atomic_read(&osb->alloc_stats.bg_extends));
306 "LocalAlloc", osb->local_alloc_state,
307 (unsigned long long)osb->la_last_gd,
308 osb->local_alloc_bits, osb->local_alloc_default_bits);
310 spin_lock(&osb->osb_lock);
314 osb->s_inode_steal_slot,
315 atomic_read(&osb->s_num_inodes_stolen),
316 osb->s_meta_steal_slot,
317 atomic_read(&osb->s_num_meta_stolen));
318 spin_unlock(&osb->osb_lock);
332 for (i = 0; i < osb->max_slots; ++i) {
336 (i == osb->slot_num ? '*' : ' '),
337 i, osb->slot_recovery_generations[i]);
345 struct ocfs2_super *osb = inode->i_private;
352 i_size_write(inode, ocfs2_osb_dump(osb, buf, PAGE_SIZE));
400 struct ocfs2_super *osb = OCFS2_SB(sb);
402 if (ocfs2_is_hard_readonly(osb))
406 status = ocfs2_flush_truncate_log(osb);
410 ocfs2_schedule_truncate_log_flush(osb, 0);
413 if (jbd2_journal_start_commit(osb->journal->j_journal,
416 jbd2_log_wait_commit(osb->journal->j_journal,
422 static int ocfs2_need_system_inode(struct ocfs2_super *osb, int ino)
424 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_USRQUOTA)
428 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)
435 static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb)
441 new = ocfs2_iget(osb, osb->root_blkno, OCFS2_FI_FLAG_SYSFILE, 0);
447 osb->root_inode = new;
449 new = ocfs2_iget(osb, osb->system_dir_blkno, OCFS2_FI_FLAG_SYSFILE, 0);
455 osb->sys_root_inode = new;
459 if (!ocfs2_need_system_inode(osb, i))
461 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
463 ocfs2_release_system_inodes(osb);
464 status = ocfs2_is_soft_readonly(osb) ? -EROFS : -EINVAL;
480 static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb)
489 if (!ocfs2_need_system_inode(osb, i))
491 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
493 ocfs2_release_system_inodes(osb);
494 status = ocfs2_is_soft_readonly(osb) ? -EROFS : -EINVAL;
496 status, i, osb->slot_num);
509 static void ocfs2_release_system_inodes(struct ocfs2_super *osb)
515 inode = osb->global_system_inodes[i];
518 osb->global_system_inodes[i] = NULL;
522 inode = osb->sys_root_inode;
525 osb->sys_root_inode = NULL;
528 inode = osb->root_inode;
531 osb->root_inode = NULL;
534 if (!osb->local_system_inodes)
537 for (i = 0; i < NUM_LOCAL_SYSTEM_INODES * osb->max_slots; i++) {
538 if (osb->local_system_inodes[i]) {
539 iput(osb->local_system_inodes[i]);
540 osb->local_system_inodes[i] = NULL;
544 kfree(osb->local_system_inodes);
545 osb->local_system_inodes = NULL;
613 struct ocfs2_super *osb = OCFS2_SB(sb);
625 if ((osb->s_mount_opt & tmp) != (parsed_options->mount_opt & tmp)) {
631 if ((osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK) !=
640 if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64) &&
651 ret = ocfs2_susp_quotas(osb, 0);
657 spin_lock(&osb->osb_lock);
658 if (osb->osb_flags & OCFS2_OSB_HARD_RO) {
666 osb->osb_flags |= OCFS2_OSB_SOFT_RO;
668 if (osb->osb_flags & OCFS2_OSB_ERROR_FS) {
683 osb->osb_flags &= ~OCFS2_OSB_SOFT_RO;
685 trace_ocfs2_remount(sb->s_flags, osb->osb_flags, fc->sb_flags);
687 spin_unlock(&osb->osb_lock);
691 ret = ocfs2_susp_quotas(osb, 1);
693 ret = ocfs2_enable_quotas(osb);
696 spin_lock(&osb->osb_lock);
698 osb->osb_flags |= OCFS2_OSB_SOFT_RO;
699 spin_unlock(&osb->osb_lock);
708 osb->s_mount_opt = parsed_options->mount_opt;
709 osb->s_atime_quantum = parsed_options->atime_quantum;
710 osb->preferred_slot = parsed_options->slot;
712 osb->osb_commit_interval = parsed_options->commit_interval;
714 if (!ocfs2_is_hard_readonly(osb))
715 ocfs2_set_journal_params(osb);
718 ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ?
811 static int ocfs2_verify_heartbeat(struct ocfs2_super *osb)
815 if (osb->s_mount_opt & hb_enabled) {
816 if (ocfs2_mount_local(osb)) {
821 if (ocfs2_userspace_stack(osb)) {
826 if (((osb->s_mount_opt & OCFS2_MOUNT_HB_GLOBAL) &&
827 !ocfs2_cluster_o2cb_global_heartbeat(osb)) ||
828 ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) &&
829 ocfs2_cluster_o2cb_global_heartbeat(osb))) {
835 if (!(osb->s_mount_opt & hb_enabled)) {
836 if (!ocfs2_mount_local(osb) && !ocfs2_is_hard_readonly(osb) &&
837 !ocfs2_userspace_stack(osb)) {
852 static int ocfs2_verify_userspace_stack(struct ocfs2_super *osb,
855 if (!ocfs2_userspace_stack(osb) && mopt->cluster_stack[0]) {
862 if (ocfs2_userspace_stack(osb) &&
863 strncmp(osb->osb_cluster_stack, mopt->cluster_stack,
869 osb->osb_cluster_stack);
876 static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend)
879 struct super_block *sb = osb->sb;
907 static int ocfs2_enable_quotas(struct ocfs2_super *osb)
910 struct super_block *sb = osb->sb;
924 inode[type] = ocfs2_get_system_file_inode(osb, ino[type],
925 osb->slot_num);
940 ocfs2_disable_quotas(osb);
947 static void ocfs2_disable_quotas(struct ocfs2_super *osb)
951 struct super_block *sb = osb->sb;
979 struct ocfs2_super *osb = NULL;
999 osb = OCFS2_SB(sb);
1005 osb->s_mount_opt = parsed_options->mount_opt;
1006 osb->s_atime_quantum = parsed_options->atime_quantum;
1007 osb->preferred_slot = parsed_options->slot;
1008 osb->osb_commit_interval = parsed_options->commit_interval;
1010 ocfs2_la_set_sizes(osb, parsed_options->localalloc_opt);
1011 osb->osb_resv_level = parsed_options->resv_level;
1012 osb->osb_dir_resv_level = parsed_options->resv_level;
1014 osb->osb_dir_resv_level = parsed_options->resv_level;
1016 osb->osb_dir_resv_level = parsed_options->dir_resv_level;
1018 status = ocfs2_verify_userspace_stack(osb, parsed_options);
1025 ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ? SB_POSIXACL : 0);
1039 if (osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) {
1046 status = ocfs2_check_journals_nolocks(osb);
1055 ocfs2_set_ro_flag(osb, 1);
1059 "Recovery will be skipped.\n", osb->dev_str);
1062 if (!ocfs2_is_hard_readonly(osb)) {
1064 ocfs2_set_ro_flag(osb, 0);
1067 status = ocfs2_verify_heartbeat(osb);
1071 osb->osb_debug_root = debugfs_create_dir(osb->uuid_str,
1074 debugfs_create_file("fs_state", S_IFREG|S_IRUSR, osb->osb_debug_root,
1075 osb, &ocfs2_osb_debug_fops);
1077 if (ocfs2_meta_ecc(osb)) {
1078 ocfs2_initialize_journal_triggers(sb, osb->s_journal_triggers);
1079 ocfs2_blockcheck_stats_debugfs_install( &osb->osb_ecc_stats,
1080 osb->osb_debug_root);
1087 if (osb->root_inode)
1088 inode = igrab(osb->root_inode);
1095 osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL,
1097 if (!osb->osb_dev_kset) {
1105 if (ocfs2_filecheck_create_sysfs(osb)) {
1120 ocfs2_complete_mount_recovery(osb);
1122 if (ocfs2_mount_local(osb))
1125 snprintf(nodestr, sizeof(nodestr), "%u", osb->node_num);
1129 osb->dev_str, nodestr, osb->slot_num,
1130 osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK ? "writeback" :
1133 atomic_set(&osb->vol_state, VOLUME_MOUNTED);
1134 wake_up(&osb->osb_mount_event);
1140 status = ocfs2_enable_quotas(osb);
1145 atomic_set(&osb->vol_state, VOLUME_DISABLED);
1146 wake_up(&osb->osb_mount_event);
1151 ocfs2_complete_quota_recovery(osb);
1154 atomic_set(&osb->vol_state, VOLUME_MOUNTED_QUOTAS);
1155 wake_up(&osb->osb_mount_event);
1158 ocfs2_orphan_scan_start(osb);
1163 atomic_set(&osb->vol_state, VOLUME_DISABLED);
1164 wake_up(&osb->osb_mount_event);
1165 ocfs2_free_replay_slots(osb);
1170 debugfs_remove_recursive(osb->osb_debug_root);
1172 ocfs2_release_system_inodes(osb);
1173 kfree(osb->recovery_map);
1174 ocfs2_delete_osb(osb);
1175 kfree(osb);
1363 * Open code the memcmp here as we don't have an osb to pass
1419 struct ocfs2_super *osb = OCFS2_SB(root->d_sb);
1420 unsigned long opts = osb->s_mount_opt;
1450 if (osb->preferred_slot != OCFS2_INVALID_SLOT)
1451 seq_printf(s, ",preferred_slot=%d", osb->preferred_slot);
1453 seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
1455 if (osb->osb_commit_interval)
1457 (unsigned) (osb->osb_commit_interval / HZ));
1459 local_alloc_megs = osb->local_alloc_bits >> (20 - osb->s_clustersize_bits);
1460 if (local_alloc_megs != ocfs2_la_default_mb(osb))
1466 if (osb->osb_cluster_stack[0])
1467 seq_show_option(s, "cluster_stack", osb->osb_cluster_stack);
1491 if (osb->osb_resv_level != OCFS2_DEFAULT_RESV_LEVEL)
1492 seq_printf(s, ",resv_level=%d", osb->osb_resv_level);
1494 if (osb->osb_dir_resv_level != osb->osb_resv_level)
1495 seq_printf(s, ",dir_resv_level=%d", osb->osb_resv_level);
1558 struct ocfs2_super *osb;
1567 osb = OCFS2_SB(dentry->d_sb);
1569 inode = ocfs2_get_system_file_inode(osb,
1593 (osb->s_clustersize >> osb->sb->s_blocksize_bits);
1595 (osb->s_clustersize >> osb->sb->s_blocksize_bits);
1599 buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str, OCFS2_VOL_UUID_LEN)
1601 buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str + OCFS2_VOL_UUID_LEN,
1726 struct ocfs2_super *osb = OCFS2_SB(sb);
1728 if (ocfs2_is_hard_readonly(osb))
1731 mutex_init(&osb->obs_trim_fs_mutex);
1733 status = ocfs2_dlm_init(osb);
1736 if (status == -EBADR && ocfs2_userspace_stack(osb))
1742 status = ocfs2_super_lock(osb, 1);
1749 status = ocfs2_find_slot(osb);
1756 status = ocfs2_init_local_system_inodes(osb);
1762 status = ocfs2_check_volume(osb);
1768 status = ocfs2_truncate_log_init(osb);
1774 ocfs2_super_unlock(osb, 1);
1778 ocfs2_free_replay_slots(osb);
1780 if (osb->local_alloc_state == OCFS2_LA_ENABLED)
1781 ocfs2_shutdown_local_alloc(osb);
1782 ocfs2_release_system_inodes(osb);
1784 ocfs2_free_slot_info(osb);
1785 ocfs2_journal_shutdown(osb);
1787 ocfs2_super_unlock(osb, 1);
1789 ocfs2_dlm_shutdown(osb, 0);
1797 struct ocfs2_super *osb = NULL;
1803 osb = OCFS2_SB(sb);
1804 BUG_ON(!osb);
1808 ocfs2_filecheck_remove_sysfs(osb);
1810 kset_unregister(osb->osb_dev_kset);
1813 ocfs2_orphan_scan_stop(osb);
1815 ocfs2_disable_quotas(osb);
1818 WARN_ON(!llist_empty(&osb->dquot_drop_list));
1819 /* Wait for worker to be done with the work structure in osb */
1820 cancel_work_sync(&osb->dquot_drop_work);
1822 ocfs2_shutdown_local_alloc(osb);
1824 ocfs2_truncate_log_shutdown(osb);
1827 ocfs2_recovery_exit(osb);
1831 ocfs2_purge_refcount_trees(osb);
1835 if (osb->cconn) {
1836 tmp = ocfs2_super_lock(osb, 1);
1843 if (osb->slot_num != OCFS2_INVALID_SLOT)
1844 ocfs2_put_slot(osb);
1846 if (osb->cconn)
1847 ocfs2_super_unlock(osb, 1);
1849 ocfs2_release_system_inodes(osb);
1851 ocfs2_journal_shutdown(osb);
1859 if (!mnt_err && !ocfs2_mount_local(osb) && osb->uuid_str &&
1860 !ocfs2_is_hard_readonly(osb))
1863 ocfs2_dlm_shutdown(osb, hangup_needed);
1865 ocfs2_blockcheck_stats_debugfs_remove(&osb->osb_ecc_stats);
1866 debugfs_remove_recursive(osb->osb_debug_root);
1869 ocfs2_cluster_hangup(osb->uuid_str, strlen(osb->uuid_str));
1871 atomic_set(&osb->vol_state, VOLUME_DISMOUNTED);
1873 if (ocfs2_mount_local(osb))
1876 snprintf(nodestr, sizeof(nodestr), "%u", osb->node_num);
1879 osb->dev_str, nodestr);
1881 ocfs2_delete_osb(osb);
1882 kfree(osb);
1887 static int ocfs2_setup_osb_uuid(struct ocfs2_super *osb, const unsigned char *uuid,
1895 osb->uuid_str = kzalloc(OCFS2_VOL_UUID_LEN * 2 + 1, GFP_KERNEL);
1896 if (osb->uuid_str == NULL)
1899 for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) {
1914 static int ocfs2_journal_addressable(struct ocfs2_super *osb)
1918 ocfs2_clusters_to_blocks(osb->sb,
1919 osb->osb_clusters_at_boot) - 1;
1927 if (!(OCFS2_HAS_COMPAT_FEATURE(osb->sb,
1929 jbd2_journal_check_used_features(osb->journal->j_journal, 0, 0,
1950 struct ocfs2_super *osb;
1953 osb = kzalloc(sizeof(struct ocfs2_super), GFP_KERNEL);
1954 if (!osb) {
1960 sb->s_fs_info = osb;
1977 osb->osb_dx_mask = (1 << (cbits - bbits)) - 1;
1980 osb->osb_dx_seed[i] = le32_to_cpu(di->id2.i_super.s_dx_seed[i]);
1981 osb->osb_dx_seed[3] = le32_to_cpu(di->id2.i_super.s_uuid_hash);
1983 osb->sb = sb;
1984 osb->s_sectsize_bits = blksize_bits(sector_size);
1985 BUG_ON(!osb->s_sectsize_bits);
1987 spin_lock_init(&osb->dc_task_lock);
1988 init_waitqueue_head(&osb->dc_event);
1989 osb->dc_work_sequence = 0;
1990 osb->dc_wake_sequence = 0;
1991 INIT_LIST_HEAD(&osb->blocked_lock_list);
1992 osb->blocked_lock_count = 0;
1993 spin_lock_init(&osb->osb_lock);
1994 spin_lock_init(&osb->osb_xattr_lock);
1995 ocfs2_init_steal_slots(osb);
1997 mutex_init(&osb->system_file_mutex);
1999 atomic_set(&osb->alloc_stats.moves, 0);
2000 atomic_set(&osb->alloc_stats.local_data, 0);
2001 atomic_set(&osb->alloc_stats.bitmap_data, 0);
2002 atomic_set(&osb->alloc_stats.bg_allocs, 0);
2003 atomic_set(&osb->alloc_stats.bg_extends, 0);
2006 osb->osb_ecc_stats = *stats;
2008 ocfs2_init_node_maps(osb);
2010 snprintf(osb->dev_str, sizeof(osb->dev_str), "%u,%u",
2011 MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev));
2013 osb->max_slots = le16_to_cpu(di->id2.i_super.s_max_slots);
2014 if (osb->max_slots > OCFS2_MAX_SLOTS || osb->max_slots == 0) {
2016 osb->max_slots);
2021 ocfs2_orphan_scan_init(osb);
2023 status = ocfs2_recovery_init(osb);
2030 init_waitqueue_head(&osb->checkpoint_event);
2032 osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
2034 osb->slot_num = OCFS2_INVALID_SLOT;
2036 osb->s_xattr_inline_size = le16_to_cpu(
2039 osb->local_alloc_state = OCFS2_LA_UNUSED;
2040 osb->local_alloc_bh = NULL;
2041 INIT_DELAYED_WORK(&osb->la_enable_wq, ocfs2_la_enable_worker);
2043 init_waitqueue_head(&osb->osb_mount_event);
2045 ocfs2_resmap_init(osb, &osb->osb_la_resmap);
2047 osb->vol_label = kmalloc(OCFS2_MAX_VOL_LABEL_LEN, GFP_KERNEL);
2048 if (!osb->vol_label) {
2054 osb->slot_recovery_generations =
2055 kcalloc(osb->max_slots, sizeof(*osb->slot_recovery_generations),
2057 if (!osb->slot_recovery_generations) {
2063 init_waitqueue_head(&osb->osb_wipe_event);
2064 osb->osb_orphan_wipes = kcalloc(osb->max_slots,
2065 sizeof(*osb->osb_orphan_wipes),
2067 if (!osb->osb_orphan_wipes) {
2073 osb->osb_rf_lock_tree = RB_ROOT;
2075 osb->s_feature_compat =
2077 osb->s_feature_ro_compat =
2079 osb->s_feature_incompat =
2082 if ((i = OCFS2_HAS_INCOMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_INCOMPAT_SUPP))) {
2088 if (!sb_rdonly(osb->sb) && (i = OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP))) {
2095 if (ocfs2_clusterinfo_valid(osb)) {
2100 * because osb is allocated using kzalloc.
2102 osb->osb_stackflags =
2104 memcpy(osb->osb_cluster_stack,
2107 if (strlen(osb->osb_cluster_stack) != OCFS2_STACK_LABEL_LEN) {
2111 osb->osb_cluster_stack);
2115 memcpy(osb->osb_cluster_name,
2121 osb->osb_cluster_stack[0] = '\0';
2124 get_random_bytes(&osb->s_next_generation, sizeof(u32));
2131 status = ocfs2_journal_alloc(osb);
2135 INIT_WORK(&osb->dquot_drop_work, ocfs2_drop_dquot_refs);
2136 init_llist_head(&osb->dquot_drop_list);
2139 osb->s_clustersize_bits =
2141 osb->s_clustersize = 1 << osb->s_clustersize_bits;
2143 if (osb->s_clustersize < OCFS2_MIN_CLUSTERSIZE ||
2144 osb->s_clustersize > OCFS2_MAX_CLUSTERSIZE) {
2146 osb->s_clustersize);
2151 total_blocks = ocfs2_clusters_to_blocks(osb->sb,
2154 status = generic_check_addressable(osb->sb->s_blocksize_bits,
2163 if (ocfs2_setup_osb_uuid(osb, di->id2.i_super.s_uuid,
2170 strscpy(osb->vol_label, di->id2.i_super.s_label,
2172 osb->root_blkno = le64_to_cpu(di->id2.i_super.s_root_blkno);
2173 osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.s_system_dir_blkno);
2174 osb->first_cluster_group_blkno =
2176 osb->fs_generation = le32_to_cpu(di->i_fs_generation);
2177 osb->uuid_hash = le32_to_cpu(di->id2.i_super.s_uuid_hash);
2178 trace_ocfs2_initialize_super(osb->vol_label, osb->uuid_str,
2179 (unsigned long long)osb->root_blkno,
2180 (unsigned long long)osb->system_dir_blkno,
2181 osb->s_clustersize_bits);
2183 osb->osb_dlm_debug = ocfs2_new_dlm_debug();
2184 if (!osb->osb_dlm_debug) {
2190 atomic_set(&osb->vol_state, VOLUME_INIT);
2193 status = ocfs2_init_global_system_inodes(osb);
2202 inode = ocfs2_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE,
2210 osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;
2211 osb->osb_clusters_at_boot = OCFS2_I(inode)->ip_clusters;
2214 osb->bitmap_cpg = ocfs2_group_bitmap_size(sb, 0,
2215 osb->s_feature_incompat) * 8;
2217 status = ocfs2_init_slot_info(osb);
2223 osb->ocfs2_wq = alloc_ordered_workqueue("ocfs2_wq", WQ_MEM_RECLAIM);
2224 if (!osb->ocfs2_wq) {
2233 ocfs2_free_slot_info(osb);
2235 ocfs2_release_system_inodes(osb);
2237 ocfs2_put_dlm_debug(osb->osb_dlm_debug);
2239 kfree(osb->uuid_str);
2241 kfree(osb->journal);
2243 kfree(osb->osb_orphan_wipes);
2245 kfree(osb->slot_recovery_generations);
2247 kfree(osb->vol_label);
2249 kfree(osb->recovery_map);
2251 kfree(osb);
2332 static int ocfs2_check_volume(struct ocfs2_super *osb)
2342 status = ocfs2_journal_init(osb, &dirty);
2350 status = ocfs2_journal_addressable(osb);
2358 status = ocfs2_journal_wipe(osb->journal, 0);
2365 "unmounted cleanly, recovering it.\n", osb->dev_str);
2368 local = ocfs2_mount_local(osb);
2371 status = ocfs2_journal_load(osb->journal, local, dirty);
2377 if (osb->s_mount_opt & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
2378 jbd2_journal_set_features(osb->journal->j_journal,
2382 jbd2_journal_clear_features(osb->journal->j_journal,
2388 status = ocfs2_begin_local_alloc_recovery(osb,
2389 osb->slot_num,
2399 status = ocfs2_load_local_alloc(osb);
2408 osb->local_alloc_copy = local_alloc;
2415 status = ocfs2_mark_dead_nodes(osb);
2421 status = ocfs2_compute_replay_slots(osb);
2435 * volume is requested and the osb open count becomes 1.
2436 * It will remove the osb from the global list and also free up all the
2439 static void ocfs2_delete_osb(struct ocfs2_super *osb)
2441 /* This function assumes that the caller has the main osb resource */
2444 if (osb->ocfs2_wq)
2445 destroy_workqueue(osb->ocfs2_wq);
2447 ocfs2_free_slot_info(osb);
2449 kfree(osb->osb_orphan_wipes);
2450 kfree(osb->slot_recovery_generations);
2453 * allocate osb->journal at the middle of ocfs2_initialize_super(),
2456 kfree(osb->journal);
2457 kfree(osb->local_alloc_copy);
2458 kfree(osb->uuid_str);
2459 kfree(osb->vol_label);
2460 ocfs2_put_dlm_debug(osb->osb_dlm_debug);
2461 memset(osb, 0, sizeof(struct ocfs2_super));
2472 struct ocfs2_super *osb = OCFS2_SB(sb);
2475 ocfs2_set_osb_flag(osb, OCFS2_OSB_ERROR_FS);
2479 if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_PANIC) {
2482 } else if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_CONT) {
2487 if (sb_rdonly(sb) && (ocfs2_is_soft_readonly(osb) || ocfs2_is_hard_readonly(osb)))
2492 ocfs2_set_ro_flag(osb, 0);