Skip to content

Commit

Permalink
ocfs2: clean up some osb fields
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Fasheh committed Jun 29, 2006
1 parent a75a6e4 commit 7842704
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 42 deletions.
3 changes: 1 addition & 2 deletions fs/ocfs2/dlmglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,8 +2071,7 @@ int ocfs2_dlm_init(struct ocfs2_super *osb)
}

/* launch vote thread */
osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote-%d",
osb->osb_id);
osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote");
if (IS_ERR(osb->vote_task)) {
status = PTR_ERR(osb->vote_task);
osb->vote_task = NULL;
Expand Down
5 changes: 2 additions & 3 deletions fs/ocfs2/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,7 @@ int ocfs2_journal_load(struct ocfs2_journal *journal)
}

/* Launch the commit thread */
osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt-%d",
osb->osb_id);
osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt");
if (IS_ERR(osb->commit_task)) {
status = PTR_ERR(osb->commit_task);
osb->commit_task = NULL;
Expand Down Expand Up @@ -1118,7 +1117,7 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num)
goto out;

osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb,
"ocfs2rec-%d", osb->osb_id);
"ocfs2rec");
if (IS_ERR(osb->recovery_thread_task)) {
mlog_errno((int)PTR_ERR(osb->recovery_thread_task));
osb->recovery_thread_task = NULL;
Expand Down
4 changes: 0 additions & 4 deletions fs/ocfs2/ocfs2.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ struct ocfs2_journal;
struct ocfs2_journal_handle;
struct ocfs2_super
{
u32 osb_id; /* id used by the proc interface */
struct task_struct *commit_task;
struct super_block *sb;
struct inode *root_inode;
Expand Down Expand Up @@ -222,13 +221,11 @@ struct ocfs2_super
unsigned long s_mount_opt;

u16 max_slots;
u16 num_nodes;
s16 node_num;
s16 slot_num;
int s_sectsize_bits;
int s_clustersize;
int s_clustersize_bits;
struct proc_dir_entry *proc_sub_dir; /* points to /proc/fs/ocfs2/<maj_min> */

atomic_t vol_state;
struct mutex recovery_lock;
Expand Down Expand Up @@ -294,7 +291,6 @@ struct ocfs2_super
};

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

static inline int ocfs2_should_order_data(struct inode *inode)
{
Expand Down
34 changes: 1 addition & 33 deletions fs/ocfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@

#include "buffer_head_io.h"

/*
* Globals
*/
static spinlock_t ocfs2_globals_lock = SPIN_LOCK_UNLOCKED;

static u32 osb_id; /* Keeps track of next available OSB Id */

static kmem_cache_t *ocfs2_inode_cachep = NULL;

kmem_cache_t *ocfs2_lock_cache = NULL;
Expand Down Expand Up @@ -799,10 +792,6 @@ static int __init ocfs2_init(void)
goto leave;
}

spin_lock(&ocfs2_globals_lock);
osb_id = 0;
spin_unlock(&ocfs2_globals_lock);

ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
if (!ocfs2_debugfs_root) {
status = -EFAULT;
Expand Down Expand Up @@ -1211,8 +1200,6 @@ static int ocfs2_setup_osb_uuid(struct ocfs2_super *osb, const unsigned char *uu
if (osb->uuid_str == NULL)
return -ENOMEM;

memcpy(osb->uuid, uuid, OCFS2_VOL_UUID_LEN);

for (i = 0, ptr = osb->uuid_str; i < OCFS2_VOL_UUID_LEN; i++) {
/* print with null */
ret = snprintf(ptr, 3, "%02X", uuid[i]);
Expand Down Expand Up @@ -1310,13 +1297,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
goto bail;
}

osb->uuid = kmalloc(OCFS2_VOL_UUID_LEN, GFP_KERNEL);
if (!osb->uuid) {
mlog(ML_ERROR, "unable to alloc uuid\n");
status = -ENOMEM;
goto bail;
}

di = (struct ocfs2_dinode *)bh->b_data;

osb->max_slots = le16_to_cpu(di->id2.i_super.s_max_slots);
Expand Down Expand Up @@ -1417,7 +1397,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
goto bail;
}

memcpy(&uuid_net_key, osb->uuid, sizeof(uuid_net_key));
memcpy(&uuid_net_key, di->id2.i_super.s_uuid, sizeof(uuid_net_key));
osb->net_key = le32_to_cpu(uuid_net_key);

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

/* Link this osb onto the global linked list of all osb structures. */
/* The Global Link List is mainted for the whole driver . */
spin_lock(&ocfs2_globals_lock);
osb->osb_id = osb_id;
if (osb_id < OCFS2_MAX_OSB_ID)
osb_id++;
else {
mlog(ML_ERROR, "Too many volumes mounted\n");
status = -ENOMEM;
}
spin_unlock(&ocfs2_globals_lock);

bail:
mlog_exit(status);
return status;
Expand Down

0 comments on commit 7842704

Please sign in to comment.