summaryrefslogtreecommitdiffstats
path: root/src/ceph_fuse.cc
diff options
context:
space:
mode:
authorGregory Farnum <greg@gregs42.com>2015-04-30 22:40:03 +0200
committerGregory Farnum <greg@gregs42.com>2015-04-30 22:40:03 +0200
commit5ea754a7dd56b029c2eca0593e1bbe388e450e57 (patch)
tree47cc9713a92dea864cb474bd3f116b45ce0a3094 /src/ceph_fuse.cc
parentMerge pull request #4461 from ceph/wip-11372 (diff)
parentuse get_linux_version() instead ad-hoc uname().release parsing (diff)
downloadceph-5ea754a7dd56b029c2eca0593e1bbe388e450e57.tar.xz
ceph-5ea754a7dd56b029c2eca0593e1bbe388e450e57.zip
Merge pull request #4493 from ceph/wip-use-get-linux-version
use get_linux_version() instead ad-hoc uname().release parsing Reviewed-by: Sage Weil <sage@redhat.com> Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Diffstat (limited to 'src/ceph_fuse.cc')
-rw-r--r--src/ceph_fuse.cc18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc
index b193dd31c6f..4dde41772ff 100644
--- a/src/ceph_fuse.cc
+++ b/src/ceph_fuse.cc
@@ -30,6 +30,7 @@ using namespace std;
#include "common/Timer.h"
#include "common/ceph_argparse.h"
+#include "common/linux_version.h"
#include "global/global_init.h"
#include "common/safe_io.h"
@@ -121,20 +122,11 @@ int main(int argc, const char **argv, const char *envp[]) {
}
virtual ~RemountTest() {}
virtual void *entry() {
- struct utsname os_info;
- int tr = uname(&os_info);
- assert(tr == 0);
- assert(memcmp(os_info.sysname, "Linux", 5) == 0);
- int major, minor;
- char *end_num;
- major = strtol(os_info.release, &end_num, 10);
- assert(major > 0);
- ++end_num;
- minor = strtol(end_num, NULL, 10);
+ int ver = get_linux_version();
+ assert(ver != 0);
bool can_invalidate_dentries = g_conf->client_try_dentry_invalidate &&
- (major < 3 ||
- (major == 3 && minor < 18));
- tr = client->test_dentry_handling(can_invalidate_dentries);
+ ver < KERNEL_VERSION(3, 18, 0);
+ int tr = client->test_dentry_handling(can_invalidate_dentries);
if (tr != 0) {
cerr << "ceph-fuse[" << getpid()
<< "]: fuse failed dentry invalidate/remount test with error "