ocfs2: clean up some osb fields

Get rid of osb->uuid, osb->proc_sub_dir, and osb->osb_id. Those fields were
unused, or could easily be removed. As a result, we also no longer need
MAX_OSB_ID or ocfs2_globals_lock.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>

+4 -42
+1 -2
fs/ocfs2/dlmglue.c
··· 2071 2071 } 2072 2072 2073 2073 /* launch vote thread */ 2074 - osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote-%d", 2075 - osb->osb_id); 2074 + osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote"); 2076 2075 if (IS_ERR(osb->vote_task)) { 2077 2076 status = PTR_ERR(osb->vote_task); 2078 2077 osb->vote_task = NULL;
+2 -3
fs/ocfs2/journal.c
··· 784 784 } 785 785 786 786 /* Launch the commit thread */ 787 - osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt-%d", 788 - osb->osb_id); 787 + osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt"); 789 788 if (IS_ERR(osb->commit_task)) { 790 789 status = PTR_ERR(osb->commit_task); 791 790 osb->commit_task = NULL; ··· 1117 1118 goto out; 1118 1119 1119 1120 osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb, 1120 - "ocfs2rec-%d", osb->osb_id); 1121 + "ocfs2rec"); 1121 1122 if (IS_ERR(osb->recovery_thread_task)) { 1122 1123 mlog_errno((int)PTR_ERR(osb->recovery_thread_task)); 1123 1124 osb->recovery_thread_task = NULL;
-4
fs/ocfs2/ocfs2.h
··· 184 184 struct ocfs2_journal_handle; 185 185 struct ocfs2_super 186 186 { 187 - u32 osb_id; /* id used by the proc interface */ 188 187 struct task_struct *commit_task; 189 188 struct super_block *sb; 190 189 struct inode *root_inode; ··· 221 222 unsigned long s_mount_opt; 222 223 223 224 u16 max_slots; 224 - u16 num_nodes; 225 225 s16 node_num; 226 226 s16 slot_num; 227 227 int s_sectsize_bits; 228 228 int s_clustersize; 229 229 int s_clustersize_bits; 230 - struct proc_dir_entry *proc_sub_dir; /* points to /proc/fs/ocfs2/<maj_min> */ 231 230 232 231 atomic_t vol_state; 233 232 struct mutex recovery_lock; ··· 291 294 }; 292 295 293 296 #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info) 294 - #define OCFS2_MAX_OSB_ID 65536 295 297 296 298 static inline int ocfs2_should_order_data(struct inode *inode) 297 299 {
+1 -33
fs/ocfs2/super.c
··· 68 68 69 69 #include "buffer_head_io.h" 70 70 71 - /* 72 - * Globals 73 - */ 74 - static spinlock_t ocfs2_globals_lock = SPIN_LOCK_UNLOCKED; 75 - 76 - static u32 osb_id; /* Keeps track of next available OSB Id */ 77 - 78 71 static kmem_cache_t *ocfs2_inode_cachep = NULL; 79 72 80 73 kmem_cache_t *ocfs2_lock_cache = NULL; ··· 792 799 goto leave; 793 800 } 794 801 795 - spin_lock(&ocfs2_globals_lock); 796 - osb_id = 0; 797 - spin_unlock(&ocfs2_globals_lock); 798 - 799 802 ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL); 800 803 if (!ocfs2_debugfs_root) { 801 804 status = -EFAULT; ··· 1200 1211 if (osb->uuid_str == NULL) 1201 1212 return -ENOMEM; 1202 1213 1203 - memcpy(osb->uuid, uuid, OCFS2_VOL_UUID_LEN); 1204 - 1205 1214 for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) { 1206 1215 /* print with null */ 1207 1216 ret = snprintf(ptr, 3, "%02X", uuid[i]); ··· 1293 1306 osb->vol_label = kmalloc(OCFS2_MAX_VOL_LABEL_LEN, GFP_KERNEL); 1294 1307 if (!osb->vol_label) { 1295 1308 mlog(ML_ERROR, "unable to alloc vol label\n"); 1296 - status = -ENOMEM; 1297 - goto bail; 1298 - } 1299 - 1300 - osb->uuid = kmalloc(OCFS2_VOL_UUID_LEN, GFP_KERNEL); 1301 - if (!osb->uuid) { 1302 - mlog(ML_ERROR, "unable to alloc uuid\n"); 1303 1309 status = -ENOMEM; 1304 1310 goto bail; 1305 1311 } ··· 1397 1417 goto bail; 1398 1418 } 1399 1419 1400 - memcpy(&uuid_net_key, osb->uuid, sizeof(uuid_net_key)); 1420 + memcpy(&uuid_net_key, di->id2.i_super.s_uuid, sizeof(uuid_net_key)); 1401 1421 osb->net_key = le32_to_cpu(uuid_net_key); 1402 1422 1403 1423 strncpy(osb->vol_label, di->id2.i_super.s_label, 63); ··· 1462 1482 mlog_errno(status); 1463 1483 goto bail; 1464 1484 } 1465 - 1466 - /* Link this osb onto the global linked list of all osb structures. */ 1467 - /* The Global Link List is mainted for the whole driver . */ 1468 - spin_lock(&ocfs2_globals_lock); 1469 - osb->osb_id = osb_id; 1470 - if (osb_id < OCFS2_MAX_OSB_ID) 1471 - osb_id++; 1472 - else { 1473 - mlog(ML_ERROR, "Too many volumes mounted\n"); 1474 - status = -ENOMEM; 1475 - } 1476 - spin_unlock(&ocfs2_globals_lock); 1477 1485 1478 1486 bail: 1479 1487 mlog_exit(status);