diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-10-01 10:07:05 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-10-01 10:07:05 +0200 |
commit | ab2257e9941b9ef28d4a4a451e4b146d40a21e18 (patch) | |
tree | f4c4b558fcec9846ea840ea721d494327c5192b4 /fs/fuse/fuse_i.h | |
parent | 261aaba72fdba17b74a3a434d9f925b43d90e958 (diff) | |
download | linux-next-ab2257e9941b9ef28d4a4a451e4b146d40a21e18.tar.gz |
fuse: reduce size of struct fuse_inode
Do this by grouping fields used for cached writes and putting them into a
union with fileds used for cached readdir (with obviously no overlap, since
we don't have hybrid objects).
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r-- | fs/fuse/fuse_i.h | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index d9d1ea78efa6..f5bdce84e766 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -87,45 +87,51 @@ struct fuse_inode { /** Version of last attribute change */ u64 attr_version; - /** Files usable in writepage. Protected by fc->lock */ - struct list_head write_files; + union { + /* Write related fields (regular file only) */ + struct { + /* Files usable in writepage. Protected by fc->lock */ + struct list_head write_files; - /** Writepages pending on truncate or fsync */ - struct list_head queued_writes; + /* Writepages pending on truncate or fsync */ + struct list_head queued_writes; - /** Number of sent writes, a negative bias (FUSE_NOWRITE) - * means more writes are blocked */ - int writectr; + /* Number of sent writes, a negative bias + * (FUSE_NOWRITE) means more writes are blocked */ + int writectr; - /** Waitq for writepage completion */ - wait_queue_head_t page_waitq; + /* Waitq for writepage completion */ + wait_queue_head_t page_waitq; - /** List of writepage requestst (pending or sent) */ - struct list_head writepages; + /* List of writepage requestst (pending or sent) */ + struct list_head writepages; + }; - /* readdir cache */ - struct { - /* true if fully cached */ - bool cached; + /* readdir cache (directory only) */ + struct { + /* true if fully cached */ + bool cached; - /* size of cache */ - loff_t size; + /* size of cache */ + loff_t size; - /* position at end of cache (position of next entry) */ - loff_t pos; + /* position at end of cache (position of next entry) */ + loff_t pos; - /* version of the cache */ - u64 version; + /* version of the cache */ + u64 version; - /* modification time of directory when cache was started */ - struct timespec64 mtime; + /* modification time of directory when cache was + * started */ + struct timespec64 mtime; - /* iversion of directory when cache was started */ - u64 iversion; + /* iversion of directory when cache was started */ + u64 iversion; - /* protects above fields */ - spinlock_t lock; - } rdc; + /* protects above fields */ + spinlock_t lock; + } rdc; + }; /** Miscellaneous bits describing inode state */ unsigned long state; |