Lines Matching refs:snapc
86 struct ceph_snap_context *snapc; in ceph_dirty_folio() local
104 snapc = ceph_get_snap_context(capsnap->context); in ceph_dirty_folio()
108 snapc = ceph_get_snap_context(ci->i_head_snapc); in ceph_dirty_folio()
119 snapc, snapc->seq, snapc->num_snaps); in ceph_dirty_folio()
127 folio_attach_private(folio, snapc); in ceph_dirty_folio()
143 struct ceph_snap_context *snapc; in ceph_invalidate_folio() local
157 snapc = folio_detach_private(folio); in ceph_invalidate_folio()
158 ceph_put_wrbuffer_cap_refs(ci, 1, snapc); in ceph_invalidate_folio()
159 ceph_put_snap_context(snapc); in ceph_invalidate_folio()
574 struct ceph_snap_context *snapc = NULL; in get_oldest_context() local
585 if (snapc && capsnap->context != page_snapc) in get_oldest_context()
601 if (snapc) in get_oldest_context()
604 snapc = ceph_get_snap_context(capsnap->context); in get_oldest_context()
606 page_snapc == snapc || in get_oldest_context()
607 page_snapc->seq > snapc->seq) in get_oldest_context()
610 if (!snapc && ci->i_wrbuffer_ref_head) { in get_oldest_context()
611 snapc = ceph_get_snap_context(ci->i_head_snapc); in get_oldest_context()
612 doutc(cl, " head snapc %p has %d dirty pages\n", snapc, in get_oldest_context()
623 return snapc; in get_oldest_context()
630 struct ceph_snap_context *snapc; in get_writepages_data_length() local
635 snapc = page_snap_context(ceph_fscrypt_pagecache_page(page)); in get_writepages_data_length()
636 if (snapc != ci->i_head_snapc) { in get_writepages_data_length()
640 if (capsnap->context == snapc) { in get_writepages_data_length()
671 struct ceph_snap_context *snapc, *oldest; in writepage_nounlock() local
689 snapc = page_snap_context(page); in writepage_nounlock()
690 if (!snapc) { in writepage_nounlock()
695 oldest = get_oldest_context(inode, &ceph_wbc, snapc); in writepage_nounlock()
696 if (snapc->seq > oldest->seq) { in writepage_nounlock()
698 ceph_vinop(inode), page, snapc); in writepage_nounlock()
720 ceph_vinop(inode), page, page->index, page_off, wlen, snapc, in writepage_nounlock()
721 snapc->seq); in writepage_nounlock()
729 CEPH_OSD_FLAG_WRITE, snapc, in writepage_nounlock()
801 WARN_ON_ONCE(oldest != snapc); in writepage_nounlock()
803 ceph_put_wrbuffer_cap_refs(ci, 1, snapc); in writepage_nounlock()
804 ceph_put_snap_context(snapc); /* page's reference */ in writepage_nounlock()
855 struct ceph_snap_context *snapc = req->r_snapc; in writepages_finish() local
931 ceph_put_wrbuffer_cap_refs(ci, total_pages, snapc); in writepages_finish()
954 struct ceph_snap_context *snapc = NULL, *last_snapc = NULL, *pgsnapc; in ceph_writepages_start() local
997 snapc = get_oldest_context(inode, &ceph_wbc, NULL); in ceph_writepages_start()
998 if (!snapc) { in ceph_writepages_start()
1004 doutc(cl, " oldest snapc is %p seq %lld (%d snaps)\n", snapc, in ceph_writepages_start()
1005 snapc->seq, snapc->num_snaps); in ceph_writepages_start()
1008 if (ceph_wbc.head_snapc && snapc != last_snapc) { in ceph_writepages_start()
1037 last_snapc = snapc; in ceph_writepages_start()
1073 if (pgsnapc != snapc) { in ceph_writepages_start()
1075 pgsnapc, pgsnapc->seq, snapc, snapc->seq); in ceph_writepages_start()
1234 snapc, ceph_wbc.truncate_seq, in ceph_writepages_start()
1244 snapc, ceph_wbc.truncate_seq, in ceph_writepages_start()
1398 if (page_snap_context(page) != snapc) in ceph_writepages_start()
1429 struct ceph_snap_context *snapc) in context_is_writeable_or_written() argument
1432 int ret = !oldest || snapc->seq <= oldest->seq; in context_is_writeable_or_written()
1463 struct ceph_snap_context *snapc, *oldest; in ceph_find_incompatible() local
1467 snapc = page_snap_context(page); in ceph_find_incompatible()
1468 if (!snapc || snapc == ci->i_head_snapc) in ceph_find_incompatible()
1476 if (snapc->seq > oldest->seq) { in ceph_find_incompatible()
1480 ceph_vinop(inode), page, snapc); in ceph_find_incompatible()
1481 return ceph_get_snap_context(snapc); in ceph_find_incompatible()
1487 ceph_vinop(inode), page, snapc); in ceph_find_incompatible()
1502 struct ceph_snap_context *snapc; in ceph_netfs_check_write_begin() local
1504 snapc = ceph_find_incompatible(folio_page(*foliop, 0)); in ceph_netfs_check_write_begin()
1505 if (snapc) { in ceph_netfs_check_write_begin()
1511 if (IS_ERR(snapc)) in ceph_netfs_check_write_begin()
1512 return PTR_ERR(snapc); in ceph_netfs_check_write_begin()
1516 context_is_writeable_or_written(inode, snapc)); in ceph_netfs_check_write_begin()
1517 ceph_put_snap_context(snapc); in ceph_netfs_check_write_begin()
1754 struct ceph_snap_context *snapc; in ceph_page_mkwrite() local
1764 snapc = ceph_find_incompatible(page); in ceph_page_mkwrite()
1765 if (!snapc) { in ceph_page_mkwrite()
1774 if (IS_ERR(snapc)) { in ceph_page_mkwrite()
1781 context_is_writeable_or_written(inode, snapc)); in ceph_page_mkwrite()
1782 ceph_put_snap_context(snapc); in ceph_page_mkwrite()