RETURN(class_handle2object(handle->cookie));
}
-static void mds_mfd_put(struct mds_file_data *mfd)
+void mds_mfd_put(struct mds_file_data *mfd)
{
CDEBUG(D_INFO, "PUTting mfd %p : new refcount %d\n", mfd,
atomic_read(&mfd->mfd_refcount) - 1);
if (!(body->valid & OBD_MD_FLEASIZE))
body->valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS |
OBD_MD_FLATIME | OBD_MD_FLMTIME);
+ DEBUG_REQ(D_ERROR, req, "no capa for "DLID4, OLID4(&body->id1));
}
/* If we have -EEXIST as the status, and we were asked to create
.lc_uid = rec->ur_uc.luc_uid,
.lc_op = capa_op(rec->ur_flags),
.lc_ino = dchild->d_inode->i_ino,
+ .lc_igen = dchild->d_inode->i_generation,
.lc_mdsid = mds->mds_num,
};
}
}
- if (!(rec->ur_flags & O_EXCL)) { /* bug 3313 */
- rc = fsfilt_commit(obd, dchild->d_inode->i_sb,
- dchild->d_inode, handle,
- req->rq_export->exp_sync);
- handle = NULL;
- }
-
+ rc = fsfilt_commit(obd, dchild->d_inode->i_sb, dchild->d_inode, handle, 0);
+ handle = NULL;
acc_mode = 0; /* Don't check for permissions */
}
mds_pack_inode2body(obd, body, dchild->d_inode, 1);
}
#else
/* re-enable test 24n in sanity.sh: it needs LOOKUP lock on open */
-#warning "disable opencache lock for CMD2"
#endif
/* Step 5: mds_open it */
mds_lock_new_child(obd, dchild->d_inode, NULL);
}
/* audit stuff for OPEN */
- if (offset == 3 && (dchild->d_inode || dparent)) {
- struct lustre_id au_id;
- struct inode * au_inode = dchild->d_inode;
-
- if (au_inode == NULL) {
- au_inode = dparent->d_inode;
- au_id = *(rec->ur_id1);
- mds_audit_open(req, &au_id, au_inode,
- rec->ur_name, rec->ur_namelen - 1,
- rc);
- } else {
- if (fid == 0)
- mds_read_inode_sid(obd, au_inode, &au_id);
- else
- mds_inode2id(obd, &au_id, au_inode, fid);
- mds_audit_open(req, &au_id, au_inode,
- NULL, 0, rc);
- }
+ if (offset == 3) {
+ mds_audit(req, dchild, rec->ur_name,
+ rec->ur_namelen - 1, AUDIT_OPEN, rc);
}
l_dput(dchild);
request_body->io_epoch);
i_size_write(inode, request_body->size);
inode->i_blocks = request_body->blocks;
+ LTIME_S(inode->i_mtime) = (request_body->mtime);
+
+ LTIME_S(iattr.ia_mtime) = request_body->mtime;
iattr.ia_size = inode->i_size;
- iattr.ia_valid |= ATTR_SIZE;
+ iattr.ia_valid |= ATTR_SIZE|ATTR_MTIME;
mds_inode_unset_attrs_old(inode);
}
}
__u64 lov_merge_size(struct lov_stripe_md *lsm, int kms);
__u64 lov_merge_blocks(struct lov_stripe_md *lsm);
+__u64 lov_merge_mtime(struct lov_stripe_md *lsm, __u64 current_time);
int mds_validate_size(struct obd_device *obd, struct inode *inode,
struct mds_body *body, struct iattr *iattr)
i_size_write(inode, lov_merge_size(lsm, 0));
inode->i_blocks = lov_merge_blocks(lsm);
+ LTIME_S(inode->i_mtime) = lov_merge_mtime(lsm, LTIME_S(inode->i_mtime));
iattr->ia_size = inode->i_size;
- iattr->ia_valid |= ATTR_SIZE;
+ LTIME_S(iattr->ia_mtime) = LTIME_S(inode->i_mtime);
+ iattr->ia_valid |= ATTR_SIZE | ATTR_MTIME;
+
DOWN_WRITE_I_ALLOC_SEM(inode);
mds_inode_unset_attrs_old(inode);
UP_WRITE_I_ALLOC_SEM(inode);