From 8c025b9281a66c7c7b453fb1950478e5a3e18c62 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 29 Apr 2008 14:08:40 -0700 Subject: [PATCH] kclient: disable sysfs for < 2.6.25 --- src/kernel/client.c | 4 ++++ src/kernel/super.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/kernel/client.c b/src/kernel/client.c index e7a78699cce6b..5aed7698ed27d 100644 --- a/src/kernel/client.c +++ b/src/kernel/client.c @@ -170,9 +170,11 @@ static void handle_monmap(struct ceph_client *client, struct ceph_msg *msg) le64_to_cpu(client->monc.monmap->fsid.major), le64_to_cpu(client->monc.monmap->fsid.minor)); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) client->client_kobj = kobject_create_and_add(name, ceph_kobj); //client->fsid_kobj = kobject_create_and_add("fsid", //client->client_kobj); +#endif } } @@ -251,8 +253,10 @@ void ceph_destroy_client(struct ceph_client *cl) /* unmount */ /* ... */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) if (cl->client_kobj) kobject_put(cl->client_kobj); +#endif if (cl->wb_wq) destroy_workqueue(cl->wb_wq); ceph_messenger_destroy(cl->msgr); diff --git a/src/kernel/super.c b/src/kernel/super.c index 2a7218d99a099..354c809b9ac4c 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -563,9 +563,11 @@ static int __init init_ceph(void) dout(1, "init_ceph\n"); spin_lock_init(&ceph_client_spinlock); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) ceph_kobj = kobject_create_and_add("ceph", fs_kobj); if (!ceph_kobj) return -ENOMEM; +#endif ceph_fs_proc_init(); @@ -583,8 +585,10 @@ static void __exit exit_ceph(void) { dout(1, "exit_ceph\n"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) kobject_put(ceph_kobj); ceph_kobj = 0; +#endif unregister_filesystem(&ceph_fs_type); destroy_inodecache(); -- 2.39.5