a module while it is in use, and also removes a bunch of code (125 lines).
- Update 2.5 ll_clear_inode() to match 2.4 code (cancel locks). Currently
commented out, because I'm not sure why it is different (on purpose or
just omission?).
- Add types to obd_{un,}pack_ioo().
rc = obd_connect (&cobd->cobd_cache, cache, NULL, NULL, NULL);
if (rc != 0)
goto fail_0;
-
- MOD_INC_USE_COUNT;
- return (0);
+
+ return (0);
fail_0:
obd_disconnect (&cobd->cobd_target);
rc = obd_disconnect (&cobd->cobd_target);
if (rc != 0)
CERROR ("error %d disconnecting target\n", rc);
-
- MOD_DEC_USE_COUNT;
- return (0);
+
+ return (0);
}
static int
cobd_connect (struct lustre_handle *conn, struct obd_device *obd,
- obd_uuid_t cluuid, struct recovd_obd *recovd,
- ptlrpc_recovery_cb_t recover)
+ obd_uuid_t cluuid, struct recovd_obd *recovd,
+ ptlrpc_recovery_cb_t recover)
{
- int rc = class_connect (conn, obd, cluuid);
+ int rc = class_connect (conn, obd, cluuid);
CERROR ("rc %d\n", rc);
return (rc);
}
static struct obd_ops cobd_ops = {
- o_attach: cobd_attach,
- o_detach: cobd_detach,
+ o_owner: THIS_MODULE,
+ o_attach: cobd_attach,
+ o_detach: cobd_detach,
- o_setup: cobd_setup,
- o_cleanup: cobd_cleanup,
+ o_setup: cobd_setup,
+ o_cleanup: cobd_cleanup,
- o_connect: cobd_connect,
- o_disconnect: cobd_disconnect,
+ o_connect: cobd_connect,
+ o_disconnect: cobd_disconnect,
- o_get_info: cobd_get_info,
- o_statfs: cobd_statfs,
+ o_get_info: cobd_get_info,
+ o_statfs: cobd_statfs,
o_getattr: cobd_getattr,
o_open: cobd_open,
o_preprw: cobd_preprw,
o_commitrw: cobd_commitrw,
o_brw: cobd_brw,
- o_iocontrol: cobd_iocontrol,
+ o_iocontrol: cobd_iocontrol,
};
static int __init
* Common STATUS namespace
*/
-static int
-rd_uuid (char *page, char **start, off_t off, int count,
- int *eof, void *data)
+static int rd_uuid (char *page, char **start, off_t off, int count,
+ int *eof, void *data)
{
struct obd_device* dev = (struct obd_device*)data;
-
+
return (snprintf(page, count, "%s\n", dev->obd_uuid));
}
-static int
-rd_target (char *page, char **start, off_t off, int count,
- int *eof, void *data)
+static int rd_target (char *page, char **start, off_t off, int count,
+ int *eof, void *data)
{
struct obd_device *dev = (struct obd_device*)data;
struct cache_obd *cobd = &dev->u.cobd;
return (rc);
}
-static int
-rd_cache (char *page, char **start, off_t off, int count,
- int *eof, void *data)
+static int rd_cache(char *page, char **start, off_t off, int count,
+ int *eof, void *data)
{
struct obd_device *dev = (struct obd_device*)data;
struct cache_obd *cobd = &dev->u.cobd;
struct lustre_handle *conn = &cobd->cobd_cache;
struct obd_export *exp;
int rc;
-
+
if ((dev->obd_flags & OBD_SET_UP) == 0)
rc = snprintf (page, count, "not set up\n");
else {
{"status/uuid", rd_uuid, 0, 0},
{"status/target_uuid", rd_target, 0, 0},
{"status/cache_uuid", rd_cache, 0, 0},
-
{0}
};
-int
-rd_numrefs (char* page, char **start, off_t off, int count,
- int *eof, void *data)
+int rd_numrefs(char *page, char **start, off_t off, int count,
+ int *eof, void *data)
{
struct obd_type* class = (struct obd_type*)data;
#endif
static struct obd_ops ptlbd_cl_obd_ops = {
- o_setup: ptlbd_cl_setup,
- o_cleanup: ptlbd_cl_cleanup,
+ o_owner: THIS_MODULE,
+ o_setup: ptlbd_cl_setup,
+ o_cleanup: ptlbd_cl_cleanup,
#if 0
- o_connect: ptlbd_cl_connect,
- o_disconnect: class_disconnect
+ o_connect: ptlbd_cl_connect,
+ o_disconnect: class_disconnect
#endif
};
int rc;
ENTRY;
- MOD_INC_USE_COUNT;
#if 0
if (data->ioc_inllen1 < 1) {
CERROR("requires a PTLBD server UUID\n");
- GOTO(out_dec, rc = -EINVAL);
+ RETURN(rc = -EINVAL);
}
if (data->ioc_inllen1 > 37) {
CERROR("PTLBD server UUID must be less than 38 characters\n");
- GOTO(out_dec, rc = -EINVAL);
+ RETURN(rc = -EINVAL);
}
memcpy(server_uuid, data->ioc_inlbuf1, MIN(data->ioc_inllen1,
if (!ptlbd->ptlbd_service) {
CERROR("failed to start service\n");
- GOTO(out_dec, rc = -ENOMEM);
+ RETURN(rc = -ENOMEM);
}
rc = ptlrpc_start_thread(obddev, ptlbd->ptlbd_service, "ptldb");
ptlrpc_stop_all_threads(ptlbd->ptlbd_service);
ptlrpc_unregister_service(ptlbd->ptlbd_service);
- out_dec:
- MOD_DEC_USE_COUNT;
return rc;
}
ptlrpc_unregister_service(ptlbd->ptlbd_service);
ptlbd_sv_already_setup = 0;
- MOD_DEC_USE_COUNT;
RETURN(0);
}
#endif
static struct obd_ops ptlbd_sv_obd_ops = {
-/* o_iocontrol: ptlbd_iocontrol,*/
- o_setup: ptlbd_sv_setup,
- o_cleanup: ptlbd_sv_cleanup,
+ o_owner: THIS_MODULE,
+/* o_iocontrol: ptlbd_iocontrol,*/
+ o_setup: ptlbd_sv_setup,
+ o_cleanup: ptlbd_sv_cleanup,
#if 0
- o_connect: ptlbd_sv_connect,
- o_disconnect: class_disconnect
+ o_connect: ptlbd_sv_connect,
+ o_disconnect: class_disconnect
#endif
};