#include <linux/obd_support.h> /* for OBD_FAIL_CHECK */
#include <linux/lustre_lite.h> /* for ll_i2info */
#include <portals/lib-types.h> /* for PTL_MD_MAX_IOV */
+#include <linux/lprocfs_status.h>
+
+extern lprocfs_vars_t status_var_nm_1[];
+extern lprocfs_vars_t status_class_var[];
static int osc_getattr(struct lustre_handle *conn, struct obdo *oa,
struct lov_stripe_md *md)
cb_data->callback = callback;
cb_data->cb_data = data;
+ CDEBUG(D_PAGE, "data(%p)->desc = %p\n", data, desc);
data->desc = desc;
desc->bd_cb_data = cb_data;
cb_data->callback = callback;
cb_data->cb_data = data;
+ CDEBUG(D_PAGE, "data(%p)->desc = %p\n", data, desc);
data->desc = desc;
desc->bd_cb_data = cb_data;
rc = ldlm_lock_match(obddev->obd_namespace, res_id, type, extent,
sizeof(extent), mode, lockh);
if (rc == 1)
- RETURN(0); /* We already have a lock, and it's referenced */
+ /* We already have a lock, and it's referenced */
+ RETURN(ELDLM_OK);
/* If we're trying to read, we also search for an existing PW lock. The
* VFS and page cache already protect us locally, so lots of readers/
ldlm_lock_addref(lockh, LCK_PR);
ldlm_lock_decref(lockh, LCK_PW);
- RETURN(0);
+ RETURN(ELDLM_OK);
}
}
}
static int osc_cancel_unused(struct lustre_handle *connh,
- struct lov_stripe_md *lsm, int local)
+ struct lov_stripe_md *lsm, int flags)
{
struct obd_device *obddev = class_conn2obd(connh);
__u64 res_id[RES_NAME_SIZE] = { lsm->lsm_object_id };
- return ldlm_cli_cancel_unused(obddev->obd_namespace, res_id, local);
+ return ldlm_cli_cancel_unused(obddev->obd_namespace, res_id, flags);
}
static int osc_statfs(struct lustre_handle *conn, struct obd_statfs *osfs)
return err;
}
+int osc_attach(struct obd_device *dev,
+ obd_count len, void *data)
+{
+ int rc;
+ rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev);
+ return rc;
+}
+
+int osc_detach(struct obd_device *dev)
+{
+ int rc;
+ rc = lprocfs_dereg_obd(dev);
+ return rc;
+
+}
struct obd_ops osc_obd_ops = {
+ o_attach: osc_attach,
+ o_detach: osc_detach,
o_setup: client_obd_setup,
o_cleanup: client_obd_cleanup,
o_statfs: osc_statfs,
static int __init osc_init(void)
{
- return class_register_type(&osc_obd_ops, LUSTRE_OSC_NAME);
+ int rc;
+
+ rc = class_register_type(&osc_obd_ops,
+ (lprocfs_vars_t*)status_class_var,
+ LUSTRE_OSC_NAME);
+ if (rc)
+ RETURN(rc);
+ return 0;
+
}
static void __exit osc_exit(void)