diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-12-08 07:12:13 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2010-03-01 09:07:37 -0500 |
commit | 009d851837ab26cab18adda6169a813f70b0b21b (patch) | |
tree | 073bc05e3a8c527bf9ce3332e2c2f6694484984d /fs/gfs2/meta_io.h | |
parent | 30ff056c42c665b9ea535d8515890857ae382540 (diff) |
GFS2: Metadata address space clean up
Since the start of GFS2, an "extra" inode has been used to store
the metadata belonging to each inode. The only reason for using
this inode was to have an extra address space, the other fields
were unused. This means that the memory usage was rather inefficient.
The reason for keeping each inode's metadata in a separate address
space is that when glocks are requested on remote nodes, we need to
be able to efficiently locate the data and metadata which relating
to that glock (inode) in order to sync or sync and invalidate it
(depending on the remotely requested lock mode).
This patch adds a new type of glock, which has in addition to
its normal fields, has an address space. This applies to all
inode and rgrp glocks (but to no other glock types which remain
as before). As a result, we no longer need to have the second
inode.
This results in three major improvements:
1. A saving of approx 25% of memory used in caching inodes
2. A removal of the circular dependency between inodes and glocks
3. No confusion between "normal" and "metadata" inodes in super.c
Although the first of these is the more immediately apparent, the
second is just as important as it now enables a number of clean
ups at umount time. Those will be the subject of future patches.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/meta_io.h')
-rw-r--r-- | fs/gfs2/meta_io.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h index de270c2f9b63..6a1d9ba16411 100644 --- a/fs/gfs2/meta_io.h +++ b/fs/gfs2/meta_io.h | |||
@@ -37,8 +37,16 @@ static inline void gfs2_buffer_copy_tail(struct buffer_head *to_bh, | |||
37 | 0, from_head - to_head); | 37 | 0, from_head - to_head); |
38 | } | 38 | } |
39 | 39 | ||
40 | struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp); | 40 | extern const struct address_space_operations gfs2_meta_aops; |
41 | void gfs2_aspace_put(struct inode *aspace); | 41 | |
42 | static inline struct gfs2_sbd *gfs2_mapping2sbd(struct address_space *mapping) | ||
43 | { | ||
44 | struct inode *inode = mapping->host; | ||
45 | if (mapping->a_ops == &gfs2_meta_aops) | ||
46 | return (((struct gfs2_glock *)mapping) - 1)->gl_sbd; | ||
47 | else | ||
48 | return inode->i_sb->s_fs_info; | ||
49 | } | ||
42 | 50 | ||
43 | void gfs2_meta_sync(struct gfs2_glock *gl); | 51 | void gfs2_meta_sync(struct gfs2_glock *gl); |
44 | 52 | ||