For newly created files, this avoids contention in the MDS over the dentry
xlock (e.g., for an untar).
It is slightly risky, because we could race with a caps release and MDS
cache trim. Pretty unlikely, however, because cap release would also
involve MDS journaling.
int pathlen;
struct ceph_mds_request *req;
u64 pathbase;
+ int issued = ceph_caps_issued(ceph_inode(dentry->d_inode));
- if (ia_valid & ATTR_FILE) {
+ if ((ia_valid & ATTR_FILE) ||
+ (issued & (CEPH_CAP_WR|CEPH_CAP_WRBUFFER))) {
dout(5, "prepare_setattr dentry %p (inode %llx.%llx)\n", dentry,
ceph_vinop(dentry->d_inode));
req = ceph_mdsc_create_request(mdsc, op,