Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232524
b: refs/heads/master
c: 088b3f5
h: refs/heads/master
v: v3
  • Loading branch information
Sage Weil committed Jan 19, 2011
1 parent 0831c6c commit a435ad8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24be0c481067560b11441e794e27f166a3568863
refs/heads/master: 088b3f5e9ee2649f5cfc2f08d8ce654e3eeba310
38 changes: 34 additions & 4 deletions trunk/fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1560,9 +1560,10 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
/* NOTE: no side-effects allowed, until we take s_mutex */

revoking = cap->implemented & ~cap->issued;
if (revoking)
dout(" mds%d revoking %s\n", cap->mds,
ceph_cap_string(revoking));
dout(" mds%d cap %p issued %s implemented %s revoking %s\n",
cap->mds, cap, ceph_cap_string(cap->issued),
ceph_cap_string(cap->implemented),
ceph_cap_string(revoking));

if (cap == ci->i_auth_cap &&
(cap->issued & CEPH_CAP_FILE_WR)) {
Expand Down Expand Up @@ -1942,6 +1943,35 @@ void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc,
}
}

static void kick_flushing_inode_caps(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session,
struct inode *inode)
{
struct ceph_inode_info *ci = ceph_inode(inode);
struct ceph_cap *cap;
int delayed = 0;

spin_lock(&inode->i_lock);
cap = ci->i_auth_cap;
dout("kick_flushing_inode_caps %p flushing %s flush_seq %lld\n", inode,
ceph_cap_string(ci->i_flushing_caps), ci->i_cap_flush_seq);
__ceph_flush_snaps(ci, &session, 1);
if (ci->i_flushing_caps) {
delayed = __send_cap(mdsc, cap, CEPH_CAP_OP_FLUSH,
__ceph_caps_used(ci),
__ceph_caps_wanted(ci),
cap->issued | cap->implemented,
ci->i_flushing_caps, NULL);
if (delayed) {
spin_lock(&inode->i_lock);
__cap_delay_requeue(mdsc, ci);
spin_unlock(&inode->i_lock);
}
} else {
spin_unlock(&inode->i_lock);
}
}


/*
* Take references to capabilities we hold, so that we don't release
Expand Down Expand Up @@ -2689,7 +2719,7 @@ static void handle_cap_import(struct ceph_mds_client *mdsc,
ceph_add_cap(inode, session, cap_id, -1,
issued, wanted, seq, mseq, realmino, CEPH_CAP_FLAG_AUTH,
NULL /* no caps context */);
try_flush_caps(inode, session, NULL);
kick_flushing_inode_caps(mdsc, session, inode);
up_read(&mdsc->snap_rwsem);

/* make sure we re-request max_size, if necessary */
Expand Down

0 comments on commit a435ad8

Please sign in to comment.