exofs: Allow corrupted directory entry to be empty file
[firefly-linux-kernel-4.4.55.git] / fs / exofs / inode.c
index a52a5d23c30bcfac672df7197c51b966cc087787..390224a162d056969a091c2a11f37b2772862567 100644 (file)
@@ -961,6 +961,14 @@ static void exofs_invalidatepage(struct page *page, unsigned int offset,
        WARN_ON(1);
 }
 
+
+ /* TODO: Should be easy enough to do proprly */
+static ssize_t exofs_direct_IO(int rw, struct kiocb *iocb,
+               const struct iovec *iov, loff_t offset, unsigned long nr_segs)
+{
+       return 0;
+}
+
 const struct address_space_operations exofs_aops = {
        .readpage       = exofs_readpage,
        .readpages      = exofs_readpages,
@@ -974,7 +982,7 @@ const struct address_space_operations exofs_aops = {
 
        /* Not implemented Yet */
        .bmap           = NULL, /* TODO: use osd's OSD_ACT_READ_MAP */
-       .direct_IO      = NULL, /* TODO: Should be trivial to do */
+       .direct_IO      = exofs_direct_IO,
 
        /* With these NULL has special meaning or default is not exported */
        .get_xip_mem    = NULL,
@@ -1094,8 +1102,7 @@ static int exofs_get_inode(struct super_block *sb, struct exofs_i_info *oi,
                /* If object is lost on target we might as well enable it's
                 * delete.
                 */
-               if ((ret == -ENOENT) || (ret == -EINVAL))
-                       ret = 0;
+               ret = 0;
                goto out;
        }