diff mbox

fs compression

Message ID 20150529170533.GA1555@eden.sea.cyngn.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tom Marshall May 29, 2015, 5:05 p.m. UTC
On Thu, May 28, 2015 at 05:18:31PM -0700, Tom Marshall wrote:
> So I've just gotten this all working.  The last notable change I made was to
> inode size: I added an i_compressed_size member and then did some macro
> hackage to ensure that the fs implementation (eg. fs/ext4) sees the
> compressed size while everything else sees the uncompressed size.
> 
> I'll be testing further tomorrow.

I seem to have a race condition that leads to deadlock.  Though I was able
to boot to home screen on a device after a couple tries.  Investigating.

Here's my diff to include/linux/fs.h for the inode stuff based on 3.10.  It
requires/assumes that filesystems implementing transparent compression will
define FS_IMPL in their Makefile.  It's not final, just the first thing that
worked.  Any suggestions on how the final version should look .. or
alternate ideas for how to do this?

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Tom Marshall May 29, 2015, 9:52 p.m. UTC | #1
I think transparent compression is fully functional now.  I'm sending a
short patch series for comments.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7a3b879..9e943ae 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -554,6 +554,9 @@  struct inode {
        };
        dev_t                   i_rdev;
        loff_t                  i_size;
+#ifdef CONFIG_FS_TRANSPARENT_COMPRESSION
+       loff_t                  i_compressed_size;
+#endif
        struct timespec         i_atime;
        struct timespec         i_mtime;
        struct timespec         i_ctime;
@@ -635,6 +638,12 @@  enum inode_i_mutex_lock_class
        I_MUTEX_QUOTA
 };
 
+#if defined(CONFIG_FS_TRANSPARENT_COMPRESSION) && defined(FS_IMPL)
+#define I_SIZE_MEMBER i_compressed_size
+#else
+#define I_SIZE_MEMBER i_size
+#endif
+
 /*
  * NOTE: in a 32bit arch with a preemptable kernel and
  * an UP compile the i_size_read/write must be atomic
@@ -653,14 +662,14 @@  static inline loff_t i_size_read(const struct inode *inode)
 
        do {
                seq = read_seqcount_begin(&inode->i_size_seqcount);
-               i_size = inode->i_size;
+               i_size = inode->I_SIZE_MEMBER;
        } while (read_seqcount_retry(&inode->i_size_seqcount, seq));
        return i_size;
 #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
        loff_t i_size;
 
        preempt_disable();
-       i_size = inode->i_size;
+       i_size = inode->I_SIZE_MEMBER;
        preempt_enable();
        return i_size;
 #else