libceph: supported_features module parameter
authorIlya Dryomov <idryomov@gmail.com>
Fri, 3 Mar 2017 17:16:07 +0000 (18:16 +0100)
committerJeff Layton <jlayton@redhat.com>
Tue, 4 Apr 2017 12:38:51 +0000 (08:38 -0400)
Add a readonly, exported to sysfs module parameter so that userspace
can generate meaningful error messages.  It's a bit funky, but there is
no other libceph-specific place.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/ceph_common.c

index 4701d067169f3250880c92accc477ace47c60415..6eeeb67bed84f75e15d9c78001a99b66972c682b 100644 (file)
@@ -45,6 +45,17 @@ bool libceph_compatible(void *data)
 }
 EXPORT_SYMBOL(libceph_compatible);
 
+static int param_get_supported_features(char *buffer,
+                                       const struct kernel_param *kp)
+{
+       return sprintf(buffer, "0x%llx", CEPH_FEATURES_SUPPORTED_DEFAULT);
+}
+static const struct kernel_param_ops param_ops_supported_features = {
+       .get = param_get_supported_features,
+};
+module_param_cb(supported_features, &param_ops_supported_features, NULL,
+               S_IRUGO);
+
 /*
  * find filename portion of a path (/foo/bar/baz -> baz)
  */