Whamcloud - gitweb
LU-3963 obdclass: convert to linux list api
[fs/lustre-release.git] / lustre / obdclass / class_obd.c
index 6b09174..da38c9a 100644 (file)
@@ -63,7 +63,7 @@ atomic_t libcfs_kmemory = {0};
 
 struct obd_device *obd_devs[MAX_OBD_DEVICES];
 EXPORT_SYMBOL(obd_devs);
-cfs_list_t obd_types;
+struct list_head obd_types;
 DEFINE_RWLOCK(obd_dev_lock);
 
 __u64 obd_max_pages = 0;
@@ -85,8 +85,6 @@ unsigned int obd_dump_on_eviction;
 EXPORT_SYMBOL(obd_dump_on_eviction);
 unsigned int obd_max_dirty_pages = 256;
 EXPORT_SYMBOL(obd_max_dirty_pages);
-atomic_t obd_unstable_pages;
-EXPORT_SYMBOL(obd_unstable_pages);
 atomic_t obd_dirty_pages;
 EXPORT_SYMBOL(obd_dirty_pages);
 unsigned int obd_timeout = OBD_TIMEOUT_DEFAULT;   /* seconds */
@@ -200,19 +198,6 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,
 }
 EXPORT_SYMBOL(obd_alloc_fail);
 
-static inline void obd_data2conn(struct lustre_handle *conn,
-                                 struct obd_ioctl_data *data)
-{
-        memset(conn, 0, sizeof *conn);
-        conn->cookie = data->ioc_cookie;
-}
-
-static inline void obd_conn2data(struct obd_ioctl_data *data,
-                                 struct lustre_handle *conn)
-{
-        data->ioc_cookie = conn->cookie;
-}
-
 int class_resolve_dev_name(__u32 len, const char *name)
 {
         int rc;
@@ -529,7 +514,6 @@ int obd_init_checks(void)
 #define obd_init_checks() do {} while(0)
 #endif
 
-extern spinlock_t obd_types_lock;
 extern int class_procfs_init(void);
 extern int class_procfs_clean(void);
 
@@ -544,7 +528,7 @@ int init_obdclass(void)
         int lustre_register_fs(void);
 
         for (i = CAPA_SITE_CLIENT; i < CAPA_SITE_MAX; i++)
-                CFS_INIT_LIST_HEAD(&capa_list[i]);
+               INIT_LIST_HEAD(&capa_list[i]);
 #endif
 
         LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n");
@@ -576,7 +560,7 @@ int init_obdclass(void)
         if (err)
                 return err;
 
-        CFS_INIT_LIST_HEAD(&obd_types);
+       INIT_LIST_HEAD(&obd_types);
 
        err = misc_register(&obd_psdev);
        if (err) {
@@ -685,7 +669,6 @@ EXPORT_SYMBOL(obd_pages_max);
 #ifdef __KERNEL__
 static void cleanup_obdclass(void)
 {
-        int i;
         int lustre_unregister_fs(void);
         __u64 memory_leaked, pages_leaked;
         __u64 memory_max, pages_max;
@@ -694,15 +677,6 @@ static void cleanup_obdclass(void)
         lustre_unregister_fs();
 
        misc_deregister(&obd_psdev);
-       for (i = 0; i < class_devno_max(); i++) {
-               struct obd_device *obd = class_num2obd(i);
-               if (obd && obd->obd_set_up &&
-                   OBT(obd) && OBP(obd, detach)) {
-                       /* XXX should this call generic detach otherwise? */
-                       LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
-                       OBP(obd, detach)(obd);
-               }
-       }
        llog_info_fini();
 #ifdef HAVE_SERVER_SUPPORT
        lu_ucred_global_fini();