aboutsummaryrefslogtreecommitdiff
path: root/fs/orangefs/super.c
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-08-12 12:02:31 -0400
committerMartin Brandenburg <martin@omnibond.com>2016-08-12 15:12:54 -0400
commit482664ddba81b3a5404fd083bb9697dfffc0b6a4 (patch)
treef4dd0268a8cf58fd898f73dd7b26a0a9ef5d2eff /fs/orangefs/super.c
parentf2ee3b759593c184f1249e03d613a84b4b69db2b (diff)
orangefs: add features op
This is a new userspace operation, which will be done if the client-core version is greater than or equal to 2.9.6. This will provide a way to implement optional features and to determine which features are supported by the client-core. If the client-core version is older than 2.9.6, no optional features are supported and the op will not be done. The intent is to allow protocol extensions without relying on the client-core's current behavior of ignoring what it doesn't understand. Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Diffstat (limited to 'fs/orangefs/super.c')
-rw-r--r--fs/orangefs/super.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c
index b9da9a0281c9..3e484a667340 100644
--- a/fs/orangefs/super.c
+++ b/fs/orangefs/super.c
@@ -33,6 +33,7 @@ static const match_table_t tokens = {
{ Opt_err, NULL }
};
+uint64_t orangefs_features;
static int parse_mount_options(struct super_block *sb, char *options,
int silent)
@@ -249,6 +250,19 @@ int orangefs_remount(struct orangefs_sb_info_s *orangefs_sb)
}
op_release(new_op);
+
+ if (orangefs_userspace_version >= 20906) {
+ new_op = op_alloc(ORANGEFS_VFS_OP_FEATURES);
+ if (!new_op)
+ return -ENOMEM;
+ new_op->upcall.req.features.features = 0;
+ ret = service_operation(new_op, "orangefs_features", 0);
+ orangefs_features = new_op->downcall.resp.features.features;
+ op_release(new_op);
+ } else {
+ orangefs_features = 0;
+ }
+
return ret;
}
@@ -492,6 +506,19 @@ struct dentry *orangefs_mount(struct file_system_type *fst,
list_add_tail(&ORANGEFS_SB(sb)->list, &orangefs_superblocks);
spin_unlock(&orangefs_superblocks_lock);
op_release(new_op);
+
+ if (orangefs_userspace_version >= 20906) {
+ new_op = op_alloc(ORANGEFS_VFS_OP_FEATURES);
+ if (!new_op)
+ return ERR_PTR(-ENOMEM);
+ new_op->upcall.req.features.features = 0;
+ ret = service_operation(new_op, "orangefs_features", 0);
+ orangefs_features = new_op->downcall.resp.features.features;
+ op_release(new_op);
+ } else {
+ orangefs_features = 0;
+ }
+
return dget(sb->s_root);
free_op: