[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/gfs-kernel/src/gfs Makefile lm.c mount ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso sourceware org	2006-07-11 17:29:24

Modified files:
	gfs-kernel/src/gfs: Makefile lm.c mount.c super.c sys.c 
Removed files:
	gfs-kernel/src/gfs: locking.c 

Log message:
	Reverse previous decision on locking.c.  Removed unwanted sysfs
	groups.  Removed some debug code.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/Makefile.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/lm.c.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/mount.c.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/super.c.diff?cvsroot=cluster&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/sys.c.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/locking.c.diff?cvsroot=cluster&r1=1.7&r2=NONE

--- cluster/gfs-kernel/src/gfs/Makefile	2006/07/11 14:19:34	1.11
+++ cluster/gfs-kernel/src/gfs/Makefile	2006/07/11 17:29:24	1.12
@@ -40,7 +40,6 @@
 	inode.o \
 	ioctl.o \
 	lm.o \
-	locking.o \
 	log.o \
 	lops.o \
 	lvb.o \
--- cluster/gfs-kernel/src/gfs/lm.c	2006/07/11 14:19:34	1.12
+++ cluster/gfs-kernel/src/gfs/lm.c	2006/07/11 17:29:24	1.13
@@ -24,16 +24,6 @@
 #include "util.h"
 #include "lvb.h"
 
-int gfs_mount_lockproto(char *proto_name, char *table_name, char *host_data,
-						lm_callback_t cb, lm_fsdata_t *fsdata,
-						unsigned int min_lvb_size, int flags,
-						struct lm_lockstruct *lockstruct,
-						struct kobject *fskobj);
-
-void gfs_unmount_lockproto(struct lm_lockstruct *lockstruct);
-
-void gfs_withdraw_lockproto(struct lm_lockstruct *lockstruct);
-
 /**
  * gfs_lm_mount - mount a locking protocol
  * @sdp: the filesystem
@@ -55,7 +45,7 @@
 
 	printk("Trying to join cluster \"%s\", \"%s\"\n", proto, table);
 
-	error = gfs_mount_lockproto(proto, table, sdp->sd_args.ar_hostdata,
+	error = gfs2_mount_lockproto(proto, table, sdp->sd_args.ar_hostdata,
 				     gfs_glock_cb, sdp,
 				     GFS_MIN_LVB_SIZE, flags,
 				     &sdp->sd_lockstruct, &sdp->sd_kobj);
@@ -69,7 +59,7 @@
 	    gfs_assert_warn(sdp, sdp->sd_lockstruct.ls_ops) ||
 	    gfs_assert_warn(sdp, sdp->sd_lockstruct.ls_lvb_size >=
 				  GFS_MIN_LVB_SIZE)) {
-		gfs_unmount_lockproto(&sdp->sd_lockstruct);
+		gfs2_unmount_lockproto(&sdp->sd_lockstruct);
 		goto out;
 	}
 
@@ -100,7 +90,7 @@
 void gfs_lm_unmount(struct gfs_sbd *sdp)
 {
 	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		gfs_unmount_lockproto(&sdp->sd_lockstruct);
+		gfs2_unmount_lockproto(&sdp->sd_lockstruct);
 }
 
 int gfs_lm_withdraw(struct gfs_sbd *sdp, char *fmt, ...)
@@ -124,7 +114,7 @@
 	   and all further io requests fail */
 
 	printk("telling LM to withdraw\n");
-	gfs_withdraw_lockproto(&sdp->sd_lockstruct);
+	gfs2_withdraw_lockproto(&sdp->sd_lockstruct);
 	printk("withdrawn\n");
 	dump_stack();
 
--- cluster/gfs-kernel/src/gfs/mount.c	2006/07/10 23:22:34	1.12
+++ cluster/gfs-kernel/src/gfs/mount.c	2006/07/11 17:29:24	1.13
@@ -95,7 +95,6 @@
 			}
 			strncpy(args->ar_hostdata, y, GFS_LOCKNAME_LEN);
 			args->ar_hostdata[GFS_LOCKNAME_LEN - 1] = 0;
-			printk("Bob says: hostdata=%s\n",args->ar_hostdata);
 		}
 
 		else if (!strcmp(x, "spectator"))
