From: Tom Marshall <tom@cyngn.com>
To: unlisted-recipients:; (no To-header on input)
Subject: [PATCH 1/3] fs: Add inode.i_compressed_size and support for FS_IMPL
Date: Fri, 29 May 2015 11:57:28 -0700 [thread overview]
Message-ID: <5568dfb1.6ac9440a.6c95.411c@mx.google.com> (raw)
Signed-off-by: Tom Marshall <tdm@cyngn.com>
---
include/linux/fs.h | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 35ec87e..5e4444e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -614,6 +614,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;
@@ -702,6 +705,12 @@ enum inode_i_mutex_lock_class
void lock_two_nondirectories(struct inode *, struct inode*);
void unlock_two_nondirectories(struct inode *, struct inode*);
+#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
@@ -720,18 +729,18 @@ 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
- return inode->i_size;
+ return inode->I_SIZE_MEMBER;
#endif
}
--
2.1.4
reply other threads:[~2015-05-29 21:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=5568dfb1.6ac9440a.6c95.411c@mx.google.com \
--to=tom@cyngn.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).