Lines Matching defs:need
203 struct ceph_cap_reservation *ctx, int need)
215 dout("reserve caps ctx=%p need=%d\n", ctx, need);
219 if (mdsc->caps_avail_count >= need)
220 have = need;
230 for (i = have; i < need; ) {
247 max_caps = s->s_nr_caps - (need - i);
259 if (mdsc->caps_avail_count >= need - i)
260 more_have = need - i;
275 pr_warn("reserve caps ctx=%p ENOMEM need=%d got=%d\n",
276 ctx, need, have + alloc);
282 BUG_ON(have + alloc != need);
283 ctx->count = need;
1361 * the arg struct with the parameters that will need to be sent. This should
1392 * the weird transition from buffered to sync IO... we need to flush
1604 * we need to wait for sync writes to complete and for dirty
2059 * If we no longer need to hold onto old our caps, and we may
2093 * If we have an auth cap, we don't need to consider any
2452 * can recover size and mtime, so we don't need to
2729 * minimal set we @need. Also include the larger offset we are writing
2736 * -EAGAIN: need to sleep but non-blocking is specified
2746 static int try_get_cap_refs(struct inode *inode, int need, int want,
2755 dout("get_cap_refs %p need %s want %s\n", inode,
2756 ceph_cap_string(need), ceph_cap_string(want));
2781 if (have & need & CEPH_CAP_FILE_WR) {
2799 if ((have & need) == need) {
2806 * For RDCACHE|RD -> RD, there is not need to wait and we can
2809 int not = want & ~(have & need);
2818 (need & CEPH_CAP_FILE_WR)) {
2837 *got = need | (want & ~exclude);
2839 *got = need;
2847 (need & (CEPH_CAP_FILE_WR | CEPH_CAP_FILE_EXCL))) {
2854 dout("get_cap_refs %p need %s but mds%d readonly\n",
2855 inode, ceph_cap_string(need), ci->i_auth_cap->mds);
2866 if (need & ~mds_wanted) {
2867 dout("get_cap_refs %p need %s > mds_wanted %s\n",
2868 inode, ceph_cap_string(need),
2874 dout("get_cap_refs %p have %s need %s\n", inode,
2875 ceph_cap_string(have), ceph_cap_string(need));
2905 /* do we need to explicitly request a larger max_size? */
2933 int ceph_try_get_caps(struct inode *inode, int need, int want,
2938 BUG_ON(need & ~CEPH_CAP_FILE_RD);
2942 if (need) {
2943 ret = ceph_pool_perm_check(inode, need);
2948 flags = get_used_fmode(need | want);
2952 ret = try_get_cap_refs(inode, need, want, 0, flags, got);
2964 int __ceph_get_caps(struct inode *inode, struct ceph_file_info *fi, int need,
2971 ret = ceph_pool_perm_check(inode, need);
2979 flags = get_used_fmode(need | want);
2986 ret = try_get_cap_refs(inode, need, want, endoff,
2996 cw.need = need;
3008 while (!(ret = try_get_cap_refs(inode, need, want,
3091 int ceph_get_caps(struct file *filp, int need, int want, loff_t endoff,
3097 return __ceph_get_caps(inode, fi, need, want, endoff, got);
3114 * we don't need to send FLUSHSNAP message for it.
4625 * we may need to release capabilities to the MDS (or schedule