From: Martin Brandenburg Date: Wed, 28 Sep 2016 18:50:46 +0000 (-0400) Subject: Merge branch 'misc' into for-next X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b78b11985a36bfe768add17ffb70bbaf9d8d7627;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Merge branch 'misc' into for-next Pull in an OrangeFS branch containing miscellaneous improvements. - clean up debugfs globals - remove dead code in sysfs - reorganize duplicated sysfs attribute structs - consolidate sysfs show and store functions - remove duplicated sysfs_ops structures - describe organization of sysfs - make devreq_mutex static - g_orangefs_stats -> orangefs_stats for consistency - rename most remaining global variables --- b78b11985a36bfe768add17ffb70bbaf9d8d7627 diff --cc fs/orangefs/devorangefs-req.c index ec1a5ff1d843,641e27152d7e..516ffb4dc9a0 --- a/fs/orangefs/devorangefs-req.c +++ b/fs/orangefs/devorangefs-req.c @@@ -17,10 -18,10 +18,12 @@@ /* this file implements the /dev/pvfs2-req device node */ +uint32_t orangefs_userspace_version; + static int open_access_count; + static DEFINE_MUTEX(devreq_mutex); + #define DUMP_DEVICE_ERROR() \ do { \ gossip_err("*****************************************************\n");\ diff --cc fs/orangefs/orangefs-sysfs.c index ed5ee33d0f7e,e88370540cb4..a799546a67f7 --- a/fs/orangefs/orangefs-sysfs.c +++ b/fs/orangefs/orangefs-sysfs.c @@@ -836,26 -321,14 +321,23 @@@ static ssize_t sysfs_service_op_show(st goto out; } - if (strcmp(kobj_id, PC_KOBJ_ID)) + if (strcmp(kobj->name, PC_KOBJ_ID)) new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_GET; - if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) { - orangefs_attr = (struct orangefs_attribute *)attr; - + if (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) { + /* Drop unsupported requests first. */ + if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) && - (!strcmp(orangefs_attr->attr.name, "readahead_count") || - !strcmp(orangefs_attr->attr.name, "readahead_size") || - !strcmp(orangefs_attr->attr.name, - "readahead_count_size"))) { ++ (!strcmp(attr->attr.name, "readahead_count") || ++ !strcmp(attr->attr.name, "readahead_size") || ++ !strcmp(attr->attr.name, "readahead_count_size"))) { + rc = -EINVAL; + goto out; + } + - if (!strcmp(orangefs_attr->attr.name, "perf_history_size")) + if (!strcmp(attr->attr.name, "perf_history_size")) new_op->upcall.req.param.op = ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE; - else if (!strcmp(orangefs_attr->attr.name, + else if (!strcmp(attr->attr.name, "perf_time_interval_secs")) new_op->upcall.req.param.op = ORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS; @@@ -1141,19 -528,8 +537,17 @@@ static ssize_t sysfs_service_op_store(s new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_SET; - if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) { - orangefs_attr = (struct orangefs_attribute *)attr; + if (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) { + /* Drop unsupported requests first. */ + if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) && - (!strcmp(orangefs_attr->attr.name, "readahead_count") || - !strcmp(orangefs_attr->attr.name, "readahead_size") || - !strcmp(orangefs_attr->attr.name, - "readahead_count_size"))) { ++ (!strcmp(attr->attr.name, "readahead_count") || ++ !strcmp(attr->attr.name, "readahead_size") || ++ !strcmp(attr->attr.name, "readahead_count_size"))) { + rc = -EINVAL; + goto out; + } + - if (!strcmp(orangefs_attr->attr.name, "perf_history_size")) { + if (!strcmp(attr->attr.name, "perf_history_size")) { if (val > 0) { new_op->upcall.req.param.op = ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE;