mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 15:58:47 +00:00
ceph: no need to wait for transition RDCACHE|RD -> RD
For write when trying to get the Fwb caps we need to keep waiting on transition from WRBUFFER|WR -> WR to avoid a new WR sync write from going before a prior buffered writeback happens. While for read there is no need to wait on transition from RDCACHE|RD -> RD, and we can just exclude the revoking caps and force to sync read. Signed-off-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
6eb06c4621
commit
7c3ea9870e
@ -2760,13 +2760,17 @@ again:
|
|||||||
* on transition from wanted -> needed caps. This is needed
|
* on transition from wanted -> needed caps. This is needed
|
||||||
* for WRBUFFER|WR -> WR to avoid a new WR sync write from
|
* for WRBUFFER|WR -> WR to avoid a new WR sync write from
|
||||||
* going before a prior buffered writeback happens.
|
* going before a prior buffered writeback happens.
|
||||||
|
*
|
||||||
|
* For RDCACHE|RD -> RD, there is not need to wait and we can
|
||||||
|
* just exclude the revoking caps and force to sync read.
|
||||||
*/
|
*/
|
||||||
int not = want & ~(have & need);
|
int not = want & ~(have & need);
|
||||||
int revoking = implemented & ~have;
|
int revoking = implemented & ~have;
|
||||||
|
int exclude = revoking & not;
|
||||||
dout("get_cap_refs %p have %s but not %s (revoking %s)\n",
|
dout("get_cap_refs %p have %s but not %s (revoking %s)\n",
|
||||||
inode, ceph_cap_string(have), ceph_cap_string(not),
|
inode, ceph_cap_string(have), ceph_cap_string(not),
|
||||||
ceph_cap_string(revoking));
|
ceph_cap_string(revoking));
|
||||||
if ((revoking & not) == 0) {
|
if (!exclude || !(exclude & CEPH_CAP_FILE_BUFFER)) {
|
||||||
if (!snap_rwsem_locked &&
|
if (!snap_rwsem_locked &&
|
||||||
!ci->i_head_snapc &&
|
!ci->i_head_snapc &&
|
||||||
(need & CEPH_CAP_FILE_WR)) {
|
(need & CEPH_CAP_FILE_WR)) {
|
||||||
@ -2788,7 +2792,7 @@ again:
|
|||||||
snap_rwsem_locked = true;
|
snap_rwsem_locked = true;
|
||||||
}
|
}
|
||||||
if ((have & want) == want)
|
if ((have & want) == want)
|
||||||
*got = need | want;
|
*got = need | (want & ~exclude);
|
||||||
else
|
else
|
||||||
*got = need;
|
*got = need;
|
||||||
ceph_take_cap_refs(ci, *got, true);
|
ceph_take_cap_refs(ci, *got, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user