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 | |
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')
-rw-r--r-- | fs/ocfs2/dlmglue.c | 3 | ||||
-rw-r--r-- | fs/ocfs2/journal.c | 5 | ||||
-rw-r--r-- | fs/ocfs2/ocfs2.h | 4 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 34 |
4 files changed, 4 insertions, 42 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 4acd37286bdd..762eb1fbb34d 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -2071,8 +2071,7 @@ int ocfs2_dlm_init(struct ocfs2_super *osb) | |||
2071 | } | 2071 | } |
2072 | 2072 | ||
2073 | /* launch vote thread */ | 2073 | /* launch vote thread */ |
2074 | osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote-%d", | 2074 | osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote"); |
2075 | osb->osb_id); | ||
2076 | if (IS_ERR(osb->vote_task)) { | 2075 | if (IS_ERR(osb->vote_task)) { |
2077 | status = PTR_ERR(osb->vote_task); | 2076 | status = PTR_ERR(osb->vote_task); |
2078 | osb->vote_task = NULL; | 2077 | osb->vote_task = NULL; |
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 910a601b2e98..f92bf1dd379a 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -784,8 +784,7 @@ int ocfs2_journal_load(struct ocfs2_journal *journal) | |||
784 | } | 784 | } |
785 | 785 | ||
786 | /* Launch the commit thread */ | 786 | /* Launch the commit thread */ |
787 | osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt-%d", | 787 | osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt"); |
788 | osb->osb_id); | ||
789 | if (IS_ERR(osb->commit_task)) { | 788 | if (IS_ERR(osb->commit_task)) { |
790 | status = PTR_ERR(osb->commit_task); | 789 | status = PTR_ERR(osb->commit_task); |
791 | osb->commit_task = NULL; | 790 | osb->commit_task = NULL; |
@@ -1118,7 +1117,7 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num) | |||
1118 | goto out; | 1117 | goto out; |
1119 | 1118 | ||
1120 | osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb, | 1119 | osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb, |
1121 | "ocfs2rec-%d", osb->osb_id); | 1120 | "ocfs2rec"); |
1122 | if (IS_ERR(osb->recovery_thread_task)) { | 1121 | if (IS_ERR(osb->recovery_thread_task)) { |
1123 | mlog_errno((int)PTR_ERR(osb->recovery_thread_task)); | 1122 | mlog_errno((int)PTR_ERR(osb->recovery_thread_task)); |
1124 | osb->recovery_thread_task = NULL; | 1123 | osb->recovery_thread_task = NULL; |
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index da1093039c01..cd4a6f253d13 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -184,7 +184,6 @@ struct ocfs2_journal; | |||
184 | struct ocfs2_journal_handle; | 184 | struct ocfs2_journal_handle; |
185 | struct ocfs2_super | 185 | struct ocfs2_super |
186 | { | 186 | { |
187 | u32 osb_id; /* id used by the proc interface */ | ||
188 | struct task_struct *commit_task; | 187 | struct task_struct *commit_task; |
189 | struct super_block *sb; | 188 | struct super_block *sb; |
190 | struct inode *root_inode; | 189 | struct inode *root_inode; |
@@ -222,13 +221,11 @@ struct ocfs2_super | |||
222 | unsigned long s_mount_opt; | 221 | unsigned long s_mount_opt; |
223 | 222 | ||
224 | u16 max_slots; | 223 | u16 max_slots; |
225 | u16 num_nodes; | ||
226 | s16 node_num; | 224 | s16 node_num; |
227 | s16 slot_num; | 225 | s16 slot_num; |
228 | int s_sectsize_bits; | 226 | int s_sectsize_bits; |
229 | int s_clustersize; | 227 | int s_clustersize; |
230 | int s_clustersize_bits; | 228 | int s_clustersize_bits; |
231 | struct proc_dir_entry *proc_sub_dir; /* points to /proc/fs/ocfs2/<maj_min> */ | ||
232 | 229 | ||
233 | atomic_t vol_state; | 230 | atomic_t vol_state; |
234 | struct mutex recovery_lock; | 231 | struct mutex recovery_lock; |
@@ -294,7 +291,6 @@ struct ocfs2_super | |||
294 | }; | 291 | }; |
295 | 292 | ||
296 | #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info) | 293 | #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info) |
297 | #define OCFS2_MAX_OSB_ID 65536 | ||
298 | 294 | ||
299 | static inline int ocfs2_should_order_data(struct inode *inode) | 295 | static inline int ocfs2_should_order_data(struct inode *inode) |
300 | { | 296 | { |
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; |