diff options
-rw-r--r-- | fs/gfs2/sys.c | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 9f6d48b75fd2..94bd59ec54e2 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c | |||
@@ -276,25 +276,6 @@ static struct kobj_type gfs2_ktype = { | |||
276 | .sysfs_ops = &gfs2_attr_ops, | 276 | .sysfs_ops = &gfs2_attr_ops, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | /* | ||
280 | * display struct lm_lockstruct fields | ||
281 | */ | ||
282 | |||
283 | #define LOCKSTRUCT_ATTR(name, fmt) \ | ||
284 | static ssize_t name##_show(struct gfs2_sbd *sdp, char *buf) \ | ||
285 | { \ | ||
286 | return snprintf(buf, PAGE_SIZE, fmt, sdp->sd_lockstruct.ls_##name); \ | ||
287 | } \ | ||
288 | static struct gfs2_attr lockstruct_attr_##name = __ATTR_RO(name) | ||
289 | |||
290 | LOCKSTRUCT_ATTR(jid, "%u\n"); | ||
291 | LOCKSTRUCT_ATTR(first, "%u\n"); | ||
292 | |||
293 | static struct attribute *lockstruct_attrs[] = { | ||
294 | &lockstruct_attr_jid.attr, | ||
295 | &lockstruct_attr_first.attr, | ||
296 | NULL, | ||
297 | }; | ||
298 | 279 | ||
299 | /* | 280 | /* |
300 | * lock_module. Originally from lock_dlm | 281 | * lock_module. Originally from lock_dlm |
@@ -397,6 +378,11 @@ static ssize_t recover_status_show(struct gfs2_sbd *sdp, char *buf) | |||
397 | return sprintf(buf, "%d\n", ls->ls_recover_jid_status); | 378 | return sprintf(buf, "%d\n", ls->ls_recover_jid_status); |
398 | } | 379 | } |
399 | 380 | ||
381 | static ssize_t jid_show(struct gfs2_sbd *sdp, char *buf) | ||
382 | { | ||
383 | return sprintf(buf, "%u\n", sdp->sd_lockstruct.ls_jid); | ||
384 | } | ||
385 | |||
400 | #define GDLM_ATTR(_name,_mode,_show,_store) \ | 386 | #define GDLM_ATTR(_name,_mode,_show,_store) \ |
401 | static struct gfs2_attr gdlm_attr_##_name = __ATTR(_name,_mode,_show,_store) | 387 | static struct gfs2_attr gdlm_attr_##_name = __ATTR(_name,_mode,_show,_store) |
402 | 388 | ||
@@ -404,6 +390,7 @@ GDLM_ATTR(proto_name, 0444, proto_name_show, NULL); | |||
404 | GDLM_ATTR(block, 0644, block_show, block_store); | 390 | GDLM_ATTR(block, 0644, block_show, block_store); |
405 | GDLM_ATTR(withdraw, 0644, withdraw_show, withdraw_store); | 391 | GDLM_ATTR(withdraw, 0644, withdraw_show, withdraw_store); |
406 | GDLM_ATTR(id, 0444, lkid_show, NULL); | 392 | GDLM_ATTR(id, 0444, lkid_show, NULL); |
393 | GDLM_ATTR(jid, 0444, jid_show, NULL); | ||
407 | GDLM_ATTR(first, 0444, lkfirst_show, NULL); | 394 | GDLM_ATTR(first, 0444, lkfirst_show, NULL); |
408 | GDLM_ATTR(first_done, 0444, first_done_show, NULL); | 395 | GDLM_ATTR(first_done, 0444, first_done_show, NULL); |
409 | GDLM_ATTR(recover, 0200, NULL, recover_store); | 396 | GDLM_ATTR(recover, 0200, NULL, recover_store); |
@@ -415,7 +402,7 @@ static struct attribute *lock_module_attrs[] = { | |||
415 | &gdlm_attr_block.attr, | 402 | &gdlm_attr_block.attr, |
416 | &gdlm_attr_withdraw.attr, | 403 | &gdlm_attr_withdraw.attr, |
417 | &gdlm_attr_id.attr, | 404 | &gdlm_attr_id.attr, |
418 | &lockstruct_attr_jid.attr, | 405 | &gdlm_attr_jid.attr, |
419 | &gdlm_attr_first.attr, | 406 | &gdlm_attr_first.attr, |
420 | &gdlm_attr_first_done.attr, | 407 | &gdlm_attr_first_done.attr, |
421 | &gdlm_attr_recover.attr, | 408 | &gdlm_attr_recover.attr, |
@@ -558,11 +545,6 @@ static struct attribute *tune_attrs[] = { | |||
558 | NULL, | 545 | NULL, |
559 | }; | 546 | }; |
560 | 547 | ||
561 | static struct attribute_group lockstruct_group = { | ||
562 | .name = "lockstruct", | ||
563 | .attrs = lockstruct_attrs, | ||
564 | }; | ||
565 | |||
566 | static struct attribute_group args_group = { | 548 | static struct attribute_group args_group = { |
567 | .name = "args", | 549 | .name = "args", |
568 | .attrs = args_attrs, | 550 | .attrs = args_attrs, |
@@ -588,13 +570,9 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp) | |||
588 | if (error) | 570 | if (error) |
589 | goto fail; | 571 | goto fail; |
590 | 572 | ||
591 | error = sysfs_create_group(&sdp->sd_kobj, &lockstruct_group); | ||
592 | if (error) | ||
593 | goto fail_reg; | ||
594 | |||
595 | error = sysfs_create_group(&sdp->sd_kobj, &args_group); | 573 | error = sysfs_create_group(&sdp->sd_kobj, &args_group); |
596 | if (error) | 574 | if (error) |
597 | goto fail_lockstruct; | 575 | goto fail_reg; |
598 | 576 | ||
599 | error = sysfs_create_group(&sdp->sd_kobj, &tune_group); | 577 | error = sysfs_create_group(&sdp->sd_kobj, &tune_group); |
600 | if (error) | 578 | if (error) |
@@ -611,8 +589,6 @@ fail_tune: | |||
611 | sysfs_remove_group(&sdp->sd_kobj, &tune_group); | 589 | sysfs_remove_group(&sdp->sd_kobj, &tune_group); |
612 | fail_args: | 590 | fail_args: |
613 | sysfs_remove_group(&sdp->sd_kobj, &args_group); | 591 | sysfs_remove_group(&sdp->sd_kobj, &args_group); |
614 | fail_lockstruct: | ||
615 | sysfs_remove_group(&sdp->sd_kobj, &lockstruct_group); | ||
616 | fail_reg: | 592 | fail_reg: |
617 | kobject_put(&sdp->sd_kobj); | 593 | kobject_put(&sdp->sd_kobj); |
618 | fail: | 594 | fail: |
@@ -624,7 +600,6 @@ void gfs2_sys_fs_del(struct gfs2_sbd *sdp) | |||
624 | { | 600 | { |
625 | sysfs_remove_group(&sdp->sd_kobj, &tune_group); | 601 | sysfs_remove_group(&sdp->sd_kobj, &tune_group); |
626 | sysfs_remove_group(&sdp->sd_kobj, &args_group); | 602 | sysfs_remove_group(&sdp->sd_kobj, &args_group); |
627 | sysfs_remove_group(&sdp->sd_kobj, &lockstruct_group); | ||
628 | sysfs_remove_group(&sdp->sd_kobj, &lock_module_group); | 603 | sysfs_remove_group(&sdp->sd_kobj, &lock_module_group); |
629 | kobject_put(&sdp->sd_kobj); | 604 | kobject_put(&sdp->sd_kobj); |
630 | } | 605 | } |