aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c49
1 files changed, 8 insertions, 41 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index cdf73393f094..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 */
74static spinlock_t ocfs2_globals_lock = SPIN_LOCK_UNLOCKED;
75
76static u32 osb_id; /* Keeps track of next available OSB Id */
77
78static kmem_cache_t *ocfs2_inode_cachep = NULL; 71static kmem_cache_t *ocfs2_inode_cachep = NULL;
79 72
80kmem_cache_t *ocfs2_lock_cache = NULL; 73kmem_cache_t *ocfs2_lock_cache = NULL;
@@ -642,10 +635,9 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
642 635
643 ocfs2_complete_mount_recovery(osb); 636 ocfs2_complete_mount_recovery(osb);
644 637
645 printk("ocfs2: Mounting device (%u,%u) on (node %d, slot %d) with %s " 638 printk(KERN_INFO "ocfs2: Mounting device (%s) on (node %d, slot %d) "
646 "data mode.\n", 639 "with %s data mode.\n",
647 MAJOR(sb->s_dev), MINOR(sb->s_dev), osb->node_num, 640 osb->dev_str, osb->node_num, osb->slot_num,
648 osb->slot_num,
649 osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK ? "writeback" : 641 osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK ? "writeback" :
650 "ordered"); 642 "ordered");
651 643
@@ -800,10 +792,6 @@ static int __init ocfs2_init(void)
800 goto leave; 792 goto leave;
801 } 793 }
802 794
803 spin_lock(&ocfs2_globals_lock);
804 osb_id = 0;
805 spin_unlock(&ocfs2_globals_lock);
806
807 ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL); 795 ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
808 if (!ocfs2_debugfs_root) { 796 if (!ocfs2_debugfs_root) {
809 status = -EFAULT; 797 status = -EFAULT;
@@ -1020,7 +1008,7 @@ static int ocfs2_fill_local_node_info(struct ocfs2_super *osb)
1020 goto bail; 1008 goto bail;
1021 } 1009 }
1022 1010
1023 mlog(ML_NOTICE, "I am node %d\n", osb->node_num); 1011 mlog(0, "I am node %d\n", osb->node_num);
1024 1012
1025 status = 0; 1013 status = 0;
1026bail: 1014bail:
@@ -1191,8 +1179,8 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err)
1191 1179
1192 atomic_set(&osb->vol_state, VOLUME_DISMOUNTED); 1180 atomic_set(&osb->vol_state, VOLUME_DISMOUNTED);
1193 1181
1194 printk("ocfs2: Unmounting device (%u,%u) on (node %d)\n", 1182 printk(KERN_INFO "ocfs2: Unmounting device (%s) on (node %d)\n",
1195 MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev), osb->node_num); 1183 osb->dev_str, osb->node_num);
1196 1184
1197 ocfs2_delete_osb(osb); 1185 ocfs2_delete_osb(osb);
1198 kfree(osb); 1186 kfree(osb);
@@ -1212,8 +1200,6 @@ static int ocfs2_setup_osb_uuid(struct ocfs2_super *osb, const unsigned char *uu
1212 if (osb->uuid_str == NULL) 1200 if (osb->uuid_str == NULL)
1213 return -ENOMEM; 1201 return -ENOMEM;
1214 1202
1215 memcpy(osb->uuid, uuid, OCFS2_VOL_UUID_LEN);
1216
1217 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++) {
1218 /* print with null */ 1204 /* print with null */
1219 ret = snprintf(ptr, 3, "%02X", uuid[i]); 1205 ret = snprintf(ptr, 3, "%02X", uuid[i]);
@@ -1311,13 +1297,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
1311 goto bail; 1297 goto bail;
1312 } 1298 }
1313 1299
1314 osb->uuid = kmalloc(OCFS2_VOL_UUID_LEN, GFP_KERNEL);
1315 if (!osb->uuid) {
1316 mlog(ML_ERROR, "unable to alloc uuid\n");
1317 status = -ENOMEM;
1318 goto bail;
1319 }
1320
1321 di = (struct ocfs2_dinode *)bh->b_data; 1300 di = (struct ocfs2_dinode *)bh->b_data;
1322 1301
1323 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);
@@ -1327,7 +1306,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
1327 status = -EINVAL; 1306 status = -EINVAL;
1328 goto bail; 1307 goto bail;
1329 } 1308 }
1330 mlog(ML_NOTICE, "max_slots for this device: %u\n", osb->max_slots); 1309 mlog(0, "max_slots for this device: %u\n", osb->max_slots);
1331 1310
1332 init_waitqueue_head(&osb->osb_wipe_event); 1311 init_waitqueue_head(&osb->osb_wipe_event);
1333 osb->osb_orphan_wipes = kcalloc(osb->max_slots, 1312 osb->osb_orphan_wipes = kcalloc(osb->max_slots,
@@ -1418,7 +1397,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
1418 goto bail; 1397 goto bail;
1419 } 1398 }
1420 1399
1421 memcpy(&uuid_net_key, &osb->uuid[i], sizeof(osb->net_key)); 1400 memcpy(&uuid_net_key, di->id2.i_super.s_uuid, sizeof(uuid_net_key));
1422 osb->net_key = le32_to_cpu(uuid_net_key); 1401 osb->net_key = le32_to_cpu(uuid_net_key);
1423 1402
1424 strncpy(osb->vol_label, di->id2.i_super.s_label, 63); 1403 strncpy(osb->vol_label, di->id2.i_super.s_label, 63);
@@ -1484,18 +1463,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
1484 goto bail; 1463 goto bail;
1485 } 1464 }
1486 1465
1487 /* Link this osb onto the global linked list of all osb structures. */
1488 /* The Global Link List is mainted for the whole driver . */
1489 spin_lock(&ocfs2_globals_lock);
1490 osb->osb_id = osb_id;
1491 if (osb_id < OCFS2_MAX_OSB_ID)
1492 osb_id++;
1493 else {
1494 mlog(ML_ERROR, "Too many volumes mounted\n");
1495 status = -ENOMEM;
1496 }
1497 spin_unlock(&ocfs2_globals_lock);
1498
1499bail: 1466bail:
1500 mlog_exit(status); 1467 mlog_exit(status);
1501 return status; 1468 return status;