Skip to contentSkip to conversation

PATCH: link ceph-client version to kernel version

PATCH Thomas Mueller 3 participants 5 messages Jul 7, 2010

lore
Share & tools
lore
#0 lore raw

hi

reading the version in ceph_fs.h made me think, that now that ceph is in vanilla kernel, it would be nice to have the version linked to the kernel version. this is how the kvm guys work for their backported module.

I've also patched super.c to expose the version to modinfo.

- Thomas

ceph_fs.h +7 -6
index 63ff461..cfc995b 100644
@@ -18,16 +18,17 @@
 /*
  * Ceph release version
  */
-#define CEPH_VERSION_MAJOR 0
-#define CEPH_VERSION_MINOR 20
-#define CEPH_VERSION_PATCH 0
+#define CEPH_VERSION_MAJOR 2
+#define CEPH_VERSION_MINOR 6
+#define CEPH_VERSION_PATCH 35
+#define CEPH_VERSION_FIX 0
 
 #define _CEPH_STRINGIFY(x) #x
 #define CEPH_STRINGIFY(x) _CEPH_STRINGIFY(x)
-#define CEPH_MAKE_VERSION(x, y, z) CEPH_STRINGIFY(x) "." CEPH_STRINGIFY(y) \
-       "." CEPH_STRINGIFY(z)
+#define CEPH_MAKE_VERSION(w, x, y, z) CEPH_STRINGIFY(w) "." CEPH_STRINGIFY(x) \
+       "." CEPH_STRINGIFY(y) "." CEPH_STRINGIFY(z)
 #define CEPH_VERSION CEPH_MAKE_VERSION(CEPH_VERSION_MAJOR, \
-                                      CEPH_VERSION_MINOR, CEPH_VERSION_PATCH)
+                                      CEPH_VERSION_MINOR, CEPH_VERSION_PATCH, CEPH_VERSION_FIX)
 
 /*
  * subprotocol versions.  when specific messages types or high-level
super.c +1 -0
index 27447a2..93d9c59 100644
@@ -1149,3 +1149,4 @@ MODULE_AUTHOR("Yehuda Sadeh <[email protected]>");
 MODULE_AUTHOR("Patience Warnick <[email protected]>");
 MODULE_DESCRIPTION("Ceph filesystem for Linux");
 MODULE_LICENSE("GPL");
+MODULE_INFO(version, CEPH_VERSION);
#1 lore raw
Quoted 5 lines · Thomas Mueller

hi

reading the version in ceph_fs.h made me think, that now that ceph is in vanilla kernel, it would be nice to have the version linked to the kernel version. this is how the kvm guys work for their backported module.

Hmm, how does that work? This would divorce the kclient version from the server side (which is basically already is, teh CEPH_VERSION* defines are ignored by the kclient currently) and match it up with the kernel version. For most people, that is just whatever upstream kernel they downloaded.

Is the goal just to make the standalone/backported code tell you which version the client code corresponds to? If that's the case, I wonder the defines should be generated exclusively in the backport branches of the -standalone.git repo.

(Currently the only reason those defines are there at all is because the ceph_fs.h header (along with a few others) is periodically synced up with the server code. Probably they should be moved into a non-synced header to avoid that confusion.)

sage

Quoted 49 lines

I've also patched super.c to expose the version to modinfo.

- Thomas

ceph_fs.h +7 -6
index 63ff461..cfc995b 100644
@@ -18,16 +18,17 @@
 /*
  * Ceph release version
  */
-#define CEPH_VERSION_MAJOR 0
-#define CEPH_VERSION_MINOR 20
-#define CEPH_VERSION_PATCH 0
+#define CEPH_VERSION_MAJOR 2
+#define CEPH_VERSION_MINOR 6
+#define CEPH_VERSION_PATCH 35
+#define CEPH_VERSION_FIX 0
 
 #define _CEPH_STRINGIFY(x) #x
 #define CEPH_STRINGIFY(x) _CEPH_STRINGIFY(x)
-#define CEPH_MAKE_VERSION(x, y, z) CEPH_STRINGIFY(x) "." CEPH_STRINGIFY(y) \
-       "." CEPH_STRINGIFY(z)
+#define CEPH_MAKE_VERSION(w, x, y, z) CEPH_STRINGIFY(w) "." CEPH_STRINGIFY(x) \
+       "." CEPH_STRINGIFY(y) "." CEPH_STRINGIFY(z)
 #define CEPH_VERSION CEPH_MAKE_VERSION(CEPH_VERSION_MAJOR, \
-                                      CEPH_VERSION_MINOR, CEPH_VERSION_PATCH)
+                                      CEPH_VERSION_MINOR, CEPH_VERSION_PATCH, CEPH_VERSION_FIX)
 
 /*
  * subprotocol versions.  when specific messages types or high-level
super.c +1 -1
index 27447a2..93d9c59 100644
@@ -1149,3 +1149,4 @@ MODULE_AUTHOR("Yehuda Sadeh <[email protected]>");
 MODULE_AUTHOR("Patience Warnick <[email protected]>");
 MODULE_DESCRIPTION("Ceph filesystem for Linux");
 MODULE_LICENSE("GPL");
+MODULE_INFO(version, CEPH_VERSION);
 
--

To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 9 lines · Sage Weil

, how does that work? This would divorce the kclient version from the server side (which is basically already is, teh CEPH_VERSION* defines are ignored by the kclient currently) and match it up with the kernel version. For most people, that is just whatever upstream kernel they downloaded.

Is the goal just to make the standalone/backported code tell you which version the client code corresponds to? If that's the case, I wonder the defines should be generated exclusively in the backport branches of the -standalone.git repo.

yes and yes - this is only needed in ceph-client-standalone.

fact is, that kernels smaller than 2.6.34 will be standard next years - examples :
* Debian 5.0 2.6.26
* Ubuntu 10.04 LTS: 2.6.32
* Debian 6.0 2.6.32
* RHEL/CentOS 6 2.6.32

they all will need backported ceph modules. if there is no version output in modinfo it will be hard to say which version is loaded.

- Thomas

#3 lore raw
In reply to Thomas Mueller
Quoted 5 lines · Thomas Mueller

hi

reading the version in ceph_fs.h made me think, that now that ceph is in vanilla kernel, it would be nice to have the version linked to the kernel version. this is how the kvm guys work for their backported module.

That makes sense for KVM because it's reached a level of maturity where they only bother doing the backports of specific kernel releases. I don't think it's a good idea for ceph to go this direction yet. Mostly I'd hate to see the standalone client packages only released when there's a new kernel. It seems like something that would be more useful once ceph has some kernel releases under it's belt.

Quoted 6 lines

I've also patched super.c to expose the version to modinfo.

- Thomas

<snip>

#4 lore raw
Quoted 7 lines · Brian Jackson
Quoted 5 lines · Thomas Mueller

hi

reading the version in ceph_fs.h made me think, that now that ceph is in vanilla kernel, it would be nice to have the version linked to the kernel version. this is how the kvm guys work for their backported module.

Quoted 6 lines

That makes sense for KVM because it's reached a level of maturity where they only bother doing the backports of specific kernel releases. I don't think it's a good idea for ceph to go this direction yet. Mostly I'd hate to see the standalone client packages only released when there's a new kernel. It seems like something that would be more useful once ceph has some kernel releases under it's belt.

Cancel that. Talked to sagewk on irc and he said development of the kclient is taking place in upstream git now, so I guess this does make sense.

Quoted 10 lines
Quoted 4 lines

I've also patched super.c to expose the version to modinfo.

- Thomas

<snip>
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html