]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.fixes/remount-no-shrink-dcache
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / remount-no-shrink-dcache
1 From: Olaf Kirch <okir@suse.de>
2 Subject: Do not call shrink_dcache_sb when remounting procfs etc
3 References: 165672
4
5 Avoid calls to shrink_dcache_sb when mounting a file system that
6 uses get_sb_single. shrink_dcache_sb is costly. On large ia64
7 systems, this will keep the dcache lock for > 60 seconds at
8 a stretch.
9
10 Signed-off-by: Olaf Kirch <okir@suse.de>
11
12 fs/super.c | 36 +++++++++++++++++++++++-------------
13 1 file changed, 23 insertions(+), 13 deletions(-)
14
15 --- a/fs/super.c
16 +++ b/fs/super.c
17 @@ -597,16 +597,10 @@ retry:
18 file_list_unlock();
19 }
20
21 -/**
22 - * do_remount_sb - asks filesystem to change mount options.
23 - * @sb: superblock in question
24 - * @flags: numeric part of options
25 - * @data: the rest of options
26 - * @force: whether or not to force the change
27 - *
28 - * Alters the mount options of a mounted file system.
29 - */
30 -int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
31 +#define REMOUNT_FORCE 1
32 +#define REMOUNT_SHRINK_DCACHE 2
33 +
34 +static int __do_remount_sb(struct super_block *sb, int flags, void *data, int rflags)
35 {
36 int retval;
37 int remount_rw;
38 @@ -617,13 +611,14 @@ int do_remount_sb(struct super_block *sb
39 #endif
40 if (flags & MS_RDONLY)
41 acct_auto_close(sb);
42 - shrink_dcache_sb(sb);
43 + if (rflags & REMOUNT_SHRINK_DCACHE)
44 + shrink_dcache_sb(sb);
45 fsync_super(sb);
46
47 /* If we are remounting RDONLY and current sb is read/write,
48 make sure there are no rw files opened */
49 if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) {
50 - if (force)
51 + if (rflags & REMOUNT_FORCE)
52 mark_files_ro(sb);
53 else if (!fs_may_remount_ro(sb))
54 return -EBUSY;
55 @@ -646,6 +641,21 @@ int do_remount_sb(struct super_block *sb
56 return 0;
57 }
58
59 +/**
60 + * do_remount_sb - asks filesystem to change mount options.
61 + * @sb: superblock in question
62 + * @flags: numeric part of options
63 + * @data: the rest of options
64 + * @force: whether or not to force the change
65 + *
66 + * Alters the mount options of a mounted file system.
67 + */
68 +int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
69 +{
70 + return __do_remount_sb(sb, flags, data,
71 + REMOUNT_SHRINK_DCACHE|(force? REMOUNT_FORCE : 0));
72 +}
73 +
74 static void do_emergency_remount(unsigned long foo)
75 {
76 struct super_block *sb;
77 @@ -877,7 +887,7 @@ int get_sb_single(struct file_system_typ
78 }
79 s->s_flags |= MS_ACTIVE;
80 }
81 - do_remount_sb(s, flags, data, 0);
82 + __do_remount_sb(s, flags, data, 0);
83 return simple_set_mnt(mnt, s);
84 }
85