iput(inode);
}
}
+
+int ceph_wait_for_caps(struct ceph_inode_info *ci, int need, int want, int *got,
+ loff_t endoff)
+{
+ return wait_event_interruptible(ci->i_cap_wq,
+ ceph_get_cap_refs(ci, need, want, got, endoff));
+}
dout(10, "aio_read %llx.%llx %llu~%u trying to get caps on %p\n",
ceph_vinop(inode), pos, (unsigned)len, inode);
- ret = wait_event_interruptible(ci->i_cap_wq,
- ceph_get_cap_refs(ci,
- CEPH_CAP_FILE_RD,
- CEPH_CAP_FILE_RDCACHE,
- &got, -1));
+ ret = ceph_wait_for_caps(ci,
+ CEPH_CAP_FILE_RD,
+ CEPH_CAP_FILE_RDCACHE,
+ &got, -1);
if (ret < 0)
goto out;
dout(10, "aio_read %llx.%llx %llu~%u got cap refs %d\n",
check_max_size(inode, endoff);
dout(10, "aio_write %p %llu~%u getting caps. i_size %llu\n",
inode, pos, (unsigned)iov->iov_len, inode->i_size);
- ret = wait_event_interruptible(ci->i_cap_wq,
- ceph_get_cap_refs(ci,
- CEPH_CAP_FILE_WR,
- CEPH_CAP_FILE_WRBUFFER,
- &got, endoff));
+ ret = ceph_wait_for_caps(ci,
+ CEPH_CAP_FILE_WR,
+ CEPH_CAP_FILE_WRBUFFER,
+ &got, endoff);
if (ret < 0)
goto out;
ceph_check_caps(ceph_inode(inode), 1, mask, NULL);
}
+extern int ceph_wait_for_caps(struct ceph_inode_info *ci, int need, int want, int *got,
+ loff_t endoff);
+
/* addr.c */
extern const struct address_space_operations ceph_aops;
extern int ceph_mmap(struct file *file, struct vm_area_struct *vma);