aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/sys.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2013-02-13 07:21:40 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2013-02-13 07:21:40 -0500
commitfd95e81cb1c74c9acd2356821faa9f24c2fec365 (patch)
treec042403ac12c38a9dc74a59d63bf5e19639e794d /fs/gfs2/sys.c
parentd2b47cfb26fe06002b8011707baac71a9ae8166f (diff)
GFS2: Reinstate withdraw ack system
This patch reinstates the ack system which withdraw should be using. It appears to have been accidentally forgotten when the lock module was merged into GFS2, due to two different sysfs files having the same name. Reported-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/sys.c')
-rw-r--r--fs/gfs2/sys.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 462e84142759..4fb9ad80d260 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -330,6 +330,28 @@ static ssize_t block_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
330 return ret; 330 return ret;
331} 331}
332 332
333static ssize_t wdack_show(struct gfs2_sbd *sdp, char *buf)
334{
335 int val = completion_done(&sdp->sd_wdack) ? 1 : 0;
336
337 return sprintf(buf, "%d\n", val);
338}
339
340static ssize_t wdack_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
341{
342 ssize_t ret = len;
343 int val;
344
345 val = simple_strtol(buf, NULL, 0);
346
347 if ((val == 1) &&
348 !strcmp(sdp->sd_lockstruct.ls_ops->lm_proto_name, "lock_dlm"))
349 complete(&sdp->sd_wdack);
350 else
351 ret = -EINVAL;
352 return ret;
353}
354
333static ssize_t lkfirst_show(struct gfs2_sbd *sdp, char *buf) 355static ssize_t lkfirst_show(struct gfs2_sbd *sdp, char *buf)
334{ 356{
335 struct lm_lockstruct *ls = &sdp->sd_lockstruct; 357 struct lm_lockstruct *ls = &sdp->sd_lockstruct;
@@ -461,7 +483,7 @@ static struct gfs2_attr gdlm_attr_##_name = __ATTR(_name,_mode,_show,_store)
461 483
462GDLM_ATTR(proto_name, 0444, proto_name_show, NULL); 484GDLM_ATTR(proto_name, 0444, proto_name_show, NULL);
463GDLM_ATTR(block, 0644, block_show, block_store); 485GDLM_ATTR(block, 0644, block_show, block_store);
464GDLM_ATTR(withdraw, 0644, withdraw_show, withdraw_store); 486GDLM_ATTR(withdraw, 0644, wdack_show, wdack_store);
465GDLM_ATTR(jid, 0644, jid_show, jid_store); 487GDLM_ATTR(jid, 0644, jid_show, jid_store);
466GDLM_ATTR(first, 0644, lkfirst_show, lkfirst_store); 488GDLM_ATTR(first, 0644, lkfirst_show, lkfirst_store);
467GDLM_ATTR(first_done, 0444, first_done_show, NULL); 489GDLM_ATTR(first_done, 0444, first_done_show, NULL);