Commit 784270435b001164054e803421a624ef1098519d

Authored by Mark Fasheh
1 parent a75a6e4c3a

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>

Showing 4 changed files with 4 additions and 42 deletions Side-by-side Diff

... ... @@ -2071,8 +2071,7 @@
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;
... ... @@ -784,8 +784,7 @@
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;
... ... @@ -1118,7 +1117,7 @@
1118 1117 goto out;
1119 1118  
1120 1119 osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb,
1121   - "ocfs2rec-%d", osb->osb_id);
  1120 + "ocfs2rec");
1122 1121 if (IS_ERR(osb->recovery_thread_task)) {
1123 1122 mlog_errno((int)PTR_ERR(osb->recovery_thread_task));
1124 1123 osb->recovery_thread_task = NULL;
... ... @@ -184,7 +184,6 @@
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;
191 190  
... ... @@ -222,13 +221,11 @@
222 221 unsigned long s_mount_opt;
223 222  
224 223 u16 max_slots;
225   - u16 num_nodes;
226 224 s16 node_num;
227 225 s16 slot_num;
228 226 int s_sectsize_bits;
229 227 int s_clustersize;
230 228 int s_clustersize_bits;
231   - struct proc_dir_entry *proc_sub_dir; /* points to /proc/fs/ocfs2/<maj_min> */
232 229  
233 230 atomic_t vol_state;
234 231 struct mutex recovery_lock;
... ... @@ -294,7 +291,6 @@
294 291 };
295 292  
296 293 #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info)
297   -#define OCFS2_MAX_OSB_ID 65536
298 294  
299 295 static inline int ocfs2_should_order_data(struct inode *inode)
300 296 {
... ... @@ -68,13 +68,6 @@
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;
... ... @@ -799,10 +792,6 @@
799 792 goto leave;
800 793 }
801 794  
802   - spin_lock(&ocfs2_globals_lock);
803   - osb_id = 0;
804   - spin_unlock(&ocfs2_globals_lock);
805   -
806 795 ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
807 796 if (!ocfs2_debugfs_root) {
808 797 status = -EFAULT;
... ... @@ -1211,8 +1200,6 @@
1211 1200 if (osb->uuid_str == NULL)
1212 1201 return -ENOMEM;
1213 1202  
1214   - memcpy(osb->uuid, uuid, OCFS2_VOL_UUID_LEN);
1215   -
1216 1203 for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) {
1217 1204 /* print with null */
1218 1205 ret = snprintf(ptr, 3, "%02X", uuid[i]);
... ... @@ -1310,13 +1297,6 @@
1310 1297 goto bail;
1311 1298 }
1312 1299  
1313   - osb->uuid = kmalloc(OCFS2_VOL_UUID_LEN, GFP_KERNEL);
1314   - if (!osb->uuid) {
1315   - mlog(ML_ERROR, "unable to alloc uuid\n");
1316   - status = -ENOMEM;
1317   - goto bail;
1318   - }
1319   -
1320 1300 di = (struct ocfs2_dinode *)bh->b_data;
1321 1301  
1322 1302 osb->max_slots = le16_to_cpu(di->id2.i_super.s_max_slots);
... ... @@ -1417,7 +1397,7 @@
1417 1397 goto bail;
1418 1398 }
1419 1399  
1420   - memcpy(&uuid_net_key, osb->uuid, sizeof(uuid_net_key));
  1400 + memcpy(&uuid_net_key, di->id2.i_super.s_uuid, sizeof(uuid_net_key));
1421 1401 osb->net_key = le32_to_cpu(uuid_net_key);
1422 1402  
1423 1403 strncpy(osb->vol_label, di->id2.i_super.s_label, 63);
... ... @@ -1482,18 +1462,6 @@
1482 1462 mlog_errno(status);
1483 1463 goto bail;
1484 1464 }
1485   -
1486   - /* Link this osb onto the global linked list of all osb structures. */
1487   - /* The Global Link List is mainted for the whole driver . */
1488   - spin_lock(&ocfs2_globals_lock);
1489   - osb->osb_id = osb_id;
1490   - if (osb_id < OCFS2_MAX_OSB_ID)
1491   - osb_id++;
1492   - else {
1493   - mlog(ML_ERROR, "Too many volumes mounted\n");
1494   - status = -ENOMEM;
1495   - }
1496   - spin_unlock(&ocfs2_globals_lock);
1497 1465  
1498 1466 bail:
1499 1467 mlog_exit(status);