Lines Matching refs:osb
100 static void ocfs2_delete_osb(struct ocfs2_super *osb);
106 static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb);
107 static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb);
108 static void ocfs2_release_system_inodes(struct ocfs2_super *osb);
109 static int ocfs2_check_volume(struct ocfs2_super *osb);
124 static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend);
125 static int ocfs2_enable_quotas(struct ocfs2_super *osb);
126 static void ocfs2_disable_quotas(struct ocfs2_super *osb);
215 static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len)
217 struct ocfs2_cluster_connection *cconn = osb->cconn;
218 struct ocfs2_recovery_map *rm = osb->recovery_map;
219 struct ocfs2_orphan_scan *os = &osb->osb_orphan_scan;
225 "Device", osb->dev_str, osb->uuid_str,
226 osb->fs_generation, osb->vol_label);
230 atomic_read(&osb->vol_state), osb->osb_flags);
234 osb->sb->s_blocksize, osb->s_clustersize);
239 "Features", osb->s_feature_compat,
240 osb->s_feature_incompat, osb->s_feature_ro_compat);
244 osb->s_mount_opt, osb->s_atime_quantum);
250 (*osb->osb_cluster_stack == '\0' ?
251 "o2cb" : osb->osb_cluster_stack),
257 spin_lock_irqsave(&osb->dc_task_lock, flags);
261 (osb->dc_task ? task_pid_nr(osb->dc_task) : -1),
262 osb->blocked_lock_count, osb->dc_wake_sequence,
263 osb->dc_work_sequence);
264 spin_unlock_irqrestore(&osb->dc_task_lock, flags);
266 spin_lock(&osb->osb_lock);
269 (osb->recovery_thread_task ?
270 task_pid_nr(osb->recovery_thread_task) : -1));
279 spin_unlock(&osb->osb_lock);
283 (osb->commit_task ? task_pid_nr(osb->commit_task) : -1),
284 osb->osb_commit_interval);
288 "Journal", osb->journal->j_state,
289 osb->journal->j_trans_id,
290 atomic_read(&osb->journal->j_num_trans));
296 atomic_read(&osb->alloc_stats.bitmap_data),
297 atomic_read(&osb->alloc_stats.local_data),
298 atomic_read(&osb->alloc_stats.bg_allocs),
299 atomic_read(&osb->alloc_stats.moves),
300 atomic_read(&osb->alloc_stats.bg_extends));
305 "LocalAlloc", osb->local_alloc_state,
306 (unsigned long long)osb->la_last_gd,
307 osb->local_alloc_bits, osb->local_alloc_default_bits);
309 spin_lock(&osb->osb_lock);
313 osb->s_inode_steal_slot,
314 atomic_read(&osb->s_num_inodes_stolen),
315 osb->s_meta_steal_slot,
316 atomic_read(&osb->s_num_meta_stolen));
317 spin_unlock(&osb->osb_lock);
331 for (i = 0; i < osb->max_slots; ++i) {
335 (i == osb->slot_num ? '*' : ' '),
336 i, osb->slot_recovery_generations[i]);
344 struct ocfs2_super *osb = inode->i_private;
351 i_size_write(inode, ocfs2_osb_dump(osb, buf, PAGE_SIZE));
399 struct ocfs2_super *osb = OCFS2_SB(sb);
401 if (ocfs2_is_hard_readonly(osb))
405 status = ocfs2_flush_truncate_log(osb);
409 ocfs2_schedule_truncate_log_flush(osb, 0);
412 if (jbd2_journal_start_commit(osb->journal->j_journal,
415 jbd2_log_wait_commit(osb->journal->j_journal,
421 static int ocfs2_need_system_inode(struct ocfs2_super *osb, int ino)
423 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_USRQUOTA)
427 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)
434 static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb)
440 new = ocfs2_iget(osb, osb->root_blkno, OCFS2_FI_FLAG_SYSFILE, 0);
446 osb->root_inode = new;
448 new = ocfs2_iget(osb, osb->system_dir_blkno, OCFS2_FI_FLAG_SYSFILE, 0);
454 osb->sys_root_inode = new;
458 if (!ocfs2_need_system_inode(osb, i))
460 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
462 ocfs2_release_system_inodes(osb);
463 status = ocfs2_is_soft_readonly(osb) ? -EROFS : -EINVAL;
479 static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb)
488 if (!ocfs2_need_system_inode(osb, i))
490 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
492 ocfs2_release_system_inodes(osb);
493 status = ocfs2_is_soft_readonly(osb) ? -EROFS : -EINVAL;
495 status, i, osb->slot_num);
508 static void ocfs2_release_system_inodes(struct ocfs2_super *osb)
514 inode = osb->global_system_inodes[i];
517 osb->global_system_inodes[i] = NULL;
521 inode = osb->sys_root_inode;
524 osb->sys_root_inode = NULL;
527 inode = osb->root_inode;
530 osb->root_inode = NULL;
533 if (!osb->local_system_inodes)
536 for (i = 0; i < NUM_LOCAL_SYSTEM_INODES * osb->max_slots; i++) {
537 if (osb->local_system_inodes[i]) {
538 iput(osb->local_system_inodes[i]);
539 osb->local_system_inodes[i] = NULL;
543 kfree(osb->local_system_inodes);
544 osb->local_system_inodes = NULL;
611 struct ocfs2_super *osb = OCFS2_SB(sb);
624 if ((osb->s_mount_opt & tmp) != (parsed_options.mount_opt & tmp)) {
630 if ((osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK) !=
639 if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64) &&
650 ret = ocfs2_susp_quotas(osb, 0);
656 spin_lock(&osb->osb_lock);
657 if (osb->osb_flags & OCFS2_OSB_HARD_RO) {
665 osb->osb_flags |= OCFS2_OSB_SOFT_RO;
667 if (osb->osb_flags & OCFS2_OSB_ERROR_FS) {
682 osb->osb_flags &= ~OCFS2_OSB_SOFT_RO;
684 trace_ocfs2_remount(sb->s_flags, osb->osb_flags, *flags);
686 spin_unlock(&osb->osb_lock);
690 ret = ocfs2_susp_quotas(osb, 1);
692 ret = ocfs2_enable_quotas(osb);
695 spin_lock(&osb->osb_lock);
697 osb->osb_flags |= OCFS2_OSB_SOFT_RO;
698 spin_unlock(&osb->osb_lock);
707 osb->s_mount_opt = parsed_options.mount_opt;
708 osb->s_atime_quantum = parsed_options.atime_quantum;
709 osb->preferred_slot = parsed_options.slot;
711 osb->osb_commit_interval = parsed_options.commit_interval;
713 if (!ocfs2_is_hard_readonly(osb))
714 ocfs2_set_journal_params(osb);
717 ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ?
810 static int ocfs2_verify_heartbeat(struct ocfs2_super *osb)
814 if (osb->s_mount_opt & hb_enabled) {
815 if (ocfs2_mount_local(osb)) {
820 if (ocfs2_userspace_stack(osb)) {
825 if (((osb->s_mount_opt & OCFS2_MOUNT_HB_GLOBAL) &&
826 !ocfs2_cluster_o2cb_global_heartbeat(osb)) ||
827 ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) &&
828 ocfs2_cluster_o2cb_global_heartbeat(osb))) {
834 if (!(osb->s_mount_opt & hb_enabled)) {
835 if (!ocfs2_mount_local(osb) && !ocfs2_is_hard_readonly(osb) &&
836 !ocfs2_userspace_stack(osb)) {
851 static int ocfs2_verify_userspace_stack(struct ocfs2_super *osb,
854 if (!ocfs2_userspace_stack(osb) && mopt->cluster_stack[0]) {
861 if (ocfs2_userspace_stack(osb) &&
862 strncmp(osb->osb_cluster_stack, mopt->cluster_stack,
868 osb->osb_cluster_stack);
875 static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend)
878 struct super_block *sb = osb->sb;
906 static int ocfs2_enable_quotas(struct ocfs2_super *osb)
909 struct super_block *sb = osb->sb;
923 inode[type] = ocfs2_get_system_file_inode(osb, ino[type],
924 osb->slot_num);
939 ocfs2_disable_quotas(osb);
946 static void ocfs2_disable_quotas(struct ocfs2_super *osb)
950 struct super_block *sb = osb->sb;
980 struct ocfs2_super *osb = NULL;
1005 osb = OCFS2_SB(sb);
1011 osb->s_mount_opt = parsed_options.mount_opt;
1012 osb->s_atime_quantum = parsed_options.atime_quantum;
1013 osb->preferred_slot = parsed_options.slot;
1014 osb->osb_commit_interval = parsed_options.commit_interval;
1016 ocfs2_la_set_sizes(osb, parsed_options.localalloc_opt);
1017 osb->osb_resv_level = parsed_options.resv_level;
1018 osb->osb_dir_resv_level = parsed_options.resv_level;
1020 osb->osb_dir_resv_level = parsed_options.resv_level;
1022 osb->osb_dir_resv_level = parsed_options.dir_resv_level;
1024 status = ocfs2_verify_userspace_stack(osb, &parsed_options);
1031 ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ? SB_POSIXACL : 0);
1045 if (osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) {
1052 status = ocfs2_check_journals_nolocks(osb);
1061 ocfs2_set_ro_flag(osb, 1);
1065 "Recovery will be skipped.\n", osb->dev_str);
1068 if (!ocfs2_is_hard_readonly(osb)) {
1070 ocfs2_set_ro_flag(osb, 0);
1073 status = ocfs2_verify_heartbeat(osb);
1077 osb->osb_debug_root = debugfs_create_dir(osb->uuid_str,
1080 debugfs_create_file("fs_state", S_IFREG|S_IRUSR, osb->osb_debug_root,
1081 osb, &ocfs2_osb_debug_fops);
1083 if (ocfs2_meta_ecc(osb))
1084 ocfs2_blockcheck_stats_debugfs_install( &osb->osb_ecc_stats,
1085 osb->osb_debug_root);
1091 if (osb->root_inode)
1092 inode = igrab(osb->root_inode);
1099 osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL,
1101 if (!osb->osb_dev_kset) {
1109 if (ocfs2_filecheck_create_sysfs(osb)) {
1124 ocfs2_complete_mount_recovery(osb);
1126 if (ocfs2_mount_local(osb))
1129 snprintf(nodestr, sizeof(nodestr), "%u", osb->node_num);
1133 osb->dev_str, nodestr, osb->slot_num,
1134 osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK ? "writeback" :
1137 atomic_set(&osb->vol_state, VOLUME_MOUNTED);
1138 wake_up(&osb->osb_mount_event);
1144 status = ocfs2_enable_quotas(osb);
1149 atomic_set(&osb->vol_state, VOLUME_DISABLED);
1150 wake_up(&osb->osb_mount_event);
1155 ocfs2_complete_quota_recovery(osb);
1158 atomic_set(&osb->vol_state, VOLUME_MOUNTED_QUOTAS);
1159 wake_up(&osb->osb_mount_event);
1162 ocfs2_orphan_scan_start(osb);
1167 atomic_set(&osb->vol_state, VOLUME_DISABLED);
1168 wake_up(&osb->osb_mount_event);
1169 ocfs2_free_replay_slots(osb);
1174 debugfs_remove_recursive(osb->osb_debug_root);
1176 ocfs2_release_system_inodes(osb);
1177 kfree(osb->recovery_map);
1178 ocfs2_delete_osb(osb);
1179 kfree(osb);
1392 * an osb to pass to
1477 struct ocfs2_super *osb = OCFS2_SB(root->d_sb);
1478 unsigned long opts = osb->s_mount_opt;
1508 if (osb->preferred_slot != OCFS2_INVALID_SLOT)
1509 seq_printf(s, ",preferred_slot=%d", osb->preferred_slot);
1511 seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
1513 if (osb->osb_commit_interval)
1515 (unsigned) (osb->osb_commit_interval / HZ));
1517 local_alloc_megs = osb->local_alloc_bits >> (20 - osb->s_clustersize_bits);
1518 if (local_alloc_megs != ocfs2_la_default_mb(osb))
1524 if (osb->osb_cluster_stack[0])
1525 seq_show_option_n(s, "cluster_stack", osb->osb_cluster_stack,
1550 if (osb->osb_resv_level != OCFS2_DEFAULT_RESV_LEVEL)
1551 seq_printf(s, ",resv_level=%d", osb->osb_resv_level);
1553 if (osb->osb_dir_resv_level != osb->osb_resv_level)
1554 seq_printf(s, ",dir_resv_level=%d", osb->osb_resv_level);
1619 struct ocfs2_super *osb;
1628 osb = OCFS2_SB(dentry->d_sb);
1630 inode = ocfs2_get_system_file_inode(osb,
1654 (osb->s_clustersize >> osb->sb->s_blocksize_bits);
1656 (osb->s_clustersize >> osb->sb->s_blocksize_bits);
1660 buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str, OCFS2_VOL_UUID_LEN)
1662 buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str + OCFS2_VOL_UUID_LEN,
1790 struct ocfs2_super *osb = OCFS2_SB(sb);
1792 if (ocfs2_is_hard_readonly(osb))
1795 mutex_init(&osb->obs_trim_fs_mutex);
1797 status = ocfs2_dlm_init(osb);
1800 if (status == -EBADR && ocfs2_userspace_stack(osb))
1806 status = ocfs2_super_lock(osb, 1);
1813 status = ocfs2_find_slot(osb);
1820 status = ocfs2_init_local_system_inodes(osb);
1826 status = ocfs2_check_volume(osb);
1832 status = ocfs2_truncate_log_init(osb);
1838 ocfs2_super_unlock(osb, 1);
1842 ocfs2_free_replay_slots(osb);
1844 if (osb->local_alloc_state == OCFS2_LA_ENABLED)
1845 ocfs2_shutdown_local_alloc(osb);
1846 ocfs2_release_system_inodes(osb);
1848 ocfs2_free_slot_info(osb);
1849 ocfs2_journal_shutdown(osb);
1851 ocfs2_super_unlock(osb, 1);
1853 ocfs2_dlm_shutdown(osb, 0);
1861 struct ocfs2_super *osb = NULL;
1867 osb = OCFS2_SB(sb);
1868 BUG_ON(!osb);
1872 ocfs2_filecheck_remove_sysfs(osb);
1874 kset_unregister(osb->osb_dev_kset);
1877 ocfs2_orphan_scan_stop(osb);
1879 ocfs2_disable_quotas(osb);
1882 WARN_ON(!llist_empty(&osb->dquot_drop_list));
1883 /* Wait for worker to be done with the work structure in osb */
1884 cancel_work_sync(&osb->dquot_drop_work);
1886 ocfs2_shutdown_local_alloc(osb);
1888 ocfs2_truncate_log_shutdown(osb);
1891 ocfs2_recovery_exit(osb);
1893 ocfs2_journal_shutdown(osb);
1897 ocfs2_purge_refcount_trees(osb);
1901 if (osb->cconn) {
1902 tmp = ocfs2_super_lock(osb, 1);
1909 if (osb->slot_num != OCFS2_INVALID_SLOT)
1910 ocfs2_put_slot(osb);
1912 if (osb->cconn)
1913 ocfs2_super_unlock(osb, 1);
1915 ocfs2_release_system_inodes(osb);
1923 if (!mnt_err && !ocfs2_mount_local(osb) && osb->uuid_str &&
1924 !ocfs2_is_hard_readonly(osb))
1927 ocfs2_dlm_shutdown(osb, hangup_needed);
1929 ocfs2_blockcheck_stats_debugfs_remove(&osb->osb_ecc_stats);
1930 debugfs_remove_recursive(osb->osb_debug_root);
1933 ocfs2_cluster_hangup(osb->uuid_str, strlen(osb->uuid_str));
1935 atomic_set(&osb->vol_state, VOLUME_DISMOUNTED);
1937 if (ocfs2_mount_local(osb))
1940 snprintf(nodestr, sizeof(nodestr), "%u", osb->node_num);
1943 osb->dev_str, nodestr);
1945 ocfs2_delete_osb(osb);
1946 kfree(osb);
1951 static int ocfs2_setup_osb_uuid(struct ocfs2_super *osb, const unsigned char *uuid,
1959 osb->uuid_str = kzalloc(OCFS2_VOL_UUID_LEN * 2 + 1, GFP_KERNEL);
1960 if (osb->uuid_str == NULL)
1963 for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) {
1978 static int ocfs2_journal_addressable(struct ocfs2_super *osb)
1982 ocfs2_clusters_to_blocks(osb->sb,
1983 osb->osb_clusters_at_boot) - 1;
1991 if (!(OCFS2_HAS_COMPAT_FEATURE(osb->sb,
1993 jbd2_journal_check_used_features(osb->journal->j_journal, 0, 0,
2015 struct ocfs2_super *osb;
2018 osb = kzalloc(sizeof(struct ocfs2_super), GFP_KERNEL);
2019 if (!osb) {
2025 sb->s_fs_info = osb;
2042 osb->osb_dx_mask = (1 << (cbits - bbits)) - 1;
2045 osb->osb_dx_seed[i] = le32_to_cpu(di->id2.i_super.s_dx_seed[i]);
2046 osb->osb_dx_seed[3] = le32_to_cpu(di->id2.i_super.s_uuid_hash);
2048 osb->sb = sb;
2049 osb->s_sectsize_bits = blksize_bits(sector_size);
2050 BUG_ON(!osb->s_sectsize_bits);
2052 spin_lock_init(&osb->dc_task_lock);
2053 init_waitqueue_head(&osb->dc_event);
2054 osb->dc_work_sequence = 0;
2055 osb->dc_wake_sequence = 0;
2056 INIT_LIST_HEAD(&osb->blocked_lock_list);
2057 osb->blocked_lock_count = 0;
2058 spin_lock_init(&osb->osb_lock);
2059 spin_lock_init(&osb->osb_xattr_lock);
2060 ocfs2_init_steal_slots(osb);
2062 mutex_init(&osb->system_file_mutex);
2064 atomic_set(&osb->alloc_stats.moves, 0);
2065 atomic_set(&osb->alloc_stats.local_data, 0);
2066 atomic_set(&osb->alloc_stats.bitmap_data, 0);
2067 atomic_set(&osb->alloc_stats.bg_allocs, 0);
2068 atomic_set(&osb->alloc_stats.bg_extends, 0);
2071 osb->osb_ecc_stats = *stats;
2073 ocfs2_init_node_maps(osb);
2075 snprintf(osb->dev_str, sizeof(osb->dev_str), "%u,%u",
2076 MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev));
2078 osb->max_slots = le16_to_cpu(di->id2.i_super.s_max_slots);
2079 if (osb->max_slots > OCFS2_MAX_SLOTS || osb->max_slots == 0) {
2081 osb->max_slots);
2086 ocfs2_orphan_scan_init(osb);
2088 status = ocfs2_recovery_init(osb);
2095 init_waitqueue_head(&osb->checkpoint_event);
2097 osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
2099 osb->slot_num = OCFS2_INVALID_SLOT;
2101 osb->s_xattr_inline_size = le16_to_cpu(
2104 osb->local_alloc_state = OCFS2_LA_UNUSED;
2105 osb->local_alloc_bh = NULL;
2106 INIT_DELAYED_WORK(&osb->la_enable_wq, ocfs2_la_enable_worker);
2108 init_waitqueue_head(&osb->osb_mount_event);
2110 status = ocfs2_resmap_init(osb, &osb->osb_la_resmap);
2116 osb->vol_label = kmalloc(OCFS2_MAX_VOL_LABEL_LEN, GFP_KERNEL);
2117 if (!osb->vol_label) {
2123 osb->slot_recovery_generations =
2124 kcalloc(osb->max_slots, sizeof(*osb->slot_recovery_generations),
2126 if (!osb->slot_recovery_generations) {
2132 init_waitqueue_head(&osb->osb_wipe_event);
2133 osb->osb_orphan_wipes = kcalloc(osb->max_slots,
2134 sizeof(*osb->osb_orphan_wipes),
2136 if (!osb->osb_orphan_wipes) {
2142 osb->osb_rf_lock_tree = RB_ROOT;
2144 osb->s_feature_compat =
2146 osb->s_feature_ro_compat =
2148 osb->s_feature_incompat =
2151 if ((i = OCFS2_HAS_INCOMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_INCOMPAT_SUPP))) {
2157 if (!sb_rdonly(osb->sb) && (i = OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP))) {
2164 if (ocfs2_clusterinfo_valid(osb)) {
2169 * because osb is allocated using kzalloc.
2171 osb->osb_stackflags =
2173 memcpy(osb->osb_cluster_stack,
2176 if (strlen(osb->osb_cluster_stack) != OCFS2_STACK_LABEL_LEN) {
2180 osb->osb_cluster_stack);
2184 memcpy(osb->osb_cluster_name,
2190 osb->osb_cluster_stack[0] = '\0';
2193 get_random_bytes(&osb->s_next_generation, sizeof(u32));
2199 * refers to osb->journal before ocfs2_journal_init() is run,
2210 osb->journal = journal;
2211 journal->j_osb = osb;
2222 INIT_WORK(&osb->dquot_drop_work, ocfs2_drop_dquot_refs);
2223 init_llist_head(&osb->dquot_drop_list);
2226 osb->s_clustersize_bits =
2228 osb->s_clustersize = 1 << osb->s_clustersize_bits;
2230 if (osb->s_clustersize < OCFS2_MIN_CLUSTERSIZE ||
2231 osb->s_clustersize > OCFS2_MAX_CLUSTERSIZE) {
2233 osb->s_clustersize);
2238 total_blocks = ocfs2_clusters_to_blocks(osb->sb,
2241 status = generic_check_addressable(osb->sb->s_blocksize_bits,
2250 if (ocfs2_setup_osb_uuid(osb, di->id2.i_super.s_uuid,
2257 strlcpy(osb->vol_label, di->id2.i_super.s_label,
2259 osb->root_blkno = le64_to_cpu(di->id2.i_super.s_root_blkno);
2260 osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.s_system_dir_blkno);
2261 osb->first_cluster_group_blkno =
2263 osb->fs_generation = le32_to_cpu(di->i_fs_generation);
2264 osb->uuid_hash = le32_to_cpu(di->id2.i_super.s_uuid_hash);
2265 trace_ocfs2_initialize_super(osb->vol_label, osb->uuid_str,
2266 (unsigned long long)osb->root_blkno,
2267 (unsigned long long)osb->system_dir_blkno,
2268 osb->s_clustersize_bits);
2270 osb->osb_dlm_debug = ocfs2_new_dlm_debug();
2271 if (!osb->osb_dlm_debug) {
2277 atomic_set(&osb->vol_state, VOLUME_INIT);
2280 status = ocfs2_init_global_system_inodes(osb);
2289 inode = ocfs2_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE,
2297 osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;
2298 osb->osb_clusters_at_boot = OCFS2_I(inode)->ip_clusters;
2301 osb->bitmap_cpg = ocfs2_group_bitmap_size(sb, 0,
2302 osb->s_feature_incompat) * 8;
2304 status = ocfs2_init_slot_info(osb);
2311 osb->ocfs2_wq = alloc_ordered_workqueue("ocfs2_wq", WQ_MEM_RECLAIM);
2312 if (!osb->ocfs2_wq) {
2392 static int ocfs2_check_volume(struct ocfs2_super *osb)
2402 status = ocfs2_journal_init(osb->journal, &dirty);
2410 status = ocfs2_journal_addressable(osb);
2418 status = ocfs2_journal_wipe(osb->journal, 0);
2425 "unmounted cleanly, recovering it.\n", osb->dev_str);
2428 local = ocfs2_mount_local(osb);
2431 status = ocfs2_journal_load(osb->journal, local, dirty);
2437 if (osb->s_mount_opt & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
2438 jbd2_journal_set_features(osb->journal->j_journal,
2442 jbd2_journal_clear_features(osb->journal->j_journal,
2448 status = ocfs2_begin_local_alloc_recovery(osb,
2449 osb->slot_num,
2459 status = ocfs2_load_local_alloc(osb);
2468 osb->local_alloc_copy = local_alloc;
2475 status = ocfs2_mark_dead_nodes(osb);
2481 status = ocfs2_compute_replay_slots(osb);
2495 * volume is requested and the osb open count becomes 1.
2496 * It will remove the osb from the global list and also free up all the
2499 static void ocfs2_delete_osb(struct ocfs2_super *osb)
2501 /* This function assumes that the caller has the main osb resource */
2504 if (osb->ocfs2_wq)
2505 destroy_workqueue(osb->ocfs2_wq);
2507 ocfs2_free_slot_info(osb);
2509 kfree(osb->osb_orphan_wipes);
2510 kfree(osb->slot_recovery_generations);
2513 * allocate osb->journal at the start of ocfs2_initialize_osb(),
2516 kfree(osb->journal);
2517 kfree(osb->local_alloc_copy);
2518 kfree(osb->uuid_str);
2519 kfree(osb->vol_label);
2520 ocfs2_put_dlm_debug(osb->osb_dlm_debug);
2521 memset(osb, 0, sizeof(struct ocfs2_super));
2532 struct ocfs2_super *osb = OCFS2_SB(sb);
2535 ocfs2_set_osb_flag(osb, OCFS2_OSB_ERROR_FS);
2539 if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_PANIC) {
2542 } else if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_CONT) {
2547 if (sb_rdonly(sb) && (ocfs2_is_soft_readonly(osb) || ocfs2_is_hard_readonly(osb)))
2552 ocfs2_set_ro_flag(osb, 0);