From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Marshall Subject: [PATCH 1/3] fs: Add inode.i_compressed_size and support for FS_IMPL Date: Fri, 29 May 2015 11:57:28 -0700 Message-ID: <5568dfb1.6ac9440a.6c95.411c@mx.google.com> To: unlisted-recipients:; (no To-header on input) Return-path: Received: from mail-pd0-f177.google.com ([209.85.192.177]:33335 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757028AbbE2Vwv (ORCPT ); Fri, 29 May 2015 17:52:51 -0400 Received: by pdbqa5 with SMTP id qa5so62569691pdb.0 for ; Fri, 29 May 2015 14:52:50 -0700 (PDT) Received: from localhost (70-90-190-81-WA.hfc.comcastbusiness.net. [70.90.190.81]) by mx.google.com with ESMTPSA id jz10sm6561850pbc.48.2015.05.29.14.52.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 14:52:49 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Signed-off-by: Tom Marshall --- 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