summaryrefslogtreecommitdiff
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r--fs/ceph/super.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index a1f781c46b41..29a980e22dc2 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -104,14 +104,26 @@ struct ceph_mount_options {
struct fscrypt_dummy_policy dummy_enc_policy;
};
+#define CEPH_NAMESPACE_WILDCARD "*"
+
+static inline bool ceph_namespace_match(const char *pattern,
+ const char *target)
+{
+ if (!pattern || !pattern[0] ||
+ !strcmp(pattern, CEPH_NAMESPACE_WILDCARD))
+ return true;
+
+ return !strcmp(pattern, target);
+}
+
/*
* Check if the mds namespace in ceph_mount_options matches
* the passed in namespace string. First time match (when
* ->mds_namespace is NULL) is treated specially, since
* ->mds_namespace needs to be initialized by the caller.
*/
-static inline int namespace_equals(struct ceph_mount_options *fsopt,
- const char *namespace, size_t len)
+static inline bool namespace_equals(struct ceph_mount_options *fsopt,
+ const char *namespace, size_t len)
{
return !(fsopt->mds_namespace &&
(strlen(fsopt->mds_namespace) != len ||