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>
This commit is contained in:
committed by
Steven Whitehouse
parent
2db2aac255
commit
0a7ab79c5b
@@ -23,6 +23,12 @@
|
||||
#include "sys.h"
|
||||
#include "util.h"
|
||||
#include "glock.h"
|
||||
#include "quota.h"
|
||||
|
||||
static struct shrinker qd_shrinker = {
|
||||
.shrink = gfs2_shrink_qd_memory,
|
||||
.seeks = DEFAULT_SEEKS,
|
||||
};
|
||||
|
||||
static void gfs2_init_inode_once(void *foo)
|
||||
{
|
||||
@@ -100,6 +106,8 @@ static int __init init_gfs2_fs(void)
|
||||
if (!gfs2_quotad_cachep)
|
||||
goto fail;
|
||||
|
||||
register_shrinker(&qd_shrinker);
|
||||
|
||||
error = register_filesystem(&gfs2_fs_type);
|
||||
if (error)
|
||||
goto fail;
|
||||
@@ -117,6 +125,7 @@ static int __init init_gfs2_fs(void)
|
||||
fail_unregister:
|
||||
unregister_filesystem(&gfs2_fs_type);
|
||||
fail:
|
||||
unregister_shrinker(&qd_shrinker);
|
||||
gfs2_glock_exit();
|
||||
|
||||
if (gfs2_quotad_cachep)
|
||||
@@ -145,6 +154,7 @@ fail:
|
||||
|
||||
static void __exit exit_gfs2_fs(void)
|
||||
{
|
||||
unregister_shrinker(&qd_shrinker);
|
||||
gfs2_glock_exit();
|
||||
gfs2_unregister_debugfs();
|
||||
unregister_filesystem(&gfs2_fs_type);
|
||||
|
Reference in New Issue
Block a user