Re: fs compression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

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
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux