]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
libceph: add a compatibility check interface
authorAlex Elder <elder@inktank.com>
Wed, 30 Jan 2013 17:13:33 +0000 (11:13 -0600)
committerSage Weil <sage@inktank.com>
Thu, 14 Feb 2013 02:29:11 +0000 (18:29 -0800)
An upcoming change implements semantic change that could lead to
a crash if an old version of the libceph kernel module is used with
a new version of the rbd kernel module.

In order to preclude that possibility, this adds a compatibilty
check interface.  If this interface doesn't exist, the modules are
obviously not compatible.  But if it does exist, this provides a way
of letting the caller know whether it will operate properly with
this libceph module.

Perhaps confusingly, it returns false right now.  The semantic
change mentioned above will make it return true.

This resolves:
    http://tracker.ceph.com/issues/3800

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
include/linux/ceph/libceph.h
net/ceph/ceph_common.c

index 084d3c622b12a8ac58ad626da2e8f325d6d3d1c9..c44275ab375c82741a1d3f639465eff72b62b0a9 100644 (file)
@@ -193,6 +193,8 @@ static inline int calc_pages_for(u64 off, u64 len)
 }
 
 /* ceph_common.c */
+extern bool libceph_compatible(void *data);
+
 extern const char *ceph_msg_type_name(int type);
 extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
 extern struct kmem_cache *ceph_inode_cachep;
index ee71ea26777ae892fafd13a8338b3f556d9f427b..a98c03ff853f98d541d351c2d1470e4aac04b8e5 100644 (file)
 #include "crypto.h"
 
 
+/*
+ * Module compatibility interface.  For now it doesn't do anything,
+ * but its existence signals a certain level of functionality.
+ *
+ * The data buffer is used to pass information both to and from
+ * libceph.  The return value indicates whether libceph determines
+ * it is compatible with the caller (from another kernel module),
+ * given the provided data.
+ *
+ * The data pointer can be null.
+ */
+bool libceph_compatible(void *data)
+{
+       return false;
+}
+EXPORT_SYMBOL(libceph_compatible);
 
 /*
  * find filename portion of a path (/foo/bar/baz -> baz)