|
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 @@ static int __init ocfs2_init(void)
|
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 @@ static int ocfs2_setup_osb_uuid(struct ocfs2_super *osb, const unsigned char *uu
|
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 @@ static int ocfs2_initialize_super(struct super_block *sb,
|
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 @@ static int ocfs2_initialize_super(struct super_block *sb,
|
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);
|
@@ -1483,18 +1463,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
|
1483 | 1463 | goto bail;
|
1484 | 1464 | }
|
1485 | 1465 |
|
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 |
| - |
1498 | 1466 | bail:
|
1499 | 1467 | mlog_exit(status);
|
1500 | 1468 | return status;
|
|
0 commit comments