* [PATCH 1/3] fs: Add inode.i_compressed_size and support for FS_IMPL
@ 2015-05-29 18:57 Tom Marshall
0 siblings, 0 replies; only message in thread
From: Tom Marshall @ 2015-05-29 18:57 UTC (permalink / 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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-05-29 21:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29 18:57 [PATCH 1/3] fs: Add inode.i_compressed_size and support for FS_IMPL Tom Marshall
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).