last_ino = md->body->ino;
last_gen = md->body->generation;
CDEBUG(D_VFSTRACE,
- "comparing inode %p ino %lu/%u to body %u/%u\n",
+ "comparing inode %p ino %lu/%u/%u to body %u/%u/%u\n",
inode, inode->i_ino, inode->i_generation,
- md->body->ino, md->body->generation);
+ ll_i2info(inode)->lli_mds,
+ md->body->ino, md->body->generation,
+ md->body->mds);
}
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
- if (inode->i_ino != md->body->ino)
- return 0;
-#endif
if (inode->i_generation != md->body->generation)
return 0;
+ if (ll_i2info(inode)->lli_mds != md->body->mds)
+ return 0;
+
/* Apply the attributes in 'opaque' to this inode */
- ll_update_inode(inode, md->body, md->lsm);
+ ll_update_inode(inode, md);
return 1;
}
CDEBUG(D_INODE, "invalidating inode %lu\n",
inode->i_ino);
- truncate_inode_pages(inode->i_mapping, 0);
+ ll_invalidate_inode_pages(inode);
}
if (inode->i_sb->s_root &&
ll_i2uctxt(&data->ctxt, i1, i2);
ll_inode2fid(&data->fid1, i1);
- if (i2)
+ /* it could be directory with mea */
+ data->mea1 = ll_i2info(i1)->lli_mea;
+
+ if (i2) {
ll_inode2fid(&data->fid2, i2);
+ data->mea2 = ll_i2info(i2)->lli_mea;
+ }
data->name = name;
data->namelen = namelen;
atomic_inc(&dentry->d_count);
iput(inode);
dentry->d_flags &= ~DCACHE_LUSTRE_INVALID;
- CDEBUG(D_DENTRY, "alias dentry %*s (%p) parent %p inode %p "
- "refc %d\n", de->d_name.len, de->d_name.name, de,
- de->d_parent, de->d_inode, atomic_read(&de->d_count));
return dentry;
}
if (!it_disposition(it, DISP_LOOKUP_NEG)) {
ENTRY;
- rc = ll_prep_inode(sbi->ll_osc_exp, &inode, request, offset,
- dentry->d_sb);
+ rc = ll_prep_inode(sbi->ll_osc_exp, sbi->ll_mdc_exp,
+ &inode, request, offset, dentry->d_sb);
if (rc)
RETURN(rc);
rc = ll_glimpse_size(inode, &lvb);
if (rc) {
iput(inode);
- RETURN(rc);
+ RETURN(-EIO);
}
inode->i_size = lvb.lvb_size;
}
ll_inode2fid(&pfid, parent);
ll_i2uctxt(&ctxt, parent, NULL);
- rc = mdc_intent_lock(ll_i2mdcexp(parent), &ctxt, &pfid,
- dentry->d_name.name, dentry->d_name.len, NULL, 0,
- NULL, it, flags, &req, ll_mdc_blocking_ast);
+ rc = md_intent_lock(ll_i2mdcexp(parent), &ctxt, &pfid,
+ dentry->d_name.name, dentry->d_name.len, NULL, 0,
+ NULL, it, flags, &req, ll_mdc_blocking_ast);
if (rc < 0)
GOTO(out, retval = ERR_PTR(rc));
out:
if (req)
ptlrpc_req_finished(req);
+ if (dentry->d_inode)
+ CDEBUG(D_INODE, "lookup 0x%p in %lu/%lu: %*s -> %lu/%lu\n",
+ dentry,
+ (unsigned long) parent->i_ino,
+ (unsigned long) parent->i_generation,
+ dentry->d_name.len, dentry->d_name.name,
+ (unsigned long) dentry->d_inode->i_ino,
+ (unsigned long) dentry->d_inode->i_generation);
+ else
+ CDEBUG(D_INODE, "lookup 0x%p in %lu/%lu: %*s -> ??\n",
+ dentry,
+ (unsigned long) parent->i_ino,
+ (unsigned long) parent->i_generation,
+ dentry->d_name.len, dentry->d_name.name);
return retval;
}
LASSERT(it && it->d.lustre.it_disposition);
request = it->d.lustre.it_data;
- rc = ll_prep_inode(sbi->ll_osc_exp, &inode, request, 1, dir->i_sb);
+ rc = ll_prep_inode(sbi->ll_osc_exp, sbi->ll_mdc_exp,
+ &inode, request, 1, dir->i_sb);
if (rc)
GOTO(out, inode = ERR_PTR(rc));
case S_IFIFO:
case S_IFSOCK:
ll_prepare_mdc_op_data(&op_data, dir, NULL, name, len, 0);
- err = mdc_create(sbi->ll_mdc_exp, &op_data, NULL, 0, mode,
+ err = md_create(sbi->ll_mdc_exp, &op_data, NULL, 0, mode,
current->fsuid, current->fsgid,
rdev, &request);
ptlrpc_req_finished(request);
case S_IFIFO:
case S_IFSOCK:
ll_prepare_mdc_op_data(&op_data, dir, NULL, name, len, 0);
- err = mdc_create(sbi->ll_mdc_exp, &op_data, NULL, 0, mode,
+ err = md_create(sbi->ll_mdc_exp, &op_data, NULL, 0, mode,
current->fsuid, current->fsgid,
rdev, &request);
- err = ll_prep_inode(sbi->ll_osc_exp, &inode, request, 0,
- child->d_sb);
+ err = ll_prep_inode(sbi->ll_osc_exp, sbi->ll_mdc_exp,
+ &inode, request, 0, child->d_sb);
if (err)
GOTO(out_err, err);
break;
RETURN(err);
ll_prepare_mdc_op_data(&op_data, dir, NULL, name, len, 0);
- err = mdc_create(sbi->ll_mdc_exp, &op_data,
+ err = md_create(sbi->ll_mdc_exp, &op_data,
tgt, strlen(tgt) + 1, S_IFLNK | S_IRWXUGO,
current->fsuid, current->fsgid, 0, &request);
ptlrpc_req_finished(request);
dir->i_ino, dir->i_generation, dir, name);
ll_prepare_mdc_op_data(&op_data, src, dir, name, len, 0);
- err = mdc_link(sbi->ll_mdc_exp, &op_data, &request);
+ err = md_link(sbi->ll_mdc_exp, &op_data, &request);
ptlrpc_req_finished(request);
RETURN(err);
CDEBUG(D_VFSTRACE, "VFS Op:name=%s,dir=%lu/%u(%p)\n",
name, dir->i_ino, dir->i_generation, dir);
- if (dir->i_nlink >= EXT3_LINK_MAX)
- RETURN(err);
-
mode = (mode & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR;
ll_prepare_mdc_op_data(&op_data, dir, NULL, name, len, 0);
- err = mdc_create(sbi->ll_mdc_exp, &op_data, NULL, 0, mode,
+ err = md_create(sbi->ll_mdc_exp, &op_data, NULL, 0, mode,
current->fsuid, current->fsgid, 0, &request);
ptlrpc_req_finished(request);
RETURN(err);
name, dir->i_ino, dir->i_generation, dir);
ll_prepare_mdc_op_data(&op_data, dir, NULL, name, len, S_IFDIR);
- rc = mdc_unlink(ll_i2sbi(dir)->ll_mdc_exp, &op_data, &request);
+ rc = md_unlink(ll_i2sbi(dir)->ll_mdc_exp, &op_data, &request);
ptlrpc_req_finished(request);
RETURN(rc);
}
GOTO(out_free_memmd, rc = -ENOMEM);
oa->o_id = lsm->lsm_object_id;
+ oa->o_gr = lsm->lsm_object_gr;
oa->o_mode = body->mode & S_IFMT;
- oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE;
+ oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLGROUP;
if (body->valid & OBD_MD_FLCOOKIE) {
oa->o_valid |= OBD_MD_FLCOOKIE;
name, dir->i_ino, dir->i_generation, dir);
ll_prepare_mdc_op_data(&op_data, dir, NULL, name, len, 0);
- rc = mdc_unlink(ll_i2sbi(dir)->ll_mdc_exp, &op_data, &request);
+ rc = md_unlink(ll_i2sbi(dir)->ll_mdc_exp, &op_data, &request);
if (rc)
GOTO(out, rc);
src, newname, tgt->i_ino, tgt->i_generation, tgt);
ll_prepare_mdc_op_data(&op_data, src, tgt, NULL, 0, 0);
- err = mdc_rename(sbi->ll_mdc_exp, &op_data,
- oldname, oldlen, newname, newlen, &request);
+ err = md_rename(sbi->ll_mdc_exp, &op_data,
+ oldname, oldlen, newname, newlen, &request);
if (!err) {
err = ll_objects_destroy(request, src);
}
}
struct inode_operations ll_dir_inode_operations = {
- .link_raw = ll_link_raw,
- .unlink_raw = ll_unlink_raw,
- .symlink_raw = ll_symlink_raw,
- .mkdir_raw = ll_mkdir_raw,
- .rmdir_raw = ll_rmdir_raw,
- .mknod_raw = ll_mknod_raw,
- .mknod = ll_mknod,
- .rename_raw = ll_rename_raw,
- .setattr = ll_setattr,
- .setattr_raw = ll_setattr_raw,
+ link_raw: ll_link_raw,
+ unlink_raw: ll_unlink_raw,
+ symlink_raw: ll_symlink_raw,
+ mkdir_raw: ll_mkdir_raw,
+ rmdir_raw: ll_rmdir_raw,
+ mknod_raw: ll_mknod_raw,
+ mknod: ll_mknod,
+ rename_raw: ll_rename_raw,
+ setattr: ll_setattr,
+ setattr_raw: ll_setattr_raw,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
- .create_it = ll_create_it,
- .lookup_it = ll_lookup_it,
- .revalidate_it = ll_inode_revalidate_it,
+ create_it: ll_create_it,
+ lookup_it: ll_lookup_it,
+ revalidate_it: ll_inode_revalidate_it,
#else
- .lookup = ll_lookup_nd,
- .create = ll_create_nd,
- .getattr_it = ll_getattr,
+ lookup: ll_lookup_nd,
+ create: ll_create_nd,
+ getattr_it: ll_getattr,
#endif
};