aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-08-02 16:33:34 -0400
committerMartin Brandenburg <martin@omnibond.com>2016-08-08 15:12:28 -0400
commit680908e5046bdd37a678691d881d98486c3e9a53 (patch)
tree3a673c904db260dbb81fa423e844d898eda7c671
parenta6dff80a964176daca0d41492a6ca280d2246324 (diff)
orangefs: turn param response value into union
This will support a upcoming request where two related values need to be updated atomically. This was done without a union in the OrangeFS server source already. Since that will break the kernel protocol, it has been fixed there and done here in a way that does not break the kernel protocol. Signed-off-by: Martin Brandenburg <martin@omnibond.com>
-rw-r--r--fs/orangefs/downcall.h5
-rw-r--r--fs/orangefs/orangefs-sysfs.c8
-rw-r--r--fs/orangefs/upcall.h5
3 files changed, 11 insertions, 7 deletions
diff --git a/fs/orangefs/downcall.h b/fs/orangefs/downcall.h
index 66b99210f1f9..db6e8722a89e 100644
--- a/fs/orangefs/downcall.h
+++ b/fs/orangefs/downcall.h
@@ -83,7 +83,10 @@ struct orangefs_listxattr_response {
83}; 83};
84 84
85struct orangefs_param_response { 85struct orangefs_param_response {
86 __s64 value; 86 union {
87 __s64 value64;
88 __s32 value32[2];
89 } u;
87}; 90};
88 91
89#define PERF_COUNT_BUF_SIZE 4096 92#define PERF_COUNT_BUF_SIZE 4096
diff --git a/fs/orangefs/orangefs-sysfs.c b/fs/orangefs/orangefs-sysfs.c
index 375708c2db87..044ca6506775 100644
--- a/fs/orangefs/orangefs-sysfs.c
+++ b/fs/orangefs/orangefs-sysfs.c
@@ -949,10 +949,8 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
949out: 949out:
950 if (!rc) { 950 if (!rc) {
951 if (strcmp(kobj_id, PC_KOBJ_ID)) { 951 if (strcmp(kobj_id, PC_KOBJ_ID)) {
952 rc = scnprintf(buf, 952 rc = scnprintf(buf, PAGE_SIZE, "%d\n",
953 PAGE_SIZE, 953 (int)new_op->downcall.resp.param.u.value64);
954 "%d\n",
955 (int)new_op->downcall.resp.param.value);
956 } else { 954 } else {
957 rc = scnprintf( 955 rc = scnprintf(
958 buf, 956 buf,
@@ -1277,7 +1275,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
1277 1275
1278 new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_SET; 1276 new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_SET;
1279 1277
1280 new_op->upcall.req.param.value = val; 1278 new_op->upcall.req.param.u.value64 = val;
1281 1279
1282 /* 1280 /*
1283 * The service_operation will return a errno return code on 1281 * The service_operation will return a errno return code on
diff --git a/fs/orangefs/upcall.h b/fs/orangefs/upcall.h
index 03a4360dcd38..7c29fdf08ec5 100644
--- a/fs/orangefs/upcall.h
+++ b/fs/orangefs/upcall.h
@@ -187,7 +187,10 @@ enum orangefs_param_request_op {
187struct orangefs_param_request_s { 187struct orangefs_param_request_s {
188 enum orangefs_param_request_type type; 188 enum orangefs_param_request_type type;
189 enum orangefs_param_request_op op; 189 enum orangefs_param_request_op op;
190 __s64 value; 190 union {
191 __s64 value64;
192 __s32 value32[2];
193 } u;
191 char s_value[ORANGEFS_MAX_DEBUG_STRING_LEN]; 194 char s_value[ORANGEFS_MAX_DEBUG_STRING_LEN];
192}; 195};
193 196