Skip to content

Commit 7842704

Browse files
author
Mark Fasheh
committed
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>
1 parent a75a6e4 commit 7842704

File tree

4 files changed

+4
-42
lines changed

4 files changed

+4
-42
lines changed

fs/ocfs2/dlmglue.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -2071,8 +2071,7 @@ int ocfs2_dlm_init(struct ocfs2_super *osb)
20712071
}
20722072

20732073
/* 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");
20762075
if (IS_ERR(osb->vote_task)) {
20772076
status = PTR_ERR(osb->vote_task);
20782077
osb->vote_task = NULL;

fs/ocfs2/journal.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,7 @@ int ocfs2_journal_load(struct ocfs2_journal *journal)
784784
}
785785

786786
/* 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");
789788
if (IS_ERR(osb->commit_task)) {
790789
status = PTR_ERR(osb->commit_task);
791790
osb->commit_task = NULL;
@@ -1118,7 +1117,7 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num)
11181117
goto out;
11191118

11201119
osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb,
1121-
"ocfs2rec-%d", osb->osb_id);
1120+
"ocfs2rec");
11221121
if (IS_ERR(osb->recovery_thread_task)) {
11231122
mlog_errno((int)PTR_ERR(osb->recovery_thread_task));
11241123
osb->recovery_thread_task = NULL;

fs/ocfs2/ocfs2.h

-4
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ struct ocfs2_journal;
184184
struct ocfs2_journal_handle;
185185
struct ocfs2_super
186186
{
187-
u32 osb_id; /* id used by the proc interface */
188187
struct task_struct *commit_task;
189188
struct super_block *sb;
190189
struct inode *root_inode;
@@ -222,13 +221,11 @@ struct ocfs2_super
222221
unsigned long s_mount_opt;
223222

224223
u16 max_slots;
225-
u16 num_nodes;
226224
s16 node_num;
227225
s16 slot_num;
228226
int s_sectsize_bits;
229227
int s_clustersize;
230228
int s_clustersize_bits;
231-
struct proc_dir_entry *proc_sub_dir; /* points to /proc/fs/ocfs2/<maj_min> */
232229

233230
atomic_t vol_state;
234231
struct mutex recovery_lock;
@@ -294,7 +291,6 @@ struct ocfs2_super
294291
};
295292

296293
#define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info)
297-
#define OCFS2_MAX_OSB_ID 65536
298294

299295
static inline int ocfs2_should_order_data(struct inode *inode)
300296
{

fs/ocfs2/super.c

+1-33
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@
6868

6969
#include "buffer_head_io.h"
7070

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-
7871
static kmem_cache_t *ocfs2_inode_cachep = NULL;
7972

8073
kmem_cache_t *ocfs2_lock_cache = NULL;
@@ -799,10 +792,6 @@ static int __init ocfs2_init(void)
799792
goto leave;
800793
}
801794

802-
spin_lock(&ocfs2_globals_lock);
803-
osb_id = 0;
804-
spin_unlock(&ocfs2_globals_lock);
805-
806795
ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
807796
if (!ocfs2_debugfs_root) {
808797
status = -EFAULT;
@@ -1211,8 +1200,6 @@ static int ocfs2_setup_osb_uuid(struct ocfs2_super *osb, const unsigned char *uu
12111200
if (osb->uuid_str == NULL)
12121201
return -ENOMEM;
12131202

1214-
memcpy(osb->uuid, uuid, OCFS2_VOL_UUID_LEN);
1215-
12161203
for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) {
12171204
/* print with null */
12181205
ret = snprintf(ptr, 3, "%02X", uuid[i]);
@@ -1310,13 +1297,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
13101297
goto bail;
13111298
}
13121299

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-
13201300
di = (struct ocfs2_dinode *)bh->b_data;
13211301

13221302
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,
14171397
goto bail;
14181398
}
14191399

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));
14211401
osb->net_key = le32_to_cpu(uuid_net_key);
14221402

14231403
strncpy(osb->vol_label, di->id2.i_super.s_label, 63);
@@ -1483,18 +1463,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
14831463
goto bail;
14841464
}
14851465

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-
14981466
bail:
14991467
mlog_exit(status);
15001468
return status;

0 commit comments

Comments
 (0)