|
@@ -2673,17 +2673,18 @@ static void check_max_size(struct inode *inode, loff_t endoff)
|
|
|
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
|
|
|
}
|
|
|
|
|
|
-int ceph_try_get_caps(struct ceph_inode_info *ci, int need, int want, int *got)
|
|
|
+int ceph_try_get_caps(struct ceph_inode_info *ci, int need, int want,
|
|
|
+ bool nonblock, int *got)
|
|
|
{
|
|
|
int ret, err = 0;
|
|
|
|
|
|
BUG_ON(need & ~CEPH_CAP_FILE_RD);
|
|
|
- BUG_ON(want & ~(CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO));
|
|
|
+ BUG_ON(want & ~(CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO|CEPH_CAP_FILE_SHARED));
|
|
|
ret = ceph_pool_perm_check(ci, need);
|
|
|
if (ret < 0)
|
|
|
return ret;
|
|
|
|
|
|
- ret = try_get_cap_refs(ci, need, want, 0, true, got, &err);
|
|
|
+ ret = try_get_cap_refs(ci, need, want, 0, nonblock, got, &err);
|
|
|
if (ret) {
|
|
|
if (err == -EAGAIN) {
|
|
|
ret = 0;
|