kclient: request larger max_size when needed (not done yet)

This commit is contained in:
Sage Weil 2008-04-09 17:31:00 -07:00
parent 02d7e8da02
commit ebae73f593
4 changed files with 12 additions and 6 deletions

View File

@ -834,7 +834,7 @@ retry:
ceph_mdsc_send_cap_ack(mdsc, ceph_ino(&ci->vfs_inode),
keep, wanted, seq,
size, max_size, &mtime, &atime, mds);
size, 0, &mtime, &atime, mds);
if (dropping & CEPH_CAP_RDCACHE) {
dout(20, "invalidating pages on %p\n", &ci->vfs_inode);
@ -999,6 +999,7 @@ int ceph_handle_cap_grant(struct inode *inode, struct ceph_mds_file_caps *grant,
cap->implemented = newcaps;
/* ack now. re-use incoming message. */
grant->size = le64_to_cpu(inode->i_size);
grant->max_size = 0; /* don't re-request */
ceph_encode_timespec(&grant->mtime, &inode->i_mtime);
ceph_encode_timespec(&grant->atime, &inode->i_atime);
reply = 1;
@ -1094,8 +1095,13 @@ int ceph_get_cap_refs(struct ceph_inode_info *ci, int need, int want, int *got,
need, want);
spin_lock(&ci->vfs_inode.i_lock);
if (offset >= 0 && offset >= (loff_t)ci->i_max_size) {
dout(20, "get_cap_refs offset %llu >= max_size %llu\n",
offset, ci->i_max_size);
if (offset > (ci->vfs_inode.i_size << 1)) {
dout(20, "get_cap_refs offset %llu >= max_size %llu\n",
offset, ci->i_max_size);
} else
dout(20, "get_cap_refs offset %llu >= max_size %llu\n",
offset, ci->i_max_size);
goto sorry;
}
have = __ceph_caps_issued(ci);

View File

@ -1327,7 +1327,7 @@ void ceph_mdsc_handle_filecaps(struct ceph_mds_client *mdsc,
dout(10, "wtf, i don't have ino %lu=%llx? closing out cap\n",
inot, ino);
ceph_mdsc_send_cap_ack(mdsc, ino, 0, 0, seq,
size, max_size, 0, 0, mds);
size, 0, 0, 0, mds);
return;
}

View File

@ -157,7 +157,7 @@ struct ceph_inode_info {
int i_nr_by_mode[4];
loff_t i_max_size; /* size authorized by mds */
loff_t i_reported_size; /* size we're reported to mds(s) */
loff_t i_reported_size; /* (max_)size reported to or requested of mds */
struct timespec i_old_atime;
/* held references to caps */

View File

@ -43,7 +43,7 @@ do
done
# mds
$CEPH_BIN/cmds $ARGS --debug_mds 20 --debug_timer 50 --debug_ms 20 --debug 50
$CEPH_BIN/cmds $ARGS --debug_mds 20 --debug_ms 1
echo "started. stop.sh to stop. see out/* (e.g. 'tail -f out/????') for debug output."