int (*lop_next_block)(struct llog_handle *h, int *curr_idx,
int next_idx, __u64 *offset, void *buf, int len);
int (*lop_create)(struct llog_ctxt *ctxt, struct llog_handle **,
- struct llog_logid *logid, char *name);
+ struct llog_logid *logid, char* fsname, char *name);
int (*lop_close)(struct llog_handle *handle);
int (*lop_read_header)(struct llog_handle *handle);
RETURN(-EIO);
}
-static struct file *llog_filp_open(char *name, int flags, int mode)
+static struct file *llog_filp_open(char* fsname, char *name,
+ int flags, int mode)
{
char *logname;
struct file *filp;
OBD_ALLOC(logname, PATH_MAX);
if (logname == NULL)
- return ERR_PTR(-ENOMEM);
+ return ERR_PTR(-ENOMEM);
+ if (fsname)
+ len = snprintf(logname, PATH_MAX, "CONFIGS/%s/%s", fsname, name);
+ else
+ len = snprintf(logname, PATH_MAX, "CONFIGS/%s", name);
- len = snprintf(logname, PATH_MAX, "LOGS/%s", name);
if (len >= PATH_MAX - 1) {
filp = ERR_PTR(-ENAMETOOLONG);
} else {
/* This is a callback from the llog_* functions.
* Assumes caller has already pushed us into the kernel context. */
static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
- struct llog_logid *logid, char *name)
+ struct llog_logid *logid, char* fsname, char *name)
{
struct llog_handle *handle;
struct obd_device *obd;
handle->lgh_id = *logid;
} else if (name) {
- handle->lgh_file = llog_filp_open(name, open_flags, 0644);
+ handle->lgh_file = llog_filp_open(fsname, name, open_flags, 0644);
if (IS_ERR(handle->lgh_file))
GOTO(cleanup, rc = PTR_ERR(handle->lgh_file));
/* This is a callback from the llog_* functions.
* Assumes caller has already pushed us into the kernel context. */
static int llog_client_create(struct llog_ctxt *ctxt, struct llog_handle **res,
- struct llog_logid *logid, char *name)
+ struct llog_logid *logid, char* fsname ,char *name)
{
struct obd_import *imp;
struct llogd_body req_body;
struct llogd_body *body;
struct llog_handle *handle;
struct ptlrpc_request *req = NULL;
- int size[2] = {sizeof(req_body)};
- char *tmp[2] = {(char*) &req_body};
+ int size[3] = {sizeof(req_body)};
+ char *tmp[3] = {(char*) &req_body};
int bufcount = 1;
int repsize[] = {sizeof (req_body)};
int rc;
req_body.lgd_logid = *logid;
req_body.lgd_ctxt_idx = ctxt->loc_idx - 1;
+ if (fsname) {
+ size[bufcount] = strlen(fsname) + 1;
+ tmp[bufcount] = fsname;
+ bufcount++;
+ }
+
if (name) {
size[bufcount] = strlen(name) + 1;
tmp[bufcount] = name;
bufcount++;
}
- req = ptlrpc_prep_req(imp, LLOG_ORIGIN_HANDLE_CREATE,bufcount,size,tmp);
+ req = ptlrpc_prep_req(imp, LLOG_ORIGIN_HANDLE_CREATE,
+ bufcount, size, tmp);
if (!req)
GOTO(err_free, rc = -ENOMEM);