--- cluster/gfs-kernel/src/gfs/super.c	2006/07/10 23:22:34	1.18
+++ cluster/gfs-kernel/src/gfs/super.c	2006/07/11 17:29:24	1.19
@@ -903,15 +903,13 @@
 {
 	struct gfs_holder rgd_gh;
 	struct gfs_rgrpd *rgd;
-	int error,i=1;
+	int error;
 
 	memset(sg, 0, sizeof(struct gfs_stat_gfs));
 
 	for (rgd = gfs_rgrpd_get_first(sdp);
 	     rgd;
 	     rgd = gfs_rgrpd_get_next(rgd)) {
-		printk("Bob says: stat_gfs_sync i=%d addr=",i++);
-		printk("%llu\n",rgd->rd_ri.ri_addr);
 		for (;;) {
 			error = gfs_glock_nq_init(rgd->rd_gl,
 						  LM_ST_SHARED,
--- cluster/gfs-kernel/src/gfs/sys.c	2006/07/10 23:22:34	1.1
+++ cluster/gfs-kernel/src/gfs/sys.c	2006/07/11 17:29:24	1.2
@@ -34,9 +34,6 @@
 spinlock_t gfs_sys_margs_lock;
 spinlock_t req_lock;
 
-char *gfs_sys_margs;
-spinlock_t gfs_sys_margs_lock;
-
 static ssize_t id_show(struct gfs_sbd *sdp, char *buf)
 {
 	return sprintf(buf, "%s\n", sdp->sd_vfs->s_id);
@@ -65,103 +62,6 @@
 	NULL,
 };
 
-struct lockstruct_attr {
-	struct attribute attr;
-	ssize_t (*show)(struct gfs_sbd *, char *);
-};
-
-#define LOCKSTRUCT_ATTR(name, fmt)                                          \
-static ssize_t name##_show(struct gfs_sbd *sdp, char *buf)                 \
-{                                                                           \
-	return sprintf(buf, fmt, sdp->sd_lockstruct.ls_##name);             \
-}                                                                           \
-static struct lockstruct_attr lockstruct_attr_##name = __ATTR_RO(name)
-
-LOCKSTRUCT_ATTR(jid,      "%u\n");
-LOCKSTRUCT_ATTR(first,    "%u\n");
-LOCKSTRUCT_ATTR(lvb_size, "%u\n");
-LOCKSTRUCT_ATTR(flags,    "%d\n");
-
-static struct attribute *lockstruct_attrs[] = {
-	&lockstruct_attr_jid.attr,
-	&lockstruct_attr_first.attr,
-	&lockstruct_attr_lvb_size.attr,
-	&lockstruct_attr_flags.attr,
-	NULL
-};
-
-/*
- * display struct gfs_args fields
- */
-
-struct args_attr {
-	struct attribute attr;
-	ssize_t (*show)(struct gfs_sbd *, char *);
-};
-
-#define ARGS_ATTR(name, fmt)                                                \
-static ssize_t name##_show(struct gfs_sbd *sdp, char *buf)                 \
-{                                                                           \
-	return sprintf(buf, fmt, sdp->sd_args.ar_##name);                   \
-}                                                                           \
-static struct args_attr args_attr_##name = __ATTR_RO(name)
-
-ARGS_ATTR(lockproto,       "%s\n");
-ARGS_ATTR(locktable,       "%s\n");
-ARGS_ATTR(hostdata,        "%s\n");
-ARGS_ATTR(spectator,       "%d\n");
-ARGS_ATTR(ignore_local_fs, "%d\n");
-ARGS_ATTR(localcaching,    "%d\n");
-ARGS_ATTR(localflocks,     "%d\n");
-ARGS_ATTR(debug,           "%d\n");
-ARGS_ATTR(upgrade,         "%d\n");
-ARGS_ATTR(num_glockd,      "%u\n");
-ARGS_ATTR(suiddir,         "%d\n");
-
-static struct attribute *args_attrs[] = {
-	&args_attr_lockproto.attr,
-	&args_attr_locktable.attr,
-	&args_attr_hostdata.attr,
-	&args_attr_spectator.attr,
-	&args_attr_ignore_local_fs.attr,
-	&args_attr_localcaching.attr,
-	&args_attr_localflocks.attr,
-	&args_attr_debug.attr,
-	&args_attr_upgrade.attr,
-	&args_attr_num_glockd.attr,
-	&args_attr_suiddir.attr,
-	NULL
-};
-
-/*
- * display counters from superblock
- */
-
-struct counters_attr {
-	struct attribute attr;
-	ssize_t (*show)(struct gfs_sbd *, char *);
-};
-
-#define COUNTERS_ATTR(name, fmt)                                            \
-static ssize_t name##_show(struct gfs_sbd *sdp, char *buf)                 \
-{                                                                           \
-	return sprintf(buf, fmt, (unsigned int)atomic_read(&sdp->sd_##name)); \
-}                                                                           \
-static struct counters_attr counters_attr_##name = __ATTR_RO(name)
-
-COUNTERS_ATTR(glock_count,      "%u\n");
-COUNTERS_ATTR(glock_held_count, "%u\n");
-COUNTERS_ATTR(inode_count,      "%u\n");
-COUNTERS_ATTR(reclaimed,        "%u\n");
-
-static struct attribute *counters_attrs[] = {
-	&counters_attr_glock_count.attr,
-	&counters_attr_glock_held_count.attr,
-	&counters_attr_inode_count.attr,
-	&counters_attr_reclaimed.attr,
-	NULL
-};
-
 static ssize_t gfs_attr_show(struct kobject *kobj, struct attribute *attr,
 			      char *buf)
 {
@@ -194,143 +94,6 @@
 	.ktype  = &gfs_ktype,
 };
 
-static ssize_t tune_set(struct gfs_sbd *sdp, unsigned int *field,
-			int check_zero, const char *buf, size_t len)
-{
-	struct gfs_tune *gt = &sdp->sd_tune;
-	unsigned int x;
-
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-
-	x = simple_strtoul(buf, NULL, 0);
-
-	if (check_zero && !x)
-		return -EINVAL;
-
-	spin_lock(&gt->gt_spin);
-	*field = x;
-	spin_unlock(&gt->gt_spin);
-	return len;
-}
-
-struct tune_attr {
-	struct attribute attr;
-	ssize_t (*show)(struct gfs_sbd *, char *);
-	ssize_t (*store)(struct gfs_sbd *, const char *, size_t);
-};
-
-#define TUNE_ATTR_3(name, show, store)                                        \
-static struct tune_attr tune_attr_##name = __ATTR(name, 0644, show, store)
-
-#define TUNE_ATTR_2(name, store)                                              \
-static ssize_t name##_show(struct gfs_sbd *sdp, char *buf)                   \
-{                                                                             \
-	return sprintf(buf, "%u\n", sdp->sd_tune.gt_##name);                  \
-}                                                                             \
-TUNE_ATTR_3(name, name##_show, store)
-
-#define TUNE_ATTR(name, check_zero)                                           \
-static ssize_t name##_store(struct gfs_sbd *sdp, const char *buf, size_t len)\
-{                                                                             \
-	return tune_set(sdp, &sdp->sd_tune.gt_##name, check_zero, buf, len);  \
-}                                                                             \
-TUNE_ATTR_2(name, name##_store)
-
-#define TUNE_ATTR_DAEMON(name, process)                                       \
-static ssize_t name##_store(struct gfs_sbd *sdp, const char *buf, size_t len)\
-{                                                                             \
-	ssize_t r = tune_set(sdp, &sdp->sd_tune.gt_##name, 1, buf, len);      \
-	wake_up_process(sdp->sd_##process);                                   \
-	return r;                                                             \
-}                                                                             \
-TUNE_ATTR_2(name, name##_store)
-
-TUNE_ATTR(ilimit1, 0);
-TUNE_ATTR(ilimit1_tries, 0);
-TUNE_ATTR(ilimit1_min, 0);
-TUNE_ATTR(ilimit2, 0);
-TUNE_ATTR(ilimit2_tries, 0);
-TUNE_ATTR(ilimit2_min, 0);
-TUNE_ATTR(demote_secs, 0);
-TUNE_ATTR(incore_log_blocks, 0);
-TUNE_ATTR(jindex_refresh_secs, 0);
-TUNE_ATTR(quota_warn_period, 0);
-TUNE_ATTR(quota_quantum, 0);
-TUNE_ATTR(atime_quantum, 0);
-TUNE_ATTR(max_readahead, 0);
-TUNE_ATTR(complain_secs, 0);
-TUNE_ATTR(reclaim_limit, 0);
-TUNE_ATTR(prefetch_secs, 0);
-TUNE_ATTR(statfs_slots, 0);
-TUNE_ATTR(new_files_jdata, 0);
-TUNE_ATTR(new_files_directio, 0);
-TUNE_ATTR(quota_simul_sync, 1);
-TUNE_ATTR(max_atomic_write, 1);
-TUNE_ATTR(stall_secs, 1);
-TUNE_ATTR(entries_per_readdir, 1);
-TUNE_ATTR(greedy_default, 1);
-TUNE_ATTR(greedy_quantum, 1);
-TUNE_ATTR(greedy_max, 1);
-TUNE_ATTR_DAEMON(scand_secs, scand_process);
-TUNE_ATTR_DAEMON(recoverd_secs, recoverd_process);
-TUNE_ATTR_DAEMON(logd_secs, logd_process);
-TUNE_ATTR_DAEMON(quotad_secs, quotad_process);
-
-static struct attribute *tune_attrs[] = {
-	&tune_attr_ilimit1.attr,
-	&tune_attr_ilimit1_tries.attr,
-	&tune_attr_ilimit1_min.attr,
-	&tune_attr_ilimit2.attr,
-	&tune_attr_ilimit2_tries.attr,
-	&tune_attr_ilimit2_min.attr,
-	&tune_attr_demote_secs.attr,
-	&tune_attr_incore_log_blocks.attr,
-	&tune_attr_jindex_refresh_secs.attr,
-	&tune_attr_quota_warn_period.attr,
-	&tune_attr_quota_quantum.attr,
-	&tune_attr_atime_quantum.attr,
-	&tune_attr_max_readahead.attr,
-	&tune_attr_complain_secs.attr,
-	&tune_attr_reclaim_limit.attr,
-	&tune_attr_prefetch_secs.attr,
-	&tune_attr_statfs_slots.attr,
-	&tune_attr_quota_simul_sync.attr,
-	&tune_attr_max_atomic_write.attr,
-	&tune_attr_stall_secs.attr,
-	&tune_attr_entries_per_readdir.attr,
-	&tune_attr_greedy_default.attr,
-	&tune_attr_greedy_quantum.attr,
-	&tune_attr_greedy_max.attr,
-	&tune_attr_scand_secs.attr,
-	&tune_attr_recoverd_secs.attr,
-	&tune_attr_logd_secs.attr,
-	&tune_attr_quotad_secs.attr,
-	&tune_attr_new_files_jdata.attr,
-	&tune_attr_new_files_directio.attr,
-	NULL
-};
-
-static struct attribute_group lockstruct_group = {
-	.name = "lockstruct",
-	.attrs = lockstruct_attrs
-};
-
-static struct attribute_group counters_group = {
-	.name = "counters",
-	.attrs = counters_attrs
-};
-
-static struct attribute_group args_group = {
-	.name = "args",
-	.attrs = args_attrs
-};
-
-static struct attribute_group tune_group = {
-	.name = "tune",
-	.attrs = tune_attrs
-};
-
 int gfs_sys_fs_add(struct gfs_sbd *sdp)
 {
 	int error;
@@ -346,41 +109,14 @@
 	if (error)
 		goto fail;
 
-	error = sysfs_create_group(&sdp->sd_kobj, &lockstruct_group);
-	if (error)
-		goto fail_reg;
-
-	error = sysfs_create_group(&sdp->sd_kobj, &counters_group);
-	if (error)
-		goto fail_lockstruct;
-
-	error = sysfs_create_group(&sdp->sd_kobj, &args_group);
-	if (error)
-		goto fail_counters;
-	
-	error = sysfs_create_group(&sdp->sd_kobj, &tune_group);
-	if (error)
-		goto fail_args;
 	return 0;
 
- fail_args:
-	sysfs_remove_group(&sdp->sd_kobj, &args_group);
- fail_counters:
-	sysfs_remove_group(&sdp->sd_kobj, &counters_group);
- fail_lockstruct:
-	sysfs_remove_group(&sdp->sd_kobj, &lockstruct_group);
- fail_reg:
-	kobject_unregister(&sdp->sd_kobj);
  fail:
 	return error;
 }
 
 void gfs_sys_fs_del(struct gfs_sbd *sdp)
 {
-	sysfs_remove_group(&sdp->sd_kobj, &tune_group);
-	sysfs_remove_group(&sdp->sd_kobj, &args_group);
-	sysfs_remove_group(&sdp->sd_kobj, &counters_group);
-	sysfs_remove_group(&sdp->sd_kobj, &lockstruct_group);
 	kobject_unregister(&sdp->sd_kobj);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]