diff options
Diffstat (limited to 'fs/gfs2/sys.c')
-rw-r--r-- | fs/gfs2/sys.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 446329728d52..419042f7f0b6 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c | |||
@@ -49,7 +49,7 @@ static ssize_t gfs2_attr_store(struct kobject *kobj, struct attribute *attr, | |||
49 | return a->store ? a->store(sdp, buf, len) : len; | 49 | return a->store ? a->store(sdp, buf, len) : len; |
50 | } | 50 | } |
51 | 51 | ||
52 | static struct sysfs_ops gfs2_attr_ops = { | 52 | static const struct sysfs_ops gfs2_attr_ops = { |
53 | .show = gfs2_attr_show, | 53 | .show = gfs2_attr_show, |
54 | .store = gfs2_attr_store, | 54 | .store = gfs2_attr_store, |
55 | }; | 55 | }; |
@@ -85,11 +85,7 @@ static ssize_t uuid_show(struct gfs2_sbd *sdp, char *buf) | |||
85 | buf[0] = '\0'; | 85 | buf[0] = '\0'; |
86 | if (!gfs2_uuid_valid(uuid)) | 86 | if (!gfs2_uuid_valid(uuid)) |
87 | return 0; | 87 | return 0; |
88 | return snprintf(buf, PAGE_SIZE, "%02X%02X%02X%02X-%02X%02X-" | 88 | return snprintf(buf, PAGE_SIZE, "%pUB\n", uuid); |
89 | "%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X\n", | ||
90 | uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], | ||
91 | uuid[6], uuid[7], uuid[8], uuid[9], uuid[10], uuid[11], | ||
92 | uuid[12], uuid[13], uuid[14], uuid[15]); | ||
93 | } | 89 | } |
94 | 90 | ||
95 | static ssize_t freeze_show(struct gfs2_sbd *sdp, char *buf) | 91 | static ssize_t freeze_show(struct gfs2_sbd *sdp, char *buf) |
@@ -158,7 +154,7 @@ static ssize_t statfs_sync_store(struct gfs2_sbd *sdp, const char *buf, | |||
158 | if (simple_strtol(buf, NULL, 0) != 1) | 154 | if (simple_strtol(buf, NULL, 0) != 1) |
159 | return -EINVAL; | 155 | return -EINVAL; |
160 | 156 | ||
161 | gfs2_statfs_sync(sdp); | 157 | gfs2_statfs_sync(sdp->sd_vfs, 0); |
162 | return len; | 158 | return len; |
163 | } | 159 | } |
164 | 160 | ||
@@ -171,13 +167,14 @@ static ssize_t quota_sync_store(struct gfs2_sbd *sdp, const char *buf, | |||
171 | if (simple_strtol(buf, NULL, 0) != 1) | 167 | if (simple_strtol(buf, NULL, 0) != 1) |
172 | return -EINVAL; | 168 | return -EINVAL; |
173 | 169 | ||
174 | gfs2_quota_sync(sdp); | 170 | gfs2_quota_sync(sdp->sd_vfs, 0, 1); |
175 | return len; | 171 | return len; |
176 | } | 172 | } |
177 | 173 | ||
178 | static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf, | 174 | static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf, |
179 | size_t len) | 175 | size_t len) |
180 | { | 176 | { |
177 | int error; | ||
181 | u32 id; | 178 | u32 id; |
182 | 179 | ||
183 | if (!capable(CAP_SYS_ADMIN)) | 180 | if (!capable(CAP_SYS_ADMIN)) |
@@ -185,13 +182,14 @@ static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf, | |||
185 | 182 | ||
186 | id = simple_strtoul(buf, NULL, 0); | 183 | id = simple_strtoul(buf, NULL, 0); |
187 | 184 | ||
188 | gfs2_quota_refresh(sdp, 1, id); | 185 | error = gfs2_quota_refresh(sdp, 1, id); |
189 | return len; | 186 | return error ? error : len; |
190 | } | 187 | } |
191 | 188 | ||
192 | static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf, | 189 | static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf, |
193 | size_t len) | 190 | size_t len) |
194 | { | 191 | { |
192 | int error; | ||
195 | u32 id; | 193 | u32 id; |
196 | 194 | ||
197 | if (!capable(CAP_SYS_ADMIN)) | 195 | if (!capable(CAP_SYS_ADMIN)) |
@@ -199,8 +197,8 @@ static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf, | |||
199 | 197 | ||
200 | id = simple_strtoul(buf, NULL, 0); | 198 | id = simple_strtoul(buf, NULL, 0); |
201 | 199 | ||
202 | gfs2_quota_refresh(sdp, 0, id); | 200 | error = gfs2_quota_refresh(sdp, 0, id); |
203 | return len; | 201 | return error ? error : len; |
204 | } | 202 | } |
205 | 203 | ||
206 | static ssize_t demote_rq_store(struct gfs2_sbd *sdp, const char *buf, size_t len) | 204 | static ssize_t demote_rq_store(struct gfs2_sbd *sdp, const char *buf, size_t len) |
@@ -480,7 +478,6 @@ TUNE_ATTR(complain_secs, 0); | |||
480 | TUNE_ATTR(statfs_slow, 0); | 478 | TUNE_ATTR(statfs_slow, 0); |
481 | TUNE_ATTR(new_files_jdata, 0); | 479 | TUNE_ATTR(new_files_jdata, 0); |
482 | TUNE_ATTR(quota_simul_sync, 1); | 480 | TUNE_ATTR(quota_simul_sync, 1); |
483 | TUNE_ATTR(stall_secs, 1); | ||
484 | TUNE_ATTR(statfs_quantum, 1); | 481 | TUNE_ATTR(statfs_quantum, 1); |
485 | TUNE_ATTR_3(quota_scale, quota_scale_show, quota_scale_store); | 482 | TUNE_ATTR_3(quota_scale, quota_scale_show, quota_scale_store); |
486 | 483 | ||
@@ -493,7 +490,6 @@ static struct attribute *tune_attrs[] = { | |||
493 | &tune_attr_complain_secs.attr, | 490 | &tune_attr_complain_secs.attr, |
494 | &tune_attr_statfs_slow.attr, | 491 | &tune_attr_statfs_slow.attr, |
495 | &tune_attr_quota_simul_sync.attr, | 492 | &tune_attr_quota_simul_sync.attr, |
496 | &tune_attr_stall_secs.attr, | ||
497 | &tune_attr_statfs_quantum.attr, | 493 | &tune_attr_statfs_quantum.attr, |
498 | &tune_attr_quota_scale.attr, | 494 | &tune_attr_quota_scale.attr, |
499 | &tune_attr_new_files_jdata.attr, | 495 | &tune_attr_new_files_jdata.attr, |
@@ -573,18 +569,12 @@ static int gfs2_uevent(struct kset *kset, struct kobject *kobj, | |||
573 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); | 569 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); |
574 | if (!sdp->sd_args.ar_spectator) | 570 | if (!sdp->sd_args.ar_spectator) |
575 | add_uevent_var(env, "JOURNALID=%u", sdp->sd_lockstruct.ls_jid); | 571 | add_uevent_var(env, "JOURNALID=%u", sdp->sd_lockstruct.ls_jid); |
576 | if (gfs2_uuid_valid(uuid)) { | 572 | if (gfs2_uuid_valid(uuid)) |
577 | add_uevent_var(env, "UUID=%02X%02X%02X%02X-%02X%02X-%02X%02X-" | 573 | add_uevent_var(env, "UUID=%pUB", uuid); |
578 | "%02X%02X-%02X%02X%02X%02X%02X%02X", | ||
579 | uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], | ||
580 | uuid[5], uuid[6], uuid[7], uuid[8], uuid[9], | ||
581 | uuid[10], uuid[11], uuid[12], uuid[13], | ||
582 | uuid[14], uuid[15]); | ||
583 | } | ||
584 | return 0; | 574 | return 0; |
585 | } | 575 | } |
586 | 576 | ||
587 | static struct kset_uevent_ops gfs2_uevent_ops = { | 577 | static const struct kset_uevent_ops gfs2_uevent_ops = { |
588 | .uevent = gfs2_uevent, | 578 | .uevent = gfs2_uevent, |
589 | }; | 579 | }; |
590 | 580 | ||