From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/gfs_controld lock_dlm.h recover.c
Date: 19 Dec 2006 17:07:12 -0000 [thread overview]
Message-ID: <20061219170712.28330.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: teigland at sourceware.org 2006-12-19 17:07:12
Modified files:
group/gfs_controld: lock_dlm.h recover.c
Log message:
revert last checkin
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/lock_dlm.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21.2.4&r2=1.21.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/recover.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.23.2.2&r2=1.23.2.3
--- cluster/group/gfs_controld/lock_dlm.h 2006/12/19 01:46:47 1.21.2.4
+++ cluster/group/gfs_controld/lock_dlm.h 2006/12/19 17:07:12 1.21.2.5
@@ -113,11 +113,6 @@
} \
}
-struct mountpoint {
- struct list_head list;
- char dir[MAXNAME+1];
-};
-
struct mountgroup {
struct list_head list;
uint32_t id;
@@ -129,7 +124,7 @@
char name[MAXNAME+1];
char table[MAXNAME+1];
char type[5];
- struct list_head mntpoints;
+ char dir[PATH_MAX+1];
char options[MAX_OPTIONS_LEN+1];
char dev[PATH_MAX+1];
--- cluster/group/gfs_controld/recover.c 2006/12/19 01:46:47 1.23.2.2
+++ cluster/group/gfs_controld/recover.c 2006/12/19 17:07:12 1.23.2.3
@@ -28,8 +28,6 @@
void start_spectator_init_2(struct mountgroup *mg);
void start_spectator_2(struct mountgroup *mg);
void notify_mount_client(struct mountgroup *mg);
-int do_finish(struct mountgroup *mg);
-int do_terminate(struct mountgroup *mg);
int set_sysfs(struct mountgroup *mg, char *field, int val)
{
@@ -1470,13 +1468,10 @@
struct mountgroup *find_mg_dir(char *dir)
{
struct mountgroup *mg;
- struct mountpoint *mt_point;
list_for_each_entry(mg, &mounts, list) {
- list_for_each_entry(mt_point, &mg->mntpoints, list) {
- if (!strcmp(mt_point->dir, dir))
- return mg;
- }
+ if (!strcmp(mg->dir, dir))
+ return mg;
}
return NULL;
}
@@ -1501,8 +1496,7 @@
int do_mount(int ci, char *dir, char *type, char *proto, char *table,
char *options, char *dev, struct mountgroup **mg_ret)
{
- struct mountgroup *mg, *new_mg = NULL;
- struct mountpoint *mp;
+ struct mountgroup *mg;
char table2[MAXLINE];
char *cluster = NULL, *name = NULL;
int rv;
@@ -1544,33 +1538,24 @@
goto fail;
}
- /* Allocate and populate a new mountpoint entry */
- mp = malloc(sizeof(struct mountpoint));
- if (!mp) {
- rv = -ENOMEM;
+ mg = find_mg(name);
+ if (mg) {
+ rv = -EEXIST;
goto fail;
}
- strncpy(mp->dir, dir, sizeof(mp->dir));
- /* Check if we already have a mount group or need a new one */
- mg = find_mg(name);
+ mg = create_mg(name);
if (!mg) {
- mg = new_mg = create_mg(name);
- if (!mg) {
- free(mp);
- rv = -ENOMEM;
- goto fail;
- }
- strncpy(mg->type, type, sizeof(mg->type));
- strncpy(mg->table, table, sizeof(mg->table));
- strncpy(mg->options, options, sizeof(mg->options));
- strncpy(mg->dev, dev, sizeof(mg->dev));
- INIT_LIST_HEAD(&mg->mntpoints);
+ rv = -ENOMEM;
+ goto fail;
}
mg->mount_client = ci;
- /* Add the mount point to the list in the mountgroup. */
- list_add(&mp->list, &mg->mntpoints);
+ strncpy(mg->dir, dir, sizeof(mg->dir));
+ strncpy(mg->type, type, sizeof(mg->type));
+ strncpy(mg->table, table, sizeof(mg->table));
+ strncpy(mg->options, options, sizeof(mg->options));
+ strncpy(mg->dev, dev, sizeof(mg->dev));
if (strlen(cluster) != strlen(clustername) ||
strlen(cluster) == 0 || strcmp(cluster, clustername)) {
@@ -1581,42 +1566,38 @@
} else
log_group(mg, "cluster name matches: %s", clustername);
- if (new_mg) {
- if (strstr(options, "spectator")) {
- log_group(mg, "spectator mount");
- mg->spectator = 1;
- } else {
- if (!we_are_in_fence_domain()) {
- rv = -EINVAL;
- log_error("mount: not in default fence domain");
- goto fail;
- }
- }
-
- if (!mg->spectator && strstr(options, "rw"))
- mg->rw = 1;
- else if (strstr(options, "ro")) {
- if (mg->spectator) {
- rv = -EINVAL;
- log_error("mount: readonly invalid with spectator");
- goto fail;
- }
- mg->readonly = 1;
+ if (strstr(options, "spectator")) {
+ log_group(mg, "spectator mount");
+ mg->spectator = 1;
+ } else {
+ if (!we_are_in_fence_domain()) {
+ rv = -EINVAL;
+ log_error("mount: not in default fence domain");
+ goto fail;
}
+ }
- if (strlen(options) > MAX_OPTIONS_LEN-1) {
+ if (!mg->spectator && strstr(options, "rw"))
+ mg->rw = 1;
+ else if (strstr(options, "ro")) {
+ if (mg->spectator) {
rv = -EINVAL;
- log_error("mount: options too long %d", strlen(options));
+ log_error("mount: readonly invalid with spectator");
goto fail;
}
- list_add(&mg->list, &mounts);
+ mg->readonly = 1;
}
+
+ if (strlen(options) > MAX_OPTIONS_LEN-1) {
+ rv = -EINVAL;
+ log_error("mount: options too long %d", strlen(options));
+ goto fail;
+ }
+
+ list_add(&mg->list, &mounts);
*mg_ret = mg;
- if (new_mg)
- group_join(gh, name);
- else
- notify_mount_client(mg);
+ group_join(gh, name);
return 0;
fail:
@@ -1902,27 +1883,14 @@
int do_unmount(int ci, char *dir, int mnterr)
{
struct mountgroup *mg;
- struct mountpoint *mt_point, *safe;
list_for_each_entry(mg, &withdrawn_mounts, list) {
- int is_withdrawn = FALSE;
-
- list_for_each_entry(mt_point, &mg->mntpoints, list) {
- if (!strcmp(mt_point->dir, dir)) {
- is_withdrawn = TRUE;
- break;
- }
- }
- if (is_withdrawn) {
- list_for_each_entry_safe(mt_point, safe, &mg->mntpoints, list) {
- list_del(&mt_point->list);
- free(mt_point);
- }
+ if (!strcmp(mg->dir, dir)) {
log_group(mg, "unmount withdrawn fs");
list_del(&mg->list);
free(mg);
+ return 0;
}
- return 0;
}
mg = find_mg_dir(dir);
@@ -1942,6 +1910,7 @@
mg->kernel_mount_error = mnterr;
mg->kernel_mount_done = 1;
}
+ goto out;
}
if (mg->withdraw) {
@@ -1949,26 +1918,16 @@
return -1;
}
- /* Delete this mount point out of the list */
- list_for_each_entry(mt_point, &mg->mntpoints, list) {
- if (!strcmp(mt_point->dir, dir)) {
- list_del(&mt_point->list);
- free(mt_point);
- break;
- }
- }
/* Check to see if we're waiting for a kernel recovery_done to do a
start_done(). If so, call the start_done() here because we won't be
getting anything else from gfs-kernel which is now gone. */
- if (!mg->kernel_mount_error &&
- list_empty(&mg->mntpoints) && need_kernel_recovery_done(mg)) {
+ if (need_kernel_recovery_done(mg)) {
log_group(mg, "do_unmount: fill in start_done");
start_done(mg);
}
-
- if (list_empty(&mg->mntpoints))
- group_leave(gh, mg->name);
+ out:
+ group_leave(gh, mg->name);
return 0;
}
next reply other threads:[~2006-12-19 17:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-19 17:07 teigland [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-09-04 19:27 [Cluster-devel] cluster/group/gfs_controld lock_dlm.h recover.c teigland
2007-09-04 19:22 teigland
2006-12-19 17:07 teigland
2006-12-19 17:06 teigland
2006-12-19 1:48 rpeterso
2006-12-19 1:46 rpeterso
2006-12-19 1:42 rpeterso
2006-10-23 15:44 teigland
2006-10-16 14:44 teigland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061219170712.28330.qmail@sourceware.org \
--to=teigland@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.