diff options
author | Abhijith Das <adas@redhat.com> | 2009-01-07 17:03:37 -0500 |
---|---|---|
committer | Steven Whitehouse <steve@dolmen.chygwyn.com> | 2009-03-24 07:21:12 -0400 |
commit | 0a7ab79c5b5a16035e09b466c9013c8afc3b4bff (patch) | |
tree | bb82ea7f936b334b4de184288bc951f1642e9541 /fs/gfs2/main.c | |
parent | 2db2aac255c38e75ad17c0b24feb589ccfccc0ae (diff) |
GFS2: change gfs2_quota_scan into a shrinker
Deallocation of gfs2_quota_data objects now happens on-demand through a
shrinker instead of routinely deallocating through the quotad daemon.
Signed-off-by: Abhijith Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/main.c')
-rw-r--r-- | fs/gfs2/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 7cacfde32194..86fe06798711 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c | |||
@@ -23,6 +23,12 @@ | |||
23 | #include "sys.h" | 23 | #include "sys.h" |
24 | #include "util.h" | 24 | #include "util.h" |
25 | #include "glock.h" | 25 | #include "glock.h" |
26 | #include "quota.h" | ||
27 | |||
28 | static struct shrinker qd_shrinker = { | ||
29 | .shrink = gfs2_shrink_qd_memory, | ||
30 | .seeks = DEFAULT_SEEKS, | ||
31 | }; | ||
26 | 32 | ||
27 | static void gfs2_init_inode_once(void *foo) | 33 | static void gfs2_init_inode_once(void *foo) |
28 | { | 34 | { |
@@ -100,6 +106,8 @@ static int __init init_gfs2_fs(void) | |||
100 | if (!gfs2_quotad_cachep) | 106 | if (!gfs2_quotad_cachep) |
101 | goto fail; | 107 | goto fail; |
102 | 108 | ||
109 | register_shrinker(&qd_shrinker); | ||
110 | |||
103 | error = register_filesystem(&gfs2_fs_type); | 111 | error = register_filesystem(&gfs2_fs_type); |
104 | if (error) | 112 | if (error) |
105 | goto fail; | 113 | goto fail; |
@@ -117,6 +125,7 @@ static int __init init_gfs2_fs(void) | |||
117 | fail_unregister: | 125 | fail_unregister: |
118 | unregister_filesystem(&gfs2_fs_type); | 126 | unregister_filesystem(&gfs2_fs_type); |
119 | fail: | 127 | fail: |
128 | unregister_shrinker(&qd_shrinker); | ||
120 | gfs2_glock_exit(); | 129 | gfs2_glock_exit(); |
121 | 130 | ||
122 | if (gfs2_quotad_cachep) | 131 | if (gfs2_quotad_cachep) |
@@ -145,6 +154,7 @@ fail: | |||
145 | 154 | ||
146 | static void __exit exit_gfs2_fs(void) | 155 | static void __exit exit_gfs2_fs(void) |
147 | { | 156 | { |
157 | unregister_shrinker(&qd_shrinker); | ||
148 | gfs2_glock_exit(); | 158 | gfs2_glock_exit(); |
149 | gfs2_unregister_debugfs(); | 159 | gfs2_unregister_debugfs(); |
150 | unregister_filesystem(&gfs2_fs_type); | 160 | unregister_filesystem(&gfs2_fs_type); |