All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Marshall <tom@cyngn.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>, linux-fsdevel@vger.kernel.org
Subject: Re: fs compression
Date: Fri, 29 May 2015 10:05:33 -0700	[thread overview]
Message-ID: <20150529170533.GA1555@eden.sea.cyngn.com> (raw)
In-Reply-To: <20150529001831.GA29447@eden.sea.cyngn.com>

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

  reply	other threads:[~2015-05-29 17:05 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-09  4:20 [PATCH 01/18] f2fs: avoid value overflow in showing current status Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 02/18] f2fs: report unwritten area in f2fs_fiemap Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 03/18] f2fs crypto: declare some definitions for f2fs encryption feature Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-13  2:02   ` Dave Chinner
2015-05-13  2:23     ` nick
2015-05-13  6:48     ` Jaegeuk Kim
2015-05-14  0:37       ` Dave Chinner
2015-05-14  1:56         ` Jaegeuk Kim
2015-05-14  1:56           ` Jaegeuk Kim
2015-05-14 16:50           ` Tom Marshall
2015-05-16  1:14             ` Jaegeuk Kim
2015-05-16  4:47               ` Tom Marshall
2015-05-18  6:24                 ` Jaegeuk Kim
2015-05-16 13:24         ` Theodore Ts'o
2015-05-16 13:24           ` Theodore Ts'o
2015-05-16 17:13           ` Tom Marshall
2015-05-20 17:46             ` fs compression Tom Marshall
2015-05-20 19:50               ` Tom Marshall
2015-05-20 21:36               ` Theodore Ts'o
2015-05-20 22:46                 ` Tom Marshall
2015-05-21  4:28                   ` Tom Marshall
2015-05-27 18:53                     ` Tom Marshall
2015-05-27 23:38                       ` Theodore Ts'o
2015-05-28  0:20                         ` Tom Marshall
2015-05-28 20:55                         ` Tom Marshall
2015-05-29  0:18                           ` Tom Marshall
2015-05-29 17:05                             ` Tom Marshall [this message]
2015-05-29 21:52                               ` Tom Marshall
2015-05-09  4:20 ` [PATCH 04/18] f2fs crypto: add f2fs encryption Kconfig Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 05/18] f2fs crypto: add encryption xattr support Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 06/18] f2fs crypto: add encryption policy and password salt support Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 07/18] f2fs crypto: add f2fs encryption facilities Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 08/18] f2fs crypto: add encryption key management facilities Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 09/18] f2fs crypto: filename encryption facilities Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 10/18] f2fs crypto: activate encryption support for fs APIs Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 11/18] f2fs crypto: add encryption support in read/write paths Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 12/18] f2fs crypto: add filename encryption for f2fs_add_link Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 13/18] f2fs crypto: add filename encryption for f2fs_readdir Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 14/18] f2fs crypto: add filename encryption for f2fs_lookup Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-11  2:52   ` [f2fs-dev] " hujianyang
2015-05-11  2:52     ` hujianyang
2015-05-11  5:12     ` [f2fs-dev] " Jaegeuk Kim
2015-05-11  5:12       ` Jaegeuk Kim
2015-05-11  6:38       ` hujianyang
2015-05-11  6:38         ` hujianyang
2015-05-09  4:20 ` [PATCH 15/18] f2fs crypto: add filename encryption for roll-forward recovery Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 16/18] f2fs crypto: add symlink encryption Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim
2015-05-09  4:25   ` Al Viro
2015-05-11  5:15     ` Jaegeuk Kim
2015-05-12  3:48   ` [PATCH 16/18 v2] " Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 17/18] f2fs crypto: fix missing key when reading a page Jaegeuk Kim
2015-05-09  4:20 ` [PATCH 18/18] f2fs crypto: remove checking key context during lookup Jaegeuk Kim
2015-05-09  4:20   ` Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150529170533.GA1555@eden.sea.cyngn.com \
    --to=tom@cyngn.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.