struct lov_stripe_md {
__u32 lmd_magic;
- __u32 lmd_easize; /* packed size for MDS of ea */
+ __u32 lmd_mds_easize; /* packed size for MDS of ea */
__u64 lmd_object_id; /* lov object id */
__u64 lmd_stripe_offset; /* offset of the stripe */
__u64 lmd_stripe_size; /* size of the stripe */
struct semaphore cl_sem;
int cl_conn_count;
__u8 cl_target_uuid[37]; /* XXX -> lustre_name */
- int cl_max_mdsize;
+ int cl_max_mds_easize;
};
struct mds_obd {
cli->cl_import.imp_client = &obddev->obd_ldlm_client;
cli->cl_import.imp_obd = obddev;
- cli->cl_max_mdsize = sizeof(struct lov_mds_md);
+ cli->cl_max_mds_easize = sizeof(struct lov_mds_md);
MOD_INC_USE_COUNT;
RETURN(0);
{
int i;
mdsmd->lmd_magic = md->lmd_magic;
- mdsmd->lmd_easize = md->lmd_easize;
+ mdsmd->lmd_easize = md->lmd_mds_easize;
mdsmd->lmd_object_id = md->lmd_object_id;
mdsmd->lmd_stripe_offset = md->lmd_stripe_offset;
mdsmd->lmd_stripe_count = md->lmd_stripe_count;
{
int i;
md->lmd_magic = mdsmd->lmd_magic;
- md->lmd_easize = mdsmd->lmd_easize;
+ md->lmd_mds_easize = mdsmd->lmd_easize;
md->lmd_object_id = mdsmd->lmd_object_id;
md->lmd_stripe_offset = mdsmd->lmd_stripe_offset;
md->lmd_stripe_count = mdsmd->lmd_stripe_count;
RETURN(-ENOMEM);
}
oa->o_mode = S_IFREG | 0600;
- oa->o_easize = mdc->cl_max_mdsize;
+ oa->o_easize = mdc->cl_max_mds_easize;
oa->o_id = inode->i_ino;
oa->o_valid = OBD_MD_FLMODE | OBD_MD_FLEASIZE |
OBD_MD_FLID;
out_destroy:
if (smd) {
- oa.o_easize = smd->lmd_easize;
+ oa.o_easize = smd->lmd_mds_easize;
oa.o_valid |= OBD_MD_FLEASIZE;
err = obd_destroy(ll_i2obdconn(dir), &oa, smd);
if (err)
#ifndef log2
#define log2(n) ffz(~(n))
#endif
+inline int ll_mds_easize(struct super_block *sb)
+{
+ struct client_obd *mdc = sbi2mdc(ll_s2sbi(sb));
+ return mdc->cl_max_mds_easize;
+}
+
+inline int ll_lov_easize(struct lov_stripe_md *md)
+{
+ return sizeof(*md) + md->lmd_stripe_count *
+ sizeof(struct lov_oinfo);
+}
static struct super_block * ll_read_super(struct super_block *sb,
void *data, int silent)
char *symlink_name = lli->lli_symlink_name;
if (md) {
- int size = sizeof(*md) +
- md->lmd_stripe_count * sizeof(struct lov_oinfo);
+ int size = ll_lov_easize(md);
OBD_FREE(md, size);
lli->lli_smd = NULL;
}
GOTO(out, -ENOMEM);
oa->o_id = md->lmd_object_id;
- oa->o_easize = md->lmd_easize;
+ oa->o_easize = md->lmd_mds_easize;
oa->o_mode = inode->i_mode;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLEASIZE | OBD_MD_FLMODE;
RETURN(rc);
}
-inline int ll_stripe_mds_md_size(struct super_block *sb)
-{
- struct client_obd *mdc = sbi2mdc(ll_s2sbi(sb));
- return mdc->cl_max_mdsize;
-}
static void ll_read_inode2(struct inode *inode, void *opaque)
{
if (md && md->md && md->md->lmd_stripe_count) {
struct lov_mds_md *smd = md->md;
int size;
- if (md->md->lmd_easize != ll_stripe_mds_md_size(inode->i_sb)) {
+ if (md->md->lmd_easize != ll_mds_easize(inode->i_sb)) {
CERROR("Striping metadata size error %ld\n",
inode->i_ino);
LBUG();
}
- size = sizeof(*lli->lli_smd) +
- md->md->lmd_stripe_count * sizeof(struct lov_oinfo);
+ size = ll_lov_easize(lli->lli_smd);
OBD_ALLOC(lli->lli_smd, size);
if (!lli->lli_smd) {
CERROR("No memory for %d\n", size);
GOTO(out, rc = -EINVAL);
}
- mdc->cl_max_mdsize = sizeof(struct lov_mds_md) +
+ mdc->cl_max_mds_easize = sizeof(struct lov_mds_md) +
desc->ld_tgt_count * sizeof(struct lov_object_id);
if (memcmp(obd->obd_uuid, desc->ld_uuid, sizeof(desc->ld_uuid))) {
}
md = *ea;
- md->lmd_easize = lov_mds_md_size(export->exp_obd);
+ md->lmd_mds_easize = lov_mds_md_size(export->exp_obd);
md->lmd_object_id = oa->o_id;
if (!md->lmd_stripe_count)
md->lmd_stripe_count = lov->desc.ld_default_stripe_count;
continue;
submd.lmd_object_id = md->lmd_oinfo[i].loi_id;
- submd.lmd_easize = sizeof(struct lov_mds_md);
- submd.lmd_stripe_count = md->lmd_stripe_count;
+ submd.lmd_mds_easize = sizeof(struct lov_mds_md);
+ submd.lmd_stripe_count = 0;
/* XXX submd is not fully initialized here */
rc = obd_enqueue(&(lov->tgts[i].conn), &submd, parent_lock,
type, &sub_ext, sizeof(sub_ext), mode,
continue;
submd.lmd_object_id = md->lmd_oinfo[i].loi_id;
- submd.lmd_easize = sizeof(struct lov_mds_md);
+ submd.lmd_mds_easize = sizeof(struct lov_mds_md);
+ submd.lmd_stripe_count = 0;
rc = obd_cancel(&lov->tgts[i].conn, &submd, mode, &lockhs[i]);
if (rc)
CERROR("Error cancel object "LPD64" subobj "LPD64"\n",
dir->i_ino, namelen, name);
LBUG();
}
- size[2] = smd->lmd_easize;
+ size[2] = smd->lmd_mds_easize;
bufcount = 3;
} else if (S_ISLNK(mode)) {
size[2] = tgtlen + 1;
if (S_ISREG(type)) {
struct client_obd *mdc = &class_conn2obd(conn)->u.cli;
bufcount = 2;
- size[1] = mdc->cl_max_mdsize;
+ size[1] = mdc->cl_max_mds_easize;
} else if (valid & OBD_MD_LINKNAME) {
bufcount = 2;
size[1] = ea_size;
int rc, flags;
int repsize[3] = {sizeof(struct ldlm_reply),
sizeof(struct mds_body),
- obddev->u.cli.cl_max_mdsize};
+ obddev->u.cli.cl_max_mds_easize};
struct ldlm_reply *dlm_rep;
struct ldlm_intent *lit;
ENTRY;
if (smd != NULL) {
bufcount = 2;
- size[1] = smd->lmd_easize;
+ size[1] = smd->lmd_mds_easize;
}
req = ptlrpc_prep_req(class_conn2cliimp(conn), MDS_OPEN, bufcount, size,
OBD_ALLOC(*ea, oa->o_easize);
if (!*ea)
RETURN(-ENOMEM);
- (*ea)->lmd_easize = oa->o_easize;
+ (*ea)->lmd_mds_easize = oa->o_easize;
}
request = ptlrpc_prep_req(class_conn2cliimp(conn), OST_CREATE, 1, &size,
local[mapped].addr = kmap(pga[mapped].pg);
CDEBUG(D_INFO, "kmap(pg) = %p ; pg->flags = %lx ; pg->count = "
- "%d ; pg->virtual = %p ; page %d of %d\n",
+ "%d ; page %d of %d\n",
local[mapped].addr, pga[mapped].pg->flags,
- page_count(pga[mapped].pg), pga[mapped].pg->virtual,
+ page_count(pga[mapped].pg),
mapped, page_count - 1);
local[mapped].offset = pga[mapped].off;
ptl_process_id_t source_id;
ENTRY;
+ if (desc->bd_page_count > PTL_MD_MAX_IOV) {
+ CERROR("iov longer than %d not supported\n", PTL_MD_MAX_IOV);
+ RETURN(-EINVAL);
+ }
+
iov = ptlrpc_get_bulk_iov (desc);
if (iov == NULL)
return (-ENOMEM);