aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-07-31 07:16:25 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2009-08-17 06:05:00 -0400
commit440d6da207e9eef2b576331cfedd5ecae9068663 (patch)
tree307bd414e11a37a3bc2b198f2aafa7c9325da1ab /fs
parent8633ecfaba4ce53c094f8db92dbd7ac474a7aa36 (diff)
GFS2: Add some more info to uevents
With each uevent, we now always include the journal ID. We can't call it JID since that is already in use by some of the individual events relating to recovery, so we use JOURNALID instead. We don't send the JOURNALID for spectator mounts, since there isn't one. Also the ADD event now has both RDONLY and SPECTATOR information to match that of the ONLINE event. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/sys.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index a7cbfbd340c7..dda4bf1e9eb4 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -519,7 +519,14 @@ static struct attribute_group lock_module_group = {
519 519
520int gfs2_sys_fs_add(struct gfs2_sbd *sdp) 520int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
521{ 521{
522 struct super_block *sb = sdp->sd_vfs;
522 int error; 523 int error;
524 char ro[20];
525 char spectator[20];
526 char *envp[] = { ro, spectator, NULL };
527
528 sprintf(ro, "RDONLY=%d", (sb->s_flags & MS_RDONLY) ? 1 : 0);
529 sprintf(spectator, "SPECTATOR=%d", sdp->sd_args.ar_spectator ? 1 : 0);
523 530
524 sdp->sd_kobj.kset = gfs2_kset; 531 sdp->sd_kobj.kset = gfs2_kset;
525 error = kobject_init_and_add(&sdp->sd_kobj, &gfs2_ktype, NULL, 532 error = kobject_init_and_add(&sdp->sd_kobj, &gfs2_ktype, NULL,
@@ -535,7 +542,7 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
535 if (error) 542 if (error)
536 goto fail_tune; 543 goto fail_tune;
537 544
538 kobject_uevent(&sdp->sd_kobj, KOBJ_ADD); 545 kobject_uevent_env(&sdp->sd_kobj, KOBJ_ADD, envp);
539 return 0; 546 return 0;
540 547
541fail_tune: 548fail_tune:
@@ -554,7 +561,6 @@ void gfs2_sys_fs_del(struct gfs2_sbd *sdp)
554 kobject_put(&sdp->sd_kobj); 561 kobject_put(&sdp->sd_kobj);
555} 562}
556 563
557
558static int gfs2_uevent(struct kset *kset, struct kobject *kobj, 564static int gfs2_uevent(struct kset *kset, struct kobject *kobj,
559 struct kobj_uevent_env *env) 565 struct kobj_uevent_env *env)
560{ 566{
@@ -563,6 +569,8 @@ static int gfs2_uevent(struct kset *kset, struct kobject *kobj,
563 569
564 add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name); 570 add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name);
565 add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); 571 add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name);
572 if (!sdp->sd_args.ar_spectator)
573 add_uevent_var(env, "JOURNALID=%u", sdp->sd_lockstruct.ls_jid);
566 if (gfs2_uuid_valid(uuid)) { 574 if (gfs2_uuid_valid(uuid)) {
567 add_uevent_var(env, "UUID=%02X%02X%02X%02X-%02X%02X-%02X%02X-" 575 add_uevent_var(env, "UUID=%02X%02X%02X%02X-%02X%02X-%02X%02X-"
568 "%02X%02X-%02X%02X%02X%02X%02X%02X", 576 "%02X%02X-%02X%02X%02X%02X%02X%02X",
@@ -578,7 +586,6 @@ static struct kset_uevent_ops gfs2_uevent_ops = {
578 .uevent = gfs2_uevent, 586 .uevent = gfs2_uevent,
579}; 587};
580 588
581
582int gfs2_sys_init(void) 589int gfs2_sys_init(void)
583{ 590{
584 gfs2_kset = kset_create_and_add("gfs2", &gfs2_uevent_ops, fs_kobj); 591 gfs2_kset = kset_create_and_add("gfs2", &gfs2_uevent_ops, fs_kobj);