diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2006-05-04 15:03:26 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-06-29 19:10:13 -0400 |
commit | 784270435b001164054e803421a624ef1098519d (patch) | |
tree | f26fec7ca476439f770fd24e5c7ec11039302b37 /fs/ocfs2/super.c | |
parent | a75a6e4c3ada10b15e26f6d12f72c03efde266e0 (diff) |
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>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 3aa9f18527f0..382706a67ffd 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -68,13 +68,6 @@ | |||
68 | 68 | ||
69 | #include "buffer_head_io.h" | 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 | static kmem_cache_t *ocfs2_inode_cachep = NULL; | 71 | static kmem_cache_t *ocfs2_inode_cachep = NULL; |
79 | 72 | ||
80 | kmem_cache_t *ocfs2_lock_cache = NULL; | 73 | kmem_cache_t *ocfs2_lock_cache = NULL; |
@@ -799,10 +792,6 @@ static int __init ocfs2_init(void) | |||
799 | goto leave; | 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 | ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL); | 795 | ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL); |
807 | if (!ocfs2_debugfs_root) { | 796 | if (!ocfs2_debugfs_root) { |
808 | status = -EFAULT; | 797 | status = -EFAULT; |
@@ -1211,8 +1200,6 @@ static int ocfs2_setup_osb_uuid(struct ocfs2_super *osb, const unsigned char *uu | |||
1211 | if (osb->uuid_str == NULL) | 1200 | if (osb->uuid_str == NULL) |
1212 | return -ENOMEM; | 1201 | return -ENOMEM; |
1213 | 1202 | ||
1214 | memcpy(osb->uuid, uuid, OCFS2_VOL_UUID_LEN); | ||
1215 | |||
1216 | for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) { | 1203 | for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) { |
1217 | /* print with null */ | 1204 | /* print with null */ |
1218 | ret = snprintf(ptr, 3, "%02X", uuid[i]); | 1205 | ret = snprintf(ptr, 3, "%02X", uuid[i]); |
@@ -1310,13 +1297,6 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
1310 | goto bail; | 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 | di = (struct ocfs2_dinode *)bh->b_data; | 1300 | di = (struct ocfs2_dinode *)bh->b_data; |
1321 | 1301 | ||
1322 | osb->max_slots = le16_to_cpu(di->id2.i_super.s_max_slots); | 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 | goto bail; | 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 | osb->net_key = le32_to_cpu(uuid_net_key); | 1401 | osb->net_key = le32_to_cpu(uuid_net_key); |
1422 | 1402 | ||
1423 | strncpy(osb->vol_label, di->id2.i_super.s_label, 63); | 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 | goto bail; | 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 | bail: | 1466 | bail: |
1499 | mlog_exit(status); | 1467 | mlog_exit(status); |
1500 | return status; | 1468 | return status; |