Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ceph: add refcounting for Fx caps

In future patches we'll be taking and relying on Fx caps. Add proper
refcounting for them.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Jeff Layton and committed by
Ilya Dryomov
f85122af 3db0a2fc

+9 -1
+7
fs/ceph/caps.c
··· 965 965 used |= CEPH_CAP_FILE_WR; 966 966 if (ci->i_wb_ref || ci->i_wrbuffer_ref) 967 967 used |= CEPH_CAP_FILE_BUFFER; 968 + if (ci->i_fx_ref) 969 + used |= CEPH_CAP_FILE_EXCL; 968 970 return used; 969 971 } 970 972 ··· 2502 2500 ci->i_rd_ref++; 2503 2501 if (got & CEPH_CAP_FILE_CACHE) 2504 2502 ci->i_rdcache_ref++; 2503 + if (got & CEPH_CAP_FILE_EXCL) 2504 + ci->i_fx_ref++; 2505 2505 if (got & CEPH_CAP_FILE_WR) { 2506 2506 if (ci->i_wr_ref == 0 && !ci->i_head_snapc) { 2507 2507 BUG_ON(!snap_rwsem_locked); ··· 2914 2910 last++; 2915 2911 if (had & CEPH_CAP_FILE_CACHE) 2916 2912 if (--ci->i_rdcache_ref == 0) 2913 + last++; 2914 + if (had & CEPH_CAP_FILE_EXCL) 2915 + if (--ci->i_fx_ref == 0) 2917 2916 last++; 2918 2917 if (had & CEPH_CAP_FILE_BUFFER) { 2919 2918 if (--ci->i_wb_ref == 0) {
+1
fs/ceph/inode.c
··· 496 496 ci->i_rdcache_ref = 0; 497 497 ci->i_wr_ref = 0; 498 498 ci->i_wb_ref = 0; 499 + ci->i_fx_ref = 0; 499 500 ci->i_wrbuffer_ref = 0; 500 501 ci->i_wrbuffer_ref_head = 0; 501 502 atomic_set(&ci->i_filelock_ref, 0);
+1 -1
fs/ceph/super.h
··· 375 375 376 376 /* held references to caps */ 377 377 int i_pin_ref; 378 - int i_rd_ref, i_rdcache_ref, i_wr_ref, i_wb_ref; 378 + int i_rd_ref, i_rdcache_ref, i_wr_ref, i_wb_ref, i_fx_ref; 379 379 int i_wrbuffer_ref, i_wrbuffer_ref_head; 380 380 atomic_t i_filelock_ref; 381 381 atomic_t i_shared_gen; /* increment each time we get FILE_SHARED */