}
/*
- * Set cap hold timeouts, unless already I_NODELAY.
+ * (re)set cap hold timeouts.
*/
static void __cap_set_timeouts(struct ceph_mds_client *mdsc,
struct ceph_inode_info *ci)
{
struct ceph_mount_args *ma = &mdsc->client->mount_args;
- if (ci->i_ceph_flags & CEPH_I_NODELAY) {
- dout(10, "__cap_set_timeouts %p I_NODELAY\n", &ci->vfs_inode);
- return;
- }
-
ci->i_hold_caps_min = round_jiffies(jiffies +
ma->caps_wanted_delay_min * HZ);
ci->i_hold_caps_max = round_jiffies(jiffies +
* an inode was queued but with i_hold_caps_max=0, meaning it was
* queued for immediate flush, don't reset the timeouts.
*
+ * If I_FLUSH is set, leave the inode at the front of the list.
+ *
* Caller holds i_lock
* -> we take mdsc->cap_delay_lock
*/
if (!mdsc->stopping) {
spin_lock(&mdsc->cap_delay_lock);
if (!list_empty(&ci->i_cap_delay_list)) {
- if (ci->i_ceph_flags & CEPH_I_NODELAY)
+ if (ci->i_ceph_flags & CEPH_I_FLUSH)
goto no_change;
list_del_init(&ci->i_cap_delay_list);
}
}
/*
- * Queue an inode for immediate writeback.
+ * Queue an inode for immediate writeback. Mark inode with I_FLUSH,
+ * indicating we should send a cap message to flush dirty metadata
+ * asap.
*/
static void __cap_delay_requeue_front(struct ceph_mds_client *mdsc,
struct ceph_inode_info *ci)
{
dout(10, "__cap_delay_requeue_front %p\n", &ci->vfs_inode);
spin_lock(&mdsc->cap_delay_lock);
- ci->i_ceph_flags |= CEPH_I_NODELAY;
+ ci->i_ceph_flags |= CEPH_I_FLUSH;
if (!list_empty(&ci->i_cap_delay_list))
list_del_init(&ci->i_cap_delay_list);
list_add(&ci->i_cap_delay_list, &mdsc->cap_delay_list);
want |= cap->mds_wanted;
retain |= cap->issued;
}
- ci->i_ceph_flags &= ~CEPH_I_NODELAY;
+ ci->i_ceph_flags &= ~(CEPH_I_NODELAY | CEPH_I_FLUSH);
cap->issued &= retain; /* drop bits we don't want */
if (cap->implemented & ~cap->issued) {
ci = list_first_entry(&mdsc->cap_delay_list,
struct ceph_inode_info,
i_cap_delay_list);
- if ((ci->i_ceph_flags & CEPH_I_NODELAY) == 0 &&
+ if ((ci->i_ceph_flags & CEPH_I_FLUSH) == 0 &&
time_before(jiffies, ci->i_hold_caps_max))
break;
list_del_init(&ci->i_cap_delay_list);
out << "client_request(" << get_orig_source()
<< ":" << get_tid()
<< " " << ceph_mds_op_name(get_op());
+ if (head.op == CEPH_MDS_OP_SETATTR) {
+ if (head.args.setattr.mask & CEPH_SETATTR_MODE) out << " mode";
+ if (head.args.setattr.mask & CEPH_SETATTR_UID) out << " uid";
+ if (head.args.setattr.mask & CEPH_SETATTR_GID) out << " gid";
+ if (head.args.setattr.mask & CEPH_SETATTR_SIZE) out << " size";
+ if (head.args.setattr.mask & CEPH_SETATTR_MTIME) out << " mtime";
+ if (head.args.setattr.mask & CEPH_SETATTR_ATIME) out << " atime";
+ }
//if (!get_filepath().empty())
out << " " << get_filepath();
if (!get_filepath2().empty())