4 #include <linux/kernel.h>
5 #include <linux/sched.h>
6 #include <linux/slab.h>
8 #include <linux/wait.h>
46 #define MAX_CAP_STR 20
49 static int last_cap_str;
51 static char *gcap_string(
char *
s,
int c)
76 spin_lock(&cap_str_lock);
80 spin_unlock(&cap_str_lock);
90 s = gcap_string(s, c);
96 s = gcap_string(s, c);
102 s = gcap_string(s, c);
108 s = gcap_string(s, c);
160 dout(
"reserve caps ctx=%p need=%d\n", ctx, need);
175 for (i = have; i < need; i++) {
179 goto out_alloc_count;
184 BUG_ON(have + alloc != need);
197 dout(
"reserve caps ctx=%p %d = %d used + %d resv + %d avail\n",
204 pr_warning(
"reserve caps ctx=%p ENOMEM need=%d got=%d\n",
212 dout(
"unreserve caps ctx=%p count=%d\n", ctx, ctx->
count);
219 dout(
"unreserve caps %d = %d used + %d resv + %d avail\n",
246 dout(
"get_cap ctx=%p (%d) %d = %d used + %d resv + %d avail\n",
269 dout(
"put_cap %p %d = %d used + %d resv + %d avail\n",
323 else if (mds > cap->
mds)
336 cap = __get_cap_for_mds(ci, mds);
367 mds = __ceph_get_cap_mds(ceph_inode(inode));
385 if (new->mds < cap->
mds)
387 else if (new->mds > cap->
mds)
393 rb_link_node(&new->ci_node, parent, p);
410 dout(
"__cap_set_timeouts %p min %lu max %lu\n", &ci->
vfs_inode,
425 __cap_set_timeouts(mdsc, ci);
426 dout(
"__cap_delay_requeue %p flags %d at %lu\n", &ci->
vfs_inode,
496 (had & CEPH_CAP_FILE_SHARED) == 0) {
514 int fmode,
unsigned issued,
unsigned wanted,
522 int mds = session->
s_mds;
525 dout(
"add_cap %p mds%d cap %llx %s seq %d\n", inode,
537 cap = __get_cap_for_mds(ci, mds);
544 new_cap = get_cap(mdsc, caps_reservation);
556 __insert_cap_node(ci, cap);
588 pr_err(
"ceph_add_cap: couldn't find snap realm %llx\n",
594 __check_cap_issue(ci, cap, issued);
601 actual_wanted = __ceph_caps_wanted(ci);
602 if ((wanted & ~actual_wanted) ||
604 dout(
" issued %s, mds wanted %s, actual %s, queueing\n",
607 __cap_delay_requeue(mdsc, ci);
615 dout(
"add_cap inode %p (%llx.%llx) cap %p %s now %s seq %d mds%d\n",
628 __ceph_get_fmode(ci, fmode);
639 static int __cap_is_valid(
struct ceph_cap *cap)
644 spin_lock(&cap->
session->s_gen_ttl_lock);
647 spin_unlock(&cap->
session->s_gen_ttl_lock);
650 dout(
"__cap_is_valid %p cap %p issued %s "
651 "but STALE (gen %u vs %u)\n", &cap->
ci->vfs_inode,
674 if (!__cap_is_valid(cap))
676 dout(
"__ceph_caps_issued %p cap %p issued %s\n",
698 if (!__cap_is_valid(cap))
709 static void __touch_cap(
struct ceph_cap *cap)
715 dout(
"__touch_cap %p cap %p mds%d\n", &cap->
ci->vfs_inode, cap,
719 dout(
"__touch_cap %p cap %p mds%d NOP, iterating over caps\n",
720 &cap->
ci->vfs_inode, cap, s->
s_mds);
736 if ((have & mask) == mask) {
737 dout(
"__ceph_caps_issued_mask %p snap issued %s"
746 if (!__cap_is_valid(cap))
748 if ((cap->
issued & mask) == mask) {
749 dout(
"__ceph_caps_issued_mask %p cap %p issued %s"
760 if ((have & mask) == mask) {
761 dout(
"__ceph_caps_issued_mask %p combo issued %s"
774 if (!__cap_is_valid(cap))
799 if (__cap_is_valid(cap) &&
806 dout(
"ceph_caps_revoking %p %s = %d\n", inode,
851 if (!__cap_is_valid(cap))
877 ceph_sb_to_client(ci->
vfs_inode.i_sb)->mdsc;
886 dout(
"__ceph_remove_cap delaying %p removal from session %p\n",
915 if (!__ceph_is_any_real_caps(ci))
916 __cap_delay_cancel(mdsc, ci);
939 dout(
"send_cap_msg %s %llx %llx caps %s wanted %s dirty %s"
940 " seq %u/%u mseq %u follows %lld size %llu/%llu"
944 seq, issue_seq, mseq, follows, size, max_size,
945 xattr_version, xattrs_buf ? (
int)xattrs_buf->
vec.iov_len : 0);
953 fc = msg->
front.iov_base;
954 memset(fc, 0,
sizeof(*fc));
970 ceph_encode_timespec(&fc->mtime, mtime);
972 ceph_encode_timespec(&fc->atime, atime);
981 msg->
middle = ceph_buffer_get(xattrs_buf);
1003 dout(
" adding %llx release to mds%d msg %p (%d left)\n",
1007 head = msg->
front.iov_base;
1008 le32_add_cpu(&head->
num, 1);
1009 item = msg->
front.iov_base + msg->
front.iov_len;
1017 msg->
front.iov_len +=
sizeof(*item);
1019 dout(
" release msg %p full\n", msg);
1022 dout(
" release msg %p at %d/%d (%d)\n", msg,
1025 (
int)msg->
front.iov_len);
1044 __queue_cap_release(session, ceph_ino(inode), cap->
cap_id,
1069 int op,
int used,
int want,
int retain,
int flushing,
1070 unsigned *pflush_tid)
1076 int held, revoking, dropping, keep;
1085 u64 xattr_version = 0;
1094 retain &= ~revoking;
1095 dropping = cap->
issued & ~retain;
1097 dout(
"__send_cap %p cap %p session %p %s -> %s (revoking %s)\n",
1108 dout(
" delaying issued %s -> %s, wanted %s -> %s on send\n",
1142 *pflush_tid = flush_tid;
1143 dout(
" cap_flush_tid %d\n", (
int)flush_tid);
1145 if (flushing & (1 << i))
1171 xattr_version = ci->
i_xattrs.version;
1176 ret = send_cap_msg(session,
ceph_vino(inode).ino, cap_id,
1177 op, keep, want, flushing, seq, flush_tid, issue_seq, mseq,
1178 size, max_size, &mtime, &atime, time_warp_seq,
1179 uid, gid, mode, xattr_version, xattr_blob,
1182 dout(
"error sending cap msg, must requeue %p\n", inode);
1217 u64 next_follows = 0;
1222 session = *psession;
1224 dout(
"__flush_snaps %p\n", inode);
1228 if (capsnap->
follows < next_follows)
1245 dout(
"no auth cap (migrating?), doing nothing\n");
1251 dout(
"already flushed %p, skipping\n", capsnap);
1258 if (session && session->
s_mds != mds) {
1259 dout(
"oops, wrong session %p mutex\n", session);
1270 dout(
"inverting session/ino locks on %p\n",
1291 dout(
"flush_snaps %p cap_snap %p follows %lld tid %llu\n",
1293 send_cap_msg(session,
ceph_vino(inode).ino, 0,
1297 &capsnap->mtime, &capsnap->atime,
1303 next_follows = capsnap->
follows + 1;
1304 ceph_put_cap_snap(capsnap);
1317 *psession = session;
1339 ceph_sb_to_client(ci->
vfs_inode.i_sb)->mdsc;
1344 dout(
"__mark_dirty_caps %p %s dirty %s -> %s\n", &ci->
vfs_inode,
1354 BUG_ON(!list_empty(&ci->i_dirty_item));
1356 list_add(&ci->i_dirty_item, &mdsc->
cap_dirty);
1363 BUG_ON(list_empty(&ci->i_dirty_item));
1367 __cap_delay_requeue(mdsc, ci);
1377 static int __mark_caps_flushing(
struct inode *inode,
1385 BUG_ON(list_empty(&ci->i_dirty_item));
1388 dout(
"__mark_caps_flushing flushing %s, flushing_caps %s -> %s\n",
1394 dout(
" inode %p now !dirty\n", inode);
1397 list_del_init(&ci->i_dirty_item);
1403 dout(
" inode %p now flushing seq %lld\n", inode,
1407 dout(
" inode %p now flushing (more) seq %lld\n", inode,
1418 static int try_nonblocking_invalidate(
struct inode *inode)
1427 if (inode->
i_data.nrpages == 0 &&
1430 dout(
"try_nonblocking_invalidate %p success\n", inode);
1435 dout(
"try_nonblocking_invalidate %p failed\n", inode);
1457 int file_wanted,
used;
1458 int took_snap_rwsem = 0;
1463 int tried_invalidate = 0;
1464 int delayed = 0, sent = 0, force_requeue = 0,
num;
1465 int queue_invalidate = 0;
1486 want = file_wanted |
used;
1488 revoking = implemented & ~issued;
1506 dout(
"check_caps %p file_want %s used %s dirty %s flushing %s"
1507 " issued %s revoking %s retain %s %s%s%s\n", inode,
1514 (flags & CHECK_CAPS_NODELAY) ?
" NODELAY" :
"",
1522 if ((!is_delayed || mdsc->
stopping) &&
1525 (file_wanted == 0 ||
1528 !tried_invalidate) {
1529 dout(
"check_caps trying to invalidate on %p\n", inode);
1530 if (try_nonblocking_invalidate(inode) < 0) {
1533 dout(
"check_caps queuing invalidate\n");
1534 queue_invalidate = 1;
1537 dout(
"check_caps failed to invalidate pages\n");
1541 __cap_set_timeouts(mdsc, ci);
1544 tried_invalidate = 1;
1554 if (mds >= cap->
mds ||
1555 ((flags & CHECK_CAPS_AUTHONLY) && cap != ci->
i_auth_cap))
1561 dout(
" mds%d cap %p issued %s implemented %s revoking %s\n",
1571 dout(
"requesting new max_size\n");
1578 dout(
"i_size approaching max_size\n");
1583 if (cap == ci->
i_auth_cap && (flags & CHECK_CAPS_FLUSH) &&
1585 dout(
"flushing dirty caps\n");
1590 if (revoking && (revoking & used) == 0) {
1591 dout(
"completed revocation of %s\n",
1601 if ((cap->
issued & ~retain) == 0 &&
1611 dout(
" delaying issued %s -> %s, wanted %s -> %s\n",
1622 dout(
" skipping %p I_NOFLUSH set\n", inode);
1626 if (session && session != cap->
session) {
1627 dout(
"oops, wrong session %p mutex\n", session);
1634 dout(
"inverting session/ino locks on %p\n",
1637 if (took_snap_rwsem) {
1639 took_snap_rwsem = 0;
1646 if (!took_snap_rwsem) {
1648 dout(
"inverting snap/in locks on %p\n",
1652 took_snap_rwsem = 1;
1655 took_snap_rwsem = 1;
1659 flushing = __mark_caps_flushing(inode, session);
1668 retain, flushing,
NULL);
1676 if (delayed && is_delayed)
1678 if (!delayed && !is_delayed)
1679 __cap_delay_cancel(mdsc, ci);
1680 else if (!is_delayed || force_requeue)
1681 __cap_delay_requeue(mdsc, ci);
1685 if (queue_invalidate)
1690 if (took_snap_rwsem)
1697 static int try_flush_caps(
struct inode *inode,
struct ceph_mds_session *session,
1698 unsigned *flush_tid)
1702 int unlock_session = session ? 0 : 1;
1708 dout(
"try_flush_caps skipping %p I_NOFLUSH set\n", inode);
1714 int want = __ceph_caps_wanted(ci);
1727 flushing = __mark_caps_flushing(inode, session);
1737 __cap_delay_requeue(mdsc, ci);
1742 if (session && unlock_session)
1750 static int caps_are_flushed(
struct inode *inode,
unsigned tid)
1773 static void sync_write_wait(
struct inode *inode)
1781 if (list_empty(head))
1787 last_tid = req->
r_tid;
1790 ceph_osdc_get_request(req);
1792 dout(
"sync_write_wait on tid %llu (until %llu)\n",
1793 req->
r_tid, last_tid);
1796 ceph_osdc_put_request(req);
1802 if (list_empty(head))
1806 }
while (req->
r_tid < last_tid);
1813 struct inode *inode = file->
f_mapping->host;
1819 dout(
"fsync %p%s\n", inode, datasync ?
" datasync" :
"");
1820 sync_write_wait(inode);
1827 dirty = try_flush_caps(inode,
NULL, &flush_tid);
1836 dout(
"fsync waiting for flush_tid %u\n", flush_tid);
1838 caps_are_flushed(inode, flush_tid));
1841 dout(
"fsync %p%s done\n", inode, datasync ?
" datasync" :
"");
1860 dout(
"write_inode %p wait=%d\n", inode, wait);
1862 dirty = try_flush_caps(inode,
NULL, &flush_tid);
1865 caps_are_flushed(inode, flush_tid));
1868 ceph_sb_to_client(inode->
i_sb)->mdsc;
1871 if (__ceph_caps_dirty(ci))
1872 __cap_delay_requeue_front(mdsc, ci);
1889 dout(
"kick_flushing_capsnaps mds%d\n", session->
s_mds);
1898 if (cap && cap->
session == session) {
1899 dout(
"kick_flushing_caps %p cap %p capsnap %p\n", inode,
1903 pr_err(
"%p auth cap %p not mds%d ???\n", inode,
1904 cap, session->
s_mds);
1915 kick_flushing_capsnaps(mdsc, session);
1917 dout(
"kick_flushing_caps mds%d\n", session->
s_mds);
1925 if (cap && cap->
session == session) {
1926 dout(
"kick_flushing_caps %p cap %p %s\n", inode,
1930 __ceph_caps_wanted(ci),
1935 __cap_delay_requeue(mdsc, ci);
1939 pr_err(
"%p auth cap %p not mds%d ???\n", inode,
1940 cap, session->
s_mds);
1948 struct inode *inode)
1956 dout(
"kick_flushing_inode_caps %p flushing %s flush_seq %lld\n", inode,
1962 __ceph_caps_wanted(ci),
1967 __cap_delay_requeue(mdsc, ci);
1996 dout(
"__take_cap_refs %p wb %d -> %d (?)\n",
2008 static int try_get_cap_refs(
struct ceph_inode_info *ci,
int need,
int want,
2009 int *got, loff_t endoff,
int *check_max,
int *
err)
2013 int have, implemented;
2016 dout(
"get_cap_refs %p need %s want %s\n", inode,
2022 if ((file_wanted & need) == 0) {
2023 dout(
"try_get_cap_refs need %s file_wanted %s, EBADF\n",
2030 if (need & CEPH_CAP_FILE_WR) {
2031 if (endoff >= 0 && endoff > (loff_t)ci->
i_max_size) {
2032 dout(
"get_cap_refs %p endoff %llu > maxsize %llu\n",
2044 if (__ceph_have_pending_cap_snap(ci)) {
2045 dout(
"get_cap_refs %p cap_snap_pending\n", inode);
2055 have &= ~CEPH_CAP_FILE_WR;
2057 if ((have & need) == need) {
2064 int not = want & ~(have & need);
2065 int revoking = implemented & ~have;
2066 dout(
"get_cap_refs %p have %s but not %s (revoking %s)\n",
2069 if ((revoking & not) == 0) {
2070 *got = need | (have & want);
2071 __take_cap_refs(ci, *got);
2075 dout(
"get_cap_refs %p have %s needed %s\n", inode,
2080 dout(
"get_cap_refs %p ret %d got %s\n", inode,
2090 static void check_max_size(
struct inode *inode, loff_t endoff)
2098 endoff > (inode->
i_size << 1)) &&
2100 dout(
"write %p at large endoff %llu, req max_size\n",
2126 try_get_cap_refs(ci, need, want,
2143 __take_cap_refs(ci, caps);
2159 int last = 0,
put = 0, flushsnaps = 0, wake = 0;
2163 if (had & CEPH_CAP_PIN)
2165 if (had & CEPH_CAP_FILE_RD)
2168 if (had & CEPH_CAP_FILE_CACHE)
2171 if (had & CEPH_CAP_FILE_BUFFER) {
2176 dout(
"put_cap_refs %p wb %d -> %d (?)\n",
2179 if (had & CEPH_CAP_FILE_WR)
2198 last ?
" last" :
"",
put ?
" put" :
"");
2200 if (last && !flushsnaps)
2202 else if (flushsnaps)
2203 ceph_flush_snaps(ci);
2222 int complete_capsnap = 0;
2223 int drop_capsnap = 0;
2239 dout(
"put_wrbuffer_cap_refs on %p head %d/%d -> %d/%d %s\n",
2243 last ?
" LAST" :
"");
2246 if (capsnap->
context == snapc) {
2254 complete_capsnap = 1;
2255 if (capsnap->
dirty == 0)
2260 dout(
"put_wrbuffer_cap_refs on %p cap_snap %p "
2261 " snap %lld %d/%d -> %d/%d %s%s%s\n",
2262 inode, capsnap, capsnap->
context->seq,
2265 last ?
" (wrbuffer last)" :
"",
2266 complete_capsnap ?
" (complete capsnap)" :
"",
2267 drop_capsnap ?
" (drop capsnap)" :
"");
2269 ceph_put_snap_context(capsnap->
context);
2272 ceph_put_cap_snap(capsnap);
2281 }
else if (complete_capsnap) {
2282 ceph_flush_snaps(ci);
2300 static void handle_cap_grant(
struct inode *inode,
struct ceph_mds_caps *grant,
2307 int mds = session->
s_mds;
2317 int revoked_rdcache = 0;
2318 int queue_invalidate = 0;
2320 dout(
"handle_cap_grant inode %p cap %p mds%d seq %d %s\n",
2322 dout(
" size %llu max_size %llu, i_size %llu\n", size, max_size,
2330 if (((cap->
issued & ~newcaps) & CEPH_CAP_FILE_CACHE) &&
2333 if (try_nonblocking_invalidate(inode) == 0) {
2334 revoked_rdcache = 1;
2339 queue_invalidate = 1;
2348 issued |= implemented | __ceph_caps_dirty(ci);
2352 __check_cap_issue(ci, cap, newcaps);
2358 dout(
"%p mode 0%o uid.gid %d.%d\n", inode, inode->
i_mode,
2365 if ((issued & CEPH_CAP_XATTR_EXCL) == 0 && grant->xattr_len) {
2369 if (version > ci->
i_xattrs.version) {
2370 dout(
" got new xattrs v%llu on %p len %d\n",
2371 version, inode, len);
2373 ceph_buffer_put(ci->
i_xattrs.blob);
2374 ci->
i_xattrs.blob = ceph_buffer_get(xattr_buf);
2383 ceph_decode_timespec(&mtime, &grant->mtime);
2384 ceph_decode_timespec(&atime, &grant->atime);
2385 ceph_decode_timespec(&
ctime, &grant->ctime);
2402 wanted = __ceph_caps_wanted(ci);
2404 dirty = __ceph_caps_dirty(ci);
2405 dout(
" my wanted = %s, used = %s, dirty %s\n",
2410 dout(
"mds wanted %s -> %s\n",
2422 if (cap->
issued & ~newcaps) {
2423 int revoking = cap->
issued & ~newcaps;
2425 dout(
"revocation: %s -> %s (revoking %s)\n",
2429 if (revoking & used & CEPH_CAP_FILE_BUFFER)
2431 else if (revoking == CEPH_CAP_FILE_CACHE &&
2432 (newcaps & CEPH_CAP_FILE_LAZYIO) == 0 &&
2441 }
else if (cap->
issued == newcaps) {
2442 dout(
"caps unchanged: %s -> %s\n",
2463 if (queue_invalidate)
2468 if (check_caps == 1)
2471 else if (check_caps == 2)
2481 static void handle_cap_flush_ack(
struct inode *inode,
u64 flush_tid,
2496 if ((dirty & (1 << i)) &&
2500 dout(
"handle_cap_flush_ack inode %p mds%d seq %d on %s cleaned %s,"
2501 " flushing %s -> %s\n",
2515 dout(
" mds%d still flushing cap on %p\n",
2519 i_flushing_item)->vfs_inode);
2522 dout(
" inode %p now !flushing\n", inode);
2525 dout(
" inode %p now clean\n", inode);
2526 BUG_ON(!list_empty(&ci->i_dirty_item));
2534 BUG_ON(list_empty(&ci->i_dirty_item));
2552 static void handle_cap_flushsnap_ack(
struct inode *inode,
u64 flush_tid,
2561 dout(
"handle_cap_flushsnap_ack inode %p ci %p mds%d follows %lld\n",
2562 inode, ci, session->
s_mds, follows);
2566 if (capsnap->
follows == follows) {
2568 dout(
" cap_snap %p follows %lld tid %lld !="
2569 " %lld\n", capsnap, follows,
2574 dout(
" removing %p cap_snap %p follows %lld\n",
2575 inode, capsnap, follows);
2576 ceph_put_snap_context(capsnap->
context);
2579 ceph_put_cap_snap(capsnap);
2583 dout(
" skipping cap_snap %p follows %lld\n",
2597 static void handle_cap_trunc(
struct inode *inode,
2603 int mds = session->
s_mds;
2608 int implemented = 0;
2609 int dirty = __ceph_caps_dirty(ci);
2611 int queue_trunc = 0;
2613 issued |= implemented |
dirty;
2615 dout(
"handle_cap_trunc inode %p mds%d seq %d to %lld seq %d\n",
2616 inode, mds, seq, truncate_size, truncate_seq);
2618 truncate_seq, truncate_size, size);
2633 static void handle_cap_export(
struct inode *inode,
struct ceph_mds_caps *ex,
2635 int *open_target_sessions)
2639 int mds = session->
s_mds;
2645 dout(
"handle_cap_export inode %p ci %p mds%d mseq %d\n",
2646 inode, ci, mds, mseq);
2653 if (ceph_seq_cmp(t->mseq, mseq) > 0) {
2654 dout(
" higher mseq on cap from mds%d\n",
2658 if (t->session->s_mds == mds)
2673 *open_target_sessions = 1;
2680 if (!list_empty(&ci->i_dirty_item)) {
2681 dout(
" moving %p to cap_dirty_migrating\n",
2683 list_move(&ci->i_dirty_item,
2704 void *snaptrace,
int snaptrace_len)
2707 int mds = session->
s_mds;
2717 dout(
"handle_cap_import inode %p ci %p mds%d mseq %d"
2718 " - cleared exporting from mds%d\n",
2719 inode, ci, mds, mseq,
2726 if (!list_empty(&ci->i_dirty_item)) {
2727 dout(
" moving %p back to cap_dirty\n", inode);
2728 list_move(&ci->i_dirty_item, &mdsc->
cap_dirty);
2732 dout(
"handle_cap_import inode %p ci %p mds%d mseq %d\n",
2733 inode, ci, mds, mseq);
2743 kick_flushing_inode_caps(mdsc, session, inode);
2763 struct inode *
inode;
2767 int mds = session->
s_mds;
2775 size_t snaptrace_len;
2778 int open_target_sessions = 0;
2780 dout(
"handle_caps from mds%d\n", mds);
2784 if (msg->
front.iov_len <
sizeof(*h))
2786 h = msg->
front.iov_base;
2802 p = snaptrace + snaptrace_len;
2803 end = msg->
front.iov_base + msg->
front.iov_len;
2813 dout(
" mds%d seq %lld cap seq %u\n", session->
s_mds, session->
s_seq,
2817 inode = ceph_find_inode(sb, vino);
2818 ci = ceph_inode(inode);
2822 dout(
" i don't have ino %llx\n", vino.
ino);
2825 __queue_cap_release(session, vino.
ino, cap_id,
2827 goto flush_cap_releases;
2833 handle_cap_flushsnap_ack(inode, tid, h, session);
2837 handle_cap_export(inode, h, session, &open_target_sessions);
2841 handle_cap_import(mdsc, inode, h, session,
2842 snaptrace, snaptrace_len);
2849 cap = __get_cap_for_mds(ceph_inode(inode), mds);
2851 dout(
" no cap on %p ino %llx.%llx from mds%d\n",
2852 inode, ceph_ino(inode), ceph_snap(inode), mds);
2854 goto flush_cap_releases;
2861 handle_cap_grant(inode, h, session, cap, msg->
middle);
2865 handle_cap_flush_ack(inode, tid, h, session, cap);
2869 handle_cap_trunc(inode, h, session);
2874 pr_err(
"ceph_handle_caps: unknown cap op %d %s\n", op,
2894 if (open_target_sessions)
2899 pr_err(
"ceph_handle_caps: corrupt message\n");
2912 dout(
"check_delayed_caps\n");
2937 struct inode *
inode;
2939 dout(
"flush_dirty_caps\n");
2946 dout(
"flush_dirty_caps %p\n", inode);
2953 dout(
"flush_dirty_caps done\n");
2967 dout(
"put_fmode %p fmode %d %d -> %d\n", inode, fmode,
2987 int mds,
int drop,
int unless,
int force)
2997 dirty = __ceph_caps_dirty(ci);
2999 dout(
"encode_inode_release %p mds%d used|dirty %s drop %s unless %s\n",
3004 drop &= ~(used |
dirty);
3006 cap = __get_cap_for_mds(ci, mds);
3007 if (cap && __cap_is_valid(cap)) {
3010 (cap->
issued & unless) == 0)) {
3011 if ((cap->
issued & drop) &&
3012 (cap->
issued & unless) == 0) {
3013 dout(
"encode_inode_release %p cap %p %s -> "
3020 int wanted = __ceph_caps_wanted(ci);
3021 dout(
" wanted %s -> %s (act %s)\n",
3029 dout(
"encode_inode_release %p cap %p %s"
3030 " (force)\n", inode, cap,
3046 dout(
"encode_inode_release %p cap %p %s\n",
3055 int mds,
int drop,
int unless)
3069 spin_lock(&dentry->
d_lock);
3072 spin_unlock(&dentry->
d_lock);
3076 spin_lock(&dentry->
d_lock);
3078 dout(
"encode_dentry_release %p mds%d seq %d\n",
3082 *p += dentry->
d_name.len;
3086 spin_unlock(&dentry->
d_lock);