]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: enable direct_IO
authorSage Weil <sage@newdream.net>
Fri, 13 Mar 2009 17:38:32 +0000 (10:38 -0700)
committerSage Weil <sage@newdream.net>
Fri, 13 Mar 2009 20:43:40 +0000 (13:43 -0700)
src/kernel/addr.c

index 94b5578f42fd2a49931a9977e2356a6fd610ff7d..9d667d76d51f6d7a315c09a953fc316acf9d5651 100644 (file)
@@ -1006,6 +1006,18 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
        return copied;
 }
 
+/*
+ * we set .direct_IO to indicate direct io is supported, but since we
+ * intercept O_DIRECT reads and writes early, this function should
+ * never get called.
+ */
+static ssize_t ceph_direct_io(int rw, struct kiocb *iocb,
+                             const struct iovec *iov,
+                             loff_t pos, unsigned long nr_segs)
+{
+       WARN_ON(1);
+       return -EINVAL;
+}
 
 const struct address_space_operations ceph_aops = {
        .readpage = ceph_readpage,
@@ -1017,6 +1029,7 @@ const struct address_space_operations ceph_aops = {
        .set_page_dirty = ceph_set_page_dirty,
        .invalidatepage = ceph_invalidatepage,
        .releasepage = ceph_releasepage,
+       .direct_IO = ceph_direct_io,
 };