Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208831
b: refs/heads/master
c: 3b454c4
h: refs/heads/master
i:
  208829: 35f592a
  208827: 996814b
  208823: deb760c
  208815: 9ca7097
  208799: 1acc2f7
  208767: 79798e2
v: v3
  • Loading branch information
Sage Weil committed Aug 2, 2010
1 parent b12b85e commit 44f0b28
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 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: 38e8883ee31667d901feb9106f4863af35948c91
refs/heads/master: 3b454c4945c756686e91d77eeefac80cb5d21baf
30 changes: 18 additions & 12 deletions trunk/fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2278,8 +2278,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
* try to invalidate (once). (If there are dirty buffers, we
* will invalidate _after_ writeback.)
*/
if (((cap->issued & ~newcaps) & (CEPH_CAP_FILE_CACHE|
CEPH_CAP_FILE_LAZYIO)) &&
if (((cap->issued & ~newcaps) & CEPH_CAP_FILE_CACHE) &&
(newcaps & CEPH_CAP_FILE_LAZYIO) == 0 &&
!ci->i_wrbuffer_ref) {
if (try_nonblocking_invalidate(inode) == 0) {
revoked_rdcache = 1;
Expand Down Expand Up @@ -2371,16 +2371,22 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,

/* revocation, grant, or no-op? */
if (cap->issued & ~newcaps) {
dout("revocation: %s -> %s\n", ceph_cap_string(cap->issued),
ceph_cap_string(newcaps));
if ((used & ~newcaps) & CEPH_CAP_FILE_BUFFER)
writeback = 1; /* will delay ack */
else if (dirty & ~newcaps)
check_caps = 1; /* initiate writeback in check_caps */
else if (((used & ~newcaps) & (CEPH_CAP_FILE_CACHE|
CEPH_CAP_FILE_LAZYIO)) == 0 ||
revoked_rdcache)
check_caps = 2; /* send revoke ack in check_caps */
int revoking = cap->issued & ~newcaps;

dout("revocation: %s -> %s (revoking %s)\n",
ceph_cap_string(cap->issued),
ceph_cap_string(newcaps),
ceph_cap_string(revoking));
if (revoking & CEPH_CAP_FILE_BUFFER)
writeback = 1; /* initiate writeback; will delay ack */
else if (revoking == CEPH_CAP_FILE_CACHE &&
(newcaps & CEPH_CAP_FILE_LAZYIO) == 0 &&
queue_invalidate)
; /* do nothing yet, invalidation will be queued */
else if (cap == ci->i_auth_cap)
check_caps = 1; /* check auth cap only */
else
check_caps = 2; /* check all caps */
cap->issued = newcaps;
cap->implemented |= newcaps;
} else if (cap->issued == newcaps) {
Expand Down

0 comments on commit 44f0b28

Please sign in to comment.