struct dentry{}->d_time is used when CONFIG_NFS_FS or
CONFIG_VBOXSF_FS is on.
Limit the d_time only when either of configs CONFIG_NFS_FS or
CONFIG_VBOXSF_FS is enabled
With this change size of "struct dentry" is reduced by 8-bytes
on 64-bit system, while of 32-bit system size remains unchanged
dentry object is vastly used, so this change should be useful
for memory saving

Signed-off-by: Anupam Aggarwal <[email protected]>
Signed-off-by: Vivek Trivedi <[email protected]>
Signed-off-by: Amit Sahrawat <[email protected]>
---
 include/linux/dcache.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index a94c551..d90da5e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -101,7 +101,9 @@ struct dentry {
        struct lockref d_lockref;       /* per-dentry lock and refcount */
        const struct dentry_operations *d_op;
        struct super_block *d_sb;       /* The root of the dentry tree */
+#if IS_ENABLED(CONFIG_NFS_FS) || IS_ENABLED(CONFIG_VBOXSF_FS)
        unsigned long d_time;           /* used by d_revalidate */
+#endif
        void *d_fsdata;                 /* fs-specific data */
 
        union {
-- 
1.9.1

Reply via email to