* Copyright 2009 Sun Microsystems, Inc. All rights reserved
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Intel, Inc.
+ * Copyright (c) 2012, Intel Corporation.
*
*/
/*
struct lu_device_type *ldt, struct lustre_cfg *cfg)
{
struct dt_device_param ddp;
- struct proc_dir_entry *lov_proc_dir;
struct obd_device *obd;
int rc;
ENTRY;
if (rc)
GOTO(out_disconnect, rc);
- /* for compatibility we link old procfs's OSC entries to osp ones */
- lov_proc_dir = lprocfs_srch(proc_lustre_root, "lov");
- if (lov_proc_dir) {
- cfs_proc_dir_entry_t *symlink = NULL;
- char *name;
- OBD_ALLOC(name, strlen(obd->obd_name) + 1);
- if (name) {
- strcpy(name, obd->obd_name);
- if (strstr(name, "lov"))
- symlink = lprocfs_add_symlink(name,
- lov_proc_dir,
- "../lod/%s",
- obd->obd_name);
- OBD_FREE(name, strlen(obd->obd_name) + 1);
- lod->lod_symlink = symlink;
- }
- }
+ rc = lod_procfs_init(lod);
+ if (rc)
+ GOTO(out_pools, rc);
- cfs_mutex_init(&lod->lod_mutex);
- cfs_init_rwsem(&lod->lod_rw_sem);
- cfs_spin_lock_init(&lod->lod_desc_lock);
+ mutex_init(&lod->lod_mutex);
+ init_rwsem(&lod->lod_rw_sem);
+ spin_lock_init(&lod->lod_desc_lock);
RETURN(0);
+out_pools:
+ lod_pools_fini(lod);
out_disconnect:
obd_disconnect(lod->lod_child_exp);
RETURN(rc);
struct lod_device *lod = lu2lod_dev(d);
ENTRY;
- if (lod->lod_symlink)
- lprocfs_remove(&lod->lod_symlink);
-
lod_pools_fini(lod);
+ lod_procfs_fini(lod);
+
RETURN(NULL);
}
*exp = class_conn2export(&conn);
- cfs_mutex_lock(&lod->lod_mutex);
+ mutex_lock(&lod->lod_mutex);
lod->lod_connects++;
/* at the moment we expect the only user */
LASSERT(lod->lod_connects == 1);
- cfs_mutex_unlock(&lod->lod_mutex);
+ mutex_unlock(&lod->lod_mutex);
RETURN(0);
}
ENTRY;
/* Only disconnect the underlying layers on the final disconnect. */
- cfs_mutex_lock(&lod->lod_mutex);
+ mutex_lock(&lod->lod_mutex);
lod->lod_connects--;
if (lod->lod_connects != 0) {
/* why should there be more than 1 connect? */
- cfs_mutex_unlock(&lod->lod_mutex);
+ mutex_unlock(&lod->lod_mutex);
CERROR("%s: disconnect #%d\n", exp->exp_obd->obd_name,
lod->lod_connects);
goto out;
}
- cfs_mutex_unlock(&lod->lod_mutex);
+ mutex_unlock(&lod->lod_mutex);
/* the last user of lod has gone, let's release the device */
release = 1;