(bits & MDS_INODELOCK_UPDATE)) {
struct dentry *dentry, *tmp, *dir;
struct list_head *list;
-
+
CDEBUG(D_INODE, "invalidating inode %lu\n",
inode->i_ino);
truncate_inode_pages(inode->i_mapping, 0);
-
+
/* Drop possible cached negative dentries */
list = &inode->i_dentry;
dir = NULL;
spin_lock(&dcache_lock);
-
- /* It is possible to have several dentries (with
+
+ /* It is possible to have several dentries (with
racer?) */
while ((list = list->next) != &inode->i_dentry) {
dir = list_entry(list, struct dentry, d_alias);
dir = NULL;
}
-
+
if (dir) {
restart:
- list_for_each_entry_safe(dentry, tmp,
- &dir->d_subdirs,
+ list_for_each_entry_safe(dentry, tmp,
+ &dir->d_subdirs,
d_child)
{
/* XXX Print some debug here? */
- if (!dentry->d_inode)
- /* Negative dentry. If we were
- dropping dcache lock, go
+ if (!dentry->d_inode)
+ /* Negative dentry. If we were
+ dropping dcache lock, go
throught the list again */
if (ll_drop_dentry(dentry))
goto restart;
ll_d_add(*de, inode);
spin_unlock(&dcache_lock);
} else {
- (*de)->d_inode = NULL;
+ (*de)->d_inode = NULL;
}
}
opc = LUSTRE_OPC_CREATE;
else
opc = LUSTRE_OPC_ANY;
-
+
op_data = ll_prep_md_op_data(NULL, parent, NULL, dentry->d_name.name,
dentry->d_name.len, lookup_flags, opc);
+
if (op_data == NULL)
RETURN(ERR_PTR(-ENOMEM));
if (de)
dentry = de;
if ((nd->flags & LOOKUP_OPEN) && !IS_ERR(dentry)) { /* Open */
- if (dentry->d_inode &&
+ if (dentry->d_inode &&
it_disposition(it, DISP_OPEN_OPEN)) { /* nocreate */
#ifdef HAVE_FILE_IN_STRUCT_INTENT
if (S_ISFIFO(dentry->d_inode->i_mode)) {
de = (struct dentry *) filp;
}
#endif
-
+
}
#else /* HAVE_FILE_IN_STRUCT_INTENT */
/* Release open handle as we have no way to
/* mtime is always updated with ctime, but can be set in past.
As write and utime(2) may happen within 1 second, and utime's
- mtime has a priority over write's one, so take mtime from mds
+ mtime has a priority over write's one, so take mtime from mds
for the same ctimes. */
if (body->valid & OBD_MD_FLCTIME &&
body->ctime >= LTIME_S(inode->i_ctime)) {
if (body->valid & OBD_MD_FLMTIME) {
CDEBUG(D_INODE, "setting ino %lu mtime from %lu "
- "to "LPU64"\n", inode->i_ino,
+ "to "LPU64"\n", inode->i_ino,
LTIME_S(inode->i_mtime), body->mtime);
LTIME_S(inode->i_mtime) = body->mtime;
}
{
struct lookup_intent *it = ll_d2d(dentry)->lld_it;
int rc;
-
+
if (!it)
return ll_mknod_generic(dir, &dentry->d_name, mode, 0, dentry);
-
+
ll_d2d(dentry)->lld_it = NULL;
-
+
/* Was there an error? Propagate it! */
if (it->d.lustre.it_status) {
rc = it->d.lustre.it_status;
goto out;
- }
-
+ }
+
rc = ll_create_it(dir, dentry, mode, it);
#ifdef HAVE_FILE_IN_STRUCT_INTENT
if (nd && (nd->flags & LOOKUP_OPEN) && dentry->d_inode) { /* Open */
src->i_ino, src->i_generation, src, dir->i_ino,
dir->i_generation, dir, name->len, name->name);
- op_data = ll_prep_md_op_data(NULL, src, dir, name->name, name->len,
+ op_data = ll_prep_md_op_data(NULL, src, dir, name->name, name->len,
0, LUSTRE_OPC_ANY);
if (op_data == NULL)
RETURN(-ENOMEM);
struct md_op_data *op_data;
int err;
ENTRY;
-
+
CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n",
name->len, name->name, dir->i_ino, dir->i_generation, dir);
err = md_create(sbi->ll_md_exp, op_data, NULL, 0, mode,
current->fsuid, current->fsgid,
current->cap_effective, 0, &request);
-
+
ll_finish_md_op_data(op_data);
if (err == 0) {
ll_update_times(request, REPLY_REC_OFF, dir);
CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n",
name->len, name->name, dir->i_ino, dir->i_generation, dir);
- op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name,
+ op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name,
name->len, 0, LUSTRE_OPC_ANY);
if (op_data == NULL)
RETURN(-ENOMEM);
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
ll_finish_md_op_data(op_data);
-
+
if (rc)
GOTO(out, rc);
src->i_ino, src->i_generation, src, tgt_name->len,
tgt_name->name, tgt->i_ino, tgt->i_generation, tgt);
- op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, 0,
+ op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, 0,
LUSTRE_OPC_ANY);
if (op_data == NULL)
RETURN(-ENOMEM);
.setattr = ll_setattr,
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
.getattr = ll_getattr,
-#else
+#else
.revalidate_it = ll_inode_revalidate_it,
#endif
.permission = ll_inode_permission,
PFID(pid));
RETURN(0);
}
-
+
mea_idx = raw_name2idx(obj->lo_hashtype, obj->lo_objcount,
(char *)op->op_name, op->op_namelen);
mds = obj->lo_inodes[mea_idx].li_mds;
rc);
RETURN(rc);
}
-
+
CDEBUG(D_INFO, "Allocate new fid "DFID" for split "
"obj\n", PFID(fid));
-
+
RETURN(rc);
}
*sop_data = *op_data;
repeat:
+
LASSERT(++loop <= 2);
obj = lmv_obj_grab(obd, &rpid);
if (obj) {
int mea_idx;
-
+
/*
* Directory is already split, so we have to forward request to
* the right MDS.
op_data->op_namelen);
rpid = obj->lo_inodes[mea_idx].li_fid;
+
tgt_exp = lmv_get_export(lmv, obj->lo_inodes[mea_idx].li_mds);
sop_data->op_bias &= ~MDS_CHECK_SPLIT;
lmv_obj_put(obj);
}
if (IS_ERR(tgt_exp))
GOTO(out_free_sop_data, rc = PTR_ERR(tgt_exp));
-
+
sop_data->op_fid1 = rpid;
if (it->it_op & IT_CREAT) {
- /*
+ /*
* For open with IT_CREATE and for IT_CREATE cases allocate new
* fid and setup FLD for it.
*/
else if (rc)
GOTO(out_free_sop_data, rc);
}
-
+
rc = md_intent_lock(tgt_exp, sop_data, lmm, lmmsize, it, flags,
reqp, cb_blocking, extra_lock_flags);
if (rc == -ERESTART) {
LASSERT(*reqp != NULL);
- DEBUG_REQ(D_WARNING|D_RPCTRACE, *reqp,
+ DEBUG_REQ(D_WARNING|D_RPCTRACE, *reqp,
"Got -ERESTART during open!\n");
ptlrpc_req_finished(*reqp);
*reqp = NULL;
it->d.lustre.it_data = 0;
-
+
/*
* Directory got split. Time to update local object and repeat
* the request with proper MDS.
goto repeat;
}
}
-
+
if (rc != 0)
GOTO(out_free_sop_data, rc);
obj = lmv_obj_grab(obd, &op_data->op_fid1);
if (obj && op_data->op_namelen) {
int mea_idx;
-
+
/* directory is already split. calculate mds */
mea_idx = raw_name2idx(obj->lo_hashtype, obj->lo_objcount,
(char *)op_data->op_name,
if (rc == -ERESTART) {
LASSERT(*reqp != NULL);
- DEBUG_REQ(D_WARNING|D_RPCTRACE, *reqp,
+ DEBUG_REQ(D_WARNING|D_RPCTRACE, *reqp,
"Got -ERESTART during lookup!\n");
ptlrpc_req_finished(*reqp);
*reqp = NULL;
master = 1;
cb = cb_blocking;
}
-
+
op_data->op_fid1 = fid;
op_data->op_fid2 = fid;
op_data->op_bias = MDS_CROSS_REF;
if (rc < 0)
GOTO(cleanup, rc);
-
+
if (master) {
LASSERT(master_valid == 0);
/* save lock on master to be returned to the caller */