Lines Matching refs:osb

97 static void ocfs2_delete_osb(struct ocfs2_super *osb);
103 static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb);
104 static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb);
105 static void ocfs2_release_system_inodes(struct ocfs2_super *osb);
106 static int ocfs2_check_volume(struct ocfs2_super *osb);
121 static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend);
122 static int ocfs2_enable_quotas(struct ocfs2_super *osb);
123 static void ocfs2_disable_quotas(struct ocfs2_super *osb);
212 static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len)
214 struct ocfs2_cluster_connection *cconn = osb->cconn;
215 struct ocfs2_recovery_map *rm = osb->recovery_map;
216 struct ocfs2_orphan_scan *os = &osb->osb_orphan_scan;
222 "Device", osb->dev_str, osb->uuid_str,
223 osb->fs_generation, osb->vol_label);
227 atomic_read(&osb->vol_state), osb->osb_flags);
231 osb->sb->s_blocksize, osb->s_clustersize);
236 "Features", osb->s_feature_compat,
237 osb->s_feature_incompat, osb->s_feature_ro_compat);
241 osb->s_mount_opt, osb->s_atime_quantum);
247 (*osb->osb_cluster_stack == '\0' ?
248 "o2cb" : osb->osb_cluster_stack),
254 spin_lock_irqsave(&osb->dc_task_lock, flags);
258 (osb->dc_task ? task_pid_nr(osb->dc_task) : -1),
259 osb->blocked_lock_count, osb->dc_wake_sequence,
260 osb->dc_work_sequence);
261 spin_unlock_irqrestore(&osb->dc_task_lock, flags);
263 spin_lock(&osb->osb_lock);
266 (osb->recovery_thread_task ?
267 task_pid_nr(osb->recovery_thread_task) : -1));
276 spin_unlock(&osb->osb_lock);
280 (osb->commit_task ? task_pid_nr(osb->commit_task) : -1),
281 osb->osb_commit_interval);
285 "Journal", osb->journal->j_state,
286 osb->journal->j_trans_id,
287 atomic_read(&osb->journal->j_num_trans));
293 atomic_read(&osb->alloc_stats.bitmap_data),
294 atomic_read(&osb->alloc_stats.local_data),
295 atomic_read(&osb->alloc_stats.bg_allocs),
296 atomic_read(&osb->alloc_stats.moves),
297 atomic_read(&osb->alloc_stats.bg_extends));
302 "LocalAlloc", osb->local_alloc_state,
303 (unsigned long long)osb->la_last_gd,
304 osb->local_alloc_bits, osb->local_alloc_default_bits);
306 spin_lock(&osb->osb_lock);
310 osb->s_inode_steal_slot,
311 atomic_read(&osb->s_num_inodes_stolen),
312 osb->s_meta_steal_slot,
313 atomic_read(&osb->s_num_meta_stolen));
314 spin_unlock(&osb->osb_lock);
328 for (i = 0; i < osb->max_slots; ++i) {
332 (i == osb->slot_num ? '*' : ' '),
333 i, osb->slot_recovery_generations[i]);
341 struct ocfs2_super *osb = inode->i_private;
348 i_size_write(inode, ocfs2_osb_dump(osb, buf, PAGE_SIZE));
396 struct ocfs2_super *osb = OCFS2_SB(sb);
398 if (ocfs2_is_hard_readonly(osb))
402 status = ocfs2_flush_truncate_log(osb);
406 ocfs2_schedule_truncate_log_flush(osb, 0);
409 if (jbd2_journal_start_commit(osb->journal->j_journal,
412 jbd2_log_wait_commit(osb->journal->j_journal,
418 static int ocfs2_need_system_inode(struct ocfs2_super *osb, int ino)
420 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_USRQUOTA)
424 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)
431 static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb)
437 new = ocfs2_iget(osb, osb->root_blkno, OCFS2_FI_FLAG_SYSFILE, 0);
443 osb->root_inode = new;
445 new = ocfs2_iget(osb, osb->system_dir_blkno, OCFS2_FI_FLAG_SYSFILE, 0);
451 osb->sys_root_inode = new;
455 if (!ocfs2_need_system_inode(osb, i))
457 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
459 ocfs2_release_system_inodes(osb);
460 status = ocfs2_is_soft_readonly(osb) ? -EROFS : -EINVAL;
476 static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb)
485 if (!ocfs2_need_system_inode(osb, i))
487 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
489 ocfs2_release_system_inodes(osb);
490 status = ocfs2_is_soft_readonly(osb) ? -EROFS : -EINVAL;
492 status, i, osb->slot_num);
505 static void ocfs2_release_system_inodes(struct ocfs2_super *osb)
511 inode = osb->global_system_inodes[i];
514 osb->global_system_inodes[i] = NULL;
518 inode = osb->sys_root_inode;
521 osb->sys_root_inode = NULL;
524 inode = osb->root_inode;
527 osb->root_inode = NULL;
530 if (!osb->local_system_inodes)
533 for (i = 0; i < NUM_LOCAL_SYSTEM_INODES * osb->max_slots; i++) {
534 if (osb->local_system_inodes[i]) {
535 iput(osb->local_system_inodes[i]);
536 osb->local_system_inodes[i] = NULL;
540 kfree(osb->local_system_inodes);
541 osb->local_system_inodes = NULL;
608 struct ocfs2_super *osb = OCFS2_SB(sb);
621 if ((osb->s_mount_opt & tmp) != (parsed_options.mount_opt & tmp)) {
627 if ((osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK) !=
636 if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64) &&
647 ret = ocfs2_susp_quotas(osb, 0);
653 spin_lock(&osb->osb_lock);
654 if (osb->osb_flags & OCFS2_OSB_HARD_RO) {
662 osb->osb_flags |= OCFS2_OSB_SOFT_RO;
664 if (osb->osb_flags & OCFS2_OSB_ERROR_FS) {
679 osb->osb_flags &= ~OCFS2_OSB_SOFT_RO;
681 trace_ocfs2_remount(sb->s_flags, osb->osb_flags, *flags);
683 spin_unlock(&osb->osb_lock);
687 ret = ocfs2_susp_quotas(osb, 1);
689 ret = ocfs2_enable_quotas(osb);
692 spin_lock(&osb->osb_lock);
694 osb->osb_flags |= OCFS2_OSB_SOFT_RO;
695 spin_unlock(&osb->osb_lock);
704 osb->s_mount_opt = parsed_options.mount_opt;
705 osb->s_atime_quantum = parsed_options.atime_quantum;
706 osb->preferred_slot = parsed_options.slot;
708 osb->osb_commit_interval = parsed_options.commit_interval;
710 if (!ocfs2_is_hard_readonly(osb))
711 ocfs2_set_journal_params(osb);
714 ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ?
807 static int ocfs2_verify_heartbeat(struct ocfs2_super *osb)
811 if (osb->s_mount_opt & hb_enabled) {
812 if (ocfs2_mount_local(osb)) {
817 if (ocfs2_userspace_stack(osb)) {
822 if (((osb->s_mount_opt & OCFS2_MOUNT_HB_GLOBAL) &&
823 !ocfs2_cluster_o2cb_global_heartbeat(osb)) ||
824 ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) &&
825 ocfs2_cluster_o2cb_global_heartbeat(osb))) {
831 if (!(osb->s_mount_opt & hb_enabled)) {
832 if (!ocfs2_mount_local(osb) && !ocfs2_is_hard_readonly(osb) &&
833 !ocfs2_userspace_stack(osb)) {
848 static int ocfs2_verify_userspace_stack(struct ocfs2_super *osb,
851 if (!ocfs2_userspace_stack(osb) && mopt->cluster_stack[0]) {
858 if (ocfs2_userspace_stack(osb) &&
859 strncmp(osb->osb_cluster_stack, mopt->cluster_stack,
865 osb->osb_cluster_stack);
872 static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend)
875 struct super_block *sb = osb->sb;
903 static int ocfs2_enable_quotas(struct ocfs2_super *osb)
906 struct super_block *sb = osb->sb;
920 inode[type] = ocfs2_get_system_file_inode(osb, ino[type],
921 osb->slot_num);
936 ocfs2_disable_quotas(osb);
943 static void ocfs2_disable_quotas(struct ocfs2_super *osb)
947 struct super_block *sb = osb->sb;
975 struct ocfs2_super *osb = NULL;
1000 osb = OCFS2_SB(sb);
1006 osb->s_mount_opt = parsed_options.mount_opt;
1007 osb->s_atime_quantum = parsed_options.atime_quantum;
1008 osb->preferred_slot = parsed_options.slot;
1009 osb->osb_commit_interval = parsed_options.commit_interval;
1011 ocfs2_la_set_sizes(osb, parsed_options.localalloc_opt);
1012 osb->osb_resv_level = parsed_options.resv_level;
1013 osb->osb_dir_resv_level = parsed_options.resv_level;
1015 osb->osb_dir_resv_level = parsed_options.resv_level;
1017 osb->osb_dir_resv_level = parsed_options.dir_resv_level;
1019 status = ocfs2_verify_userspace_stack(osb, &parsed_options);
1026 ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ? SB_POSIXACL : 0);
1040 if (osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) {
1047 status = ocfs2_check_journals_nolocks(osb);
1056 ocfs2_set_ro_flag(osb, 1);
1060 "Recovery will be skipped.\n", osb->dev_str);
1063 if (!ocfs2_is_hard_readonly(osb)) {
1065 ocfs2_set_ro_flag(osb, 0);
1068 status = ocfs2_verify_heartbeat(osb);
1072 osb->osb_debug_root = debugfs_create_dir(osb->uuid_str,
1075 debugfs_create_file("fs_state", S_IFREG|S_IRUSR, osb->osb_debug_root,
1076 osb, &ocfs2_osb_debug_fops);
1078 if (ocfs2_meta_ecc(osb))
1079 ocfs2_blockcheck_stats_debugfs_install( &osb->osb_ecc_stats,
1080 osb->osb_debug_root);
1086 if (osb->root_inode)
1087 inode = igrab(osb->root_inode);
1094 osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL,
1096 if (!osb->osb_dev_kset) {
1104 if (ocfs2_filecheck_create_sysfs(osb)) {
1119 ocfs2_complete_mount_recovery(osb);
1121 if (ocfs2_mount_local(osb))
1124 snprintf(nodestr, sizeof(nodestr), "%u", osb->node_num);
1128 osb->dev_str, nodestr, osb->slot_num,
1129 osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK ? "writeback" :
1132 atomic_set(&osb->vol_state, VOLUME_MOUNTED);
1133 wake_up(&osb->osb_mount_event);
1139 status = ocfs2_enable_quotas(osb);
1144 atomic_set(&osb->vol_state, VOLUME_DISABLED);
1145 wake_up(&osb->osb_mount_event);
1150 ocfs2_complete_quota_recovery(osb);
1153 atomic_set(&osb->vol_state, VOLUME_MOUNTED_QUOTAS);
1154 wake_up(&osb->osb_mount_event);
1157 ocfs2_orphan_scan_start(osb);
1162 atomic_set(&osb->vol_state, VOLUME_DISABLED);
1163 wake_up(&osb->osb_mount_event);
1164 ocfs2_free_replay_slots(osb);
1169 debugfs_remove_recursive(osb->osb_debug_root);
1171 ocfs2_release_system_inodes(osb);
1172 kfree(osb->recovery_map);
1173 ocfs2_delete_osb(osb);
1174 kfree(osb);
1387 * an osb to pass to
1472 struct ocfs2_super *osb = OCFS2_SB(root->d_sb);
1473 unsigned long opts = osb->s_mount_opt;
1503 if (osb->preferred_slot != OCFS2_INVALID_SLOT)
1504 seq_printf(s, ",preferred_slot=%d", osb->preferred_slot);
1506 seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
1508 if (osb->osb_commit_interval)
1510 (unsigned) (osb->osb_commit_interval / HZ));
1512 local_alloc_megs = osb->local_alloc_bits >> (20 - osb->s_clustersize_bits);
1513 if (local_alloc_megs != ocfs2_la_default_mb(osb))
1519 if (osb->osb_cluster_stack[0])
1520 seq_show_option(s, "cluster_stack", osb->osb_cluster_stack);
1544 if (osb->osb_resv_level != OCFS2_DEFAULT_RESV_LEVEL)
1545 seq_printf(s, ",resv_level=%d", osb->osb_resv_level);
1547 if (osb->osb_dir_resv_level != osb->osb_resv_level)
1548 seq_printf(s, ",dir_resv_level=%d", osb->osb_resv_level);
1613 struct ocfs2_super *osb;
1622 osb = OCFS2_SB(dentry->d_sb);
1624 inode = ocfs2_get_system_file_inode(osb,
1648 (osb->s_clustersize >> osb->sb->s_blocksize_bits);
1650 (osb->s_clustersize >> osb->sb->s_blocksize_bits);
1654 buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str, OCFS2_VOL_UUID_LEN)
1656 buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str + OCFS2_VOL_UUID_LEN,
1781 struct ocfs2_super *osb = OCFS2_SB(sb);
1783 if (ocfs2_is_hard_readonly(osb))
1786 mutex_init(&osb->obs_trim_fs_mutex);
1788 status = ocfs2_dlm_init(osb);
1791 if (status == -EBADR && ocfs2_userspace_stack(osb))
1797 status = ocfs2_super_lock(osb, 1);
1804 status = ocfs2_find_slot(osb);
1811 status = ocfs2_init_local_system_inodes(osb);
1817 status = ocfs2_check_volume(osb);
1823 status = ocfs2_truncate_log_init(osb);
1829 ocfs2_super_unlock(osb, 1);
1833 ocfs2_free_replay_slots(osb);
1835 if (osb->local_alloc_state == OCFS2_LA_ENABLED)
1836 ocfs2_shutdown_local_alloc(osb);
1837 ocfs2_release_system_inodes(osb);
1839 ocfs2_free_slot_info(osb);
1840 ocfs2_journal_shutdown(osb);
1842 ocfs2_super_unlock(osb, 1);
1844 ocfs2_dlm_shutdown(osb, 0);
1852 struct ocfs2_super *osb = NULL;
1858 osb = OCFS2_SB(sb);
1859 BUG_ON(!osb);
1863 ocfs2_filecheck_remove_sysfs(osb);
1865 kset_unregister(osb->osb_dev_kset);
1868 ocfs2_orphan_scan_stop(osb);
1870 ocfs2_disable_quotas(osb);
1873 WARN_ON(!llist_empty(&osb->dquot_drop_list));
1874 /* Wait for worker to be done with the work structure in osb */
1875 cancel_work_sync(&osb->dquot_drop_work);
1877 ocfs2_shutdown_local_alloc(osb);
1879 ocfs2_truncate_log_shutdown(osb);
1882 ocfs2_recovery_exit(osb);
1886 ocfs2_purge_refcount_trees(osb);
1890 if (osb->cconn) {
1891 tmp = ocfs2_super_lock(osb, 1);
1898 if (osb->slot_num != OCFS2_INVALID_SLOT)
1899 ocfs2_put_slot(osb);
1901 if (osb->cconn)
1902 ocfs2_super_unlock(osb, 1);
1904 ocfs2_release_system_inodes(osb);
1906 ocfs2_journal_shutdown(osb);
1914 if (!mnt_err && !ocfs2_mount_local(osb) && osb->uuid_str &&
1915 !ocfs2_is_hard_readonly(osb))
1918 ocfs2_dlm_shutdown(osb, hangup_needed);
1920 ocfs2_blockcheck_stats_debugfs_remove(&osb->osb_ecc_stats);
1921 debugfs_remove_recursive(osb->osb_debug_root);
1924 ocfs2_cluster_hangup(osb->uuid_str, strlen(osb->uuid_str));
1926 atomic_set(&osb->vol_state, VOLUME_DISMOUNTED);
1928 if (ocfs2_mount_local(osb))
1931 snprintf(nodestr, sizeof(nodestr), "%u", osb->node_num);
1934 osb->dev_str, nodestr);
1936 ocfs2_delete_osb(osb);
1937 kfree(osb);
1942 static int ocfs2_setup_osb_uuid(struct ocfs2_super *osb, const unsigned char *uuid,
1950 osb->uuid_str = kzalloc(OCFS2_VOL_UUID_LEN * 2 + 1, GFP_KERNEL);
1951 if (osb->uuid_str == NULL)
1954 for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) {
1969 static int ocfs2_journal_addressable(struct ocfs2_super *osb)
1973 ocfs2_clusters_to_blocks(osb->sb,
1974 osb->osb_clusters_at_boot) - 1;
1982 if (!(OCFS2_HAS_COMPAT_FEATURE(osb->sb,
1984 jbd2_journal_check_used_features(osb->journal->j_journal, 0, 0,
2005 struct ocfs2_super *osb;
2008 osb = kzalloc(sizeof(struct ocfs2_super), GFP_KERNEL);
2009 if (!osb) {
2015 sb->s_fs_info = osb;
2032 osb->osb_dx_mask = (1 << (cbits - bbits)) - 1;
2035 osb->osb_dx_seed[i] = le32_to_cpu(di->id2.i_super.s_dx_seed[i]);
2036 osb->osb_dx_seed[3] = le32_to_cpu(di->id2.i_super.s_uuid_hash);
2038 osb->sb = sb;
2039 osb->s_sectsize_bits = blksize_bits(sector_size);
2040 BUG_ON(!osb->s_sectsize_bits);
2042 spin_lock_init(&osb->dc_task_lock);
2043 init_waitqueue_head(&osb->dc_event);
2044 osb->dc_work_sequence = 0;
2045 osb->dc_wake_sequence = 0;
2046 INIT_LIST_HEAD(&osb->blocked_lock_list);
2047 osb->blocked_lock_count = 0;
2048 spin_lock_init(&osb->osb_lock);
2049 spin_lock_init(&osb->osb_xattr_lock);
2050 ocfs2_init_steal_slots(osb);
2052 mutex_init(&osb->system_file_mutex);
2054 atomic_set(&osb->alloc_stats.moves, 0);
2055 atomic_set(&osb->alloc_stats.local_data, 0);
2056 atomic_set(&osb->alloc_stats.bitmap_data, 0);
2057 atomic_set(&osb->alloc_stats.bg_allocs, 0);
2058 atomic_set(&osb->alloc_stats.bg_extends, 0);
2061 osb->osb_ecc_stats = *stats;
2063 ocfs2_init_node_maps(osb);
2065 snprintf(osb->dev_str, sizeof(osb->dev_str), "%u,%u",
2066 MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev));
2068 osb->max_slots = le16_to_cpu(di->id2.i_super.s_max_slots);
2069 if (osb->max_slots > OCFS2_MAX_SLOTS || osb->max_slots == 0) {
2071 osb->max_slots);
2076 ocfs2_orphan_scan_init(osb);
2078 status = ocfs2_recovery_init(osb);
2085 init_waitqueue_head(&osb->checkpoint_event);
2087 osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
2089 osb->slot_num = OCFS2_INVALID_SLOT;
2091 osb->s_xattr_inline_size = le16_to_cpu(
2094 osb->local_alloc_state = OCFS2_LA_UNUSED;
2095 osb->local_alloc_bh = NULL;
2096 INIT_DELAYED_WORK(&osb->la_enable_wq, ocfs2_la_enable_worker);
2098 init_waitqueue_head(&osb->osb_mount_event);
2100 ocfs2_resmap_init(osb, &osb->osb_la_resmap);
2102 osb->vol_label = kmalloc(OCFS2_MAX_VOL_LABEL_LEN, GFP_KERNEL);
2103 if (!osb->vol_label) {
2109 osb->slot_recovery_generations =
2110 kcalloc(osb->max_slots, sizeof(*osb->slot_recovery_generations),
2112 if (!osb->slot_recovery_generations) {
2118 init_waitqueue_head(&osb->osb_wipe_event);
2119 osb->osb_orphan_wipes = kcalloc(osb->max_slots,
2120 sizeof(*osb->osb_orphan_wipes),
2122 if (!osb->osb_orphan_wipes) {
2128 osb->osb_rf_lock_tree = RB_ROOT;
2130 osb->s_feature_compat =
2132 osb->s_feature_ro_compat =
2134 osb->s_feature_incompat =
2137 if ((i = OCFS2_HAS_INCOMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_INCOMPAT_SUPP))) {
2143 if (!sb_rdonly(osb->sb) && (i = OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP))) {
2150 if (ocfs2_clusterinfo_valid(osb)) {
2155 * because osb is allocated using kzalloc.
2157 osb->osb_stackflags =
2159 memcpy(osb->osb_cluster_stack,
2162 if (strlen(osb->osb_cluster_stack) != OCFS2_STACK_LABEL_LEN) {
2166 osb->osb_cluster_stack);
2170 memcpy(osb->osb_cluster_name,
2176 osb->osb_cluster_stack[0] = '\0';
2179 get_random_bytes(&osb->s_next_generation, sizeof(u32));
2186 status = ocfs2_journal_alloc(osb);
2190 INIT_WORK(&osb->dquot_drop_work, ocfs2_drop_dquot_refs);
2191 init_llist_head(&osb->dquot_drop_list);
2194 osb->s_clustersize_bits =
2196 osb->s_clustersize = 1 << osb->s_clustersize_bits;
2198 if (osb->s_clustersize < OCFS2_MIN_CLUSTERSIZE ||
2199 osb->s_clustersize > OCFS2_MAX_CLUSTERSIZE) {
2201 osb->s_clustersize);
2206 total_blocks = ocfs2_clusters_to_blocks(osb->sb,
2209 status = generic_check_addressable(osb->sb->s_blocksize_bits,
2218 if (ocfs2_setup_osb_uuid(osb, di->id2.i_super.s_uuid,
2225 strscpy(osb->vol_label, di->id2.i_super.s_label,
2227 osb->root_blkno = le64_to_cpu(di->id2.i_super.s_root_blkno);
2228 osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.s_system_dir_blkno);
2229 osb->first_cluster_group_blkno =
2231 osb->fs_generation = le32_to_cpu(di->i_fs_generation);
2232 osb->uuid_hash = le32_to_cpu(di->id2.i_super.s_uuid_hash);
2233 trace_ocfs2_initialize_super(osb->vol_label, osb->uuid_str,
2234 (unsigned long long)osb->root_blkno,
2235 (unsigned long long)osb->system_dir_blkno,
2236 osb->s_clustersize_bits);
2238 osb->osb_dlm_debug = ocfs2_new_dlm_debug();
2239 if (!osb->osb_dlm_debug) {
2245 atomic_set(&osb->vol_state, VOLUME_INIT);
2248 status = ocfs2_init_global_system_inodes(osb);
2257 inode = ocfs2_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE,
2265 osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;
2266 osb->osb_clusters_at_boot = OCFS2_I(inode)->ip_clusters;
2269 osb->bitmap_cpg = ocfs2_group_bitmap_size(sb, 0,
2270 osb->s_feature_incompat) * 8;
2272 status = ocfs2_init_slot_info(osb);
2278 osb->ocfs2_wq = alloc_ordered_workqueue("ocfs2_wq", WQ_MEM_RECLAIM);
2279 if (!osb->ocfs2_wq) {
2288 ocfs2_free_slot_info(osb);
2290 ocfs2_release_system_inodes(osb);
2292 ocfs2_put_dlm_debug(osb->osb_dlm_debug);
2294 kfree(osb->uuid_str);
2296 kfree(osb->journal);
2298 kfree(osb->osb_orphan_wipes);
2300 kfree(osb->slot_recovery_generations);
2302 kfree(osb->vol_label);
2304 kfree(osb->recovery_map);
2306 kfree(osb);
2382 static int ocfs2_check_volume(struct ocfs2_super *osb)
2392 status = ocfs2_journal_init(osb, &dirty);
2400 status = ocfs2_journal_addressable(osb);
2408 status = ocfs2_journal_wipe(osb->journal, 0);
2415 "unmounted cleanly, recovering it.\n", osb->dev_str);
2418 local = ocfs2_mount_local(osb);
2421 status = ocfs2_journal_load(osb->journal, local, dirty);
2427 if (osb->s_mount_opt & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
2428 jbd2_journal_set_features(osb->journal->j_journal,
2432 jbd2_journal_clear_features(osb->journal->j_journal,
2438 status = ocfs2_begin_local_alloc_recovery(osb,
2439 osb->slot_num,
2449 status = ocfs2_load_local_alloc(osb);
2458 osb->local_alloc_copy = local_alloc;
2465 status = ocfs2_mark_dead_nodes(osb);
2471 status = ocfs2_compute_replay_slots(osb);
2485 * volume is requested and the osb open count becomes 1.
2486 * It will remove the osb from the global list and also free up all the
2489 static void ocfs2_delete_osb(struct ocfs2_super *osb)
2491 /* This function assumes that the caller has the main osb resource */
2494 if (osb->ocfs2_wq)
2495 destroy_workqueue(osb->ocfs2_wq);
2497 ocfs2_free_slot_info(osb);
2499 kfree(osb->osb_orphan_wipes);
2500 kfree(osb->slot_recovery_generations);
2503 * allocate osb->journal at the middle of ocfs2_initialize_super(),
2506 kfree(osb->journal);
2507 kfree(osb->local_alloc_copy);
2508 kfree(osb->uuid_str);
2509 kfree(osb->vol_label);
2510 ocfs2_put_dlm_debug(osb->osb_dlm_debug);
2511 memset(osb, 0, sizeof(struct ocfs2_super));
2522 struct ocfs2_super *osb = OCFS2_SB(sb);
2525 ocfs2_set_osb_flag(osb, OCFS2_OSB_ERROR_FS);
2529 if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_PANIC) {
2532 } else if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_CONT) {
2537 if (sb_rdonly(sb) && (ocfs2_is_soft_readonly(osb) || ocfs2_is_hard_readonly(osb)))
2542 ocfs2_set_ro_flag(osb, 0);