aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/sys.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index dda4bf1e9eb4..0d4f7e974e9f 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -16,6 +16,7 @@
16#include <linux/kobject.h> 16#include <linux/kobject.h>
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <linux/gfs2_ondisk.h> 18#include <linux/gfs2_ondisk.h>
19#include <linux/genhd.h>
19 20
20#include "gfs2.h" 21#include "gfs2.h"
21#include "incore.h" 22#include "incore.h"
@@ -542,9 +543,17 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
542 if (error) 543 if (error)
543 goto fail_tune; 544 goto fail_tune;
544 545
546 error = sysfs_create_link(&sdp->sd_kobj,
547 &disk_to_dev(sb->s_bdev->bd_disk)->kobj,
548 "device");
549 if (error)
550 goto fail_lock_module;
551
545 kobject_uevent_env(&sdp->sd_kobj, KOBJ_ADD, envp); 552 kobject_uevent_env(&sdp->sd_kobj, KOBJ_ADD, envp);
546 return 0; 553 return 0;
547 554
555fail_lock_module:
556 sysfs_remove_group(&sdp->sd_kobj, &lock_module_group);
548fail_tune: 557fail_tune:
549 sysfs_remove_group(&sdp->sd_kobj, &tune_group); 558 sysfs_remove_group(&sdp->sd_kobj, &tune_group);
550fail_reg: 559fail_reg:
@@ -556,6 +565,7 @@ fail:
556 565
557void gfs2_sys_fs_del(struct gfs2_sbd *sdp) 566void gfs2_sys_fs_del(struct gfs2_sbd *sdp)
558{ 567{
568 sysfs_remove_link(&sdp->sd_kobj, "device");
559 sysfs_remove_group(&sdp->sd_kobj, &tune_group); 569 sysfs_remove_group(&sdp->sd_kobj, &tune_group);
560 sysfs_remove_group(&sdp->sd_kobj, &lock_module_group); 570 sysfs_remove_group(&sdp->sd_kobj, &lock_module_group);
561 kobject_put(&sdp->sd_kobj); 571 kobject_put(&sdp->sd_kobj);