Skip to content

Commit 8fa1f1c

Browse files
author
Al Viro
committed
make fs/{namespace,super}.c forget about acct.h
These externs belong in fs/internal.h. Rename (they are not acct-specific anymore) and move them over there. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent efb170c commit 8fa1f1c

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

‎fs/fs_pin.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <linux/fs.h>
22
#include <linux/slab.h>
33
#include <linux/fs_pin.h>
4+
#include "internal.h"
45
#include "mount.h"
56

67
static void pin_free_rcu(struct rcu_head *head)
@@ -32,13 +33,13 @@ void pin_insert(struct fs_pin *pin, struct vfsmount *m)
3233
spin_unlock(&pin_lock);
3334
}
3435

35-
void acct_auto_close_mnt(struct hlist_head *list)
36+
void mnt_pin_kill(struct mount *m)
3637
{
3738
while (1) {
3839
struct hlist_node *p;
3940
struct fs_pin *pin;
4041
rcu_read_lock();
41-
p = ACCESS_ONCE(list->first);
42+
p = ACCESS_ONCE(m->mnt_pins.first);
4243
if (!p) {
4344
rcu_read_unlock();
4445
break;
@@ -54,13 +55,13 @@ void acct_auto_close_mnt(struct hlist_head *list)
5455
}
5556
}
5657

57-
void acct_auto_close(struct hlist_head *list)
58+
void sb_pin_kill(struct super_block *sb)
5859
{
5960
while (1) {
6061
struct hlist_node *p;
6162
struct fs_pin *pin;
6263
rcu_read_lock();
63-
p = ACCESS_ONCE(list->first);
64+
p = ACCESS_ONCE(sb->s_pins.first);
6465
if (!p) {
6566
rcu_read_unlock();
6667
break;

‎fs/internal.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,9 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
143143
* pipe.c
144144
*/
145145
extern const struct file_operations pipefifo_fops;
146+
147+
/*
148+
* fs_pin.c
149+
*/
150+
extern void sb_pin_kill(struct super_block *sb);
151+
extern void mnt_pin_kill(struct mount *m);

‎fs/namespace.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <linux/namei.h>
1717
#include <linux/security.h>
1818
#include <linux/idr.h>
19-
#include <linux/acct.h> /* acct_auto_close_mnt */
2019
#include <linux/init.h> /* init_rootfs */
2120
#include <linux/fs_struct.h> /* get_fs_root et.al. */
2221
#include <linux/fsnotify.h> /* fsnotify_vfsmount_delete */
@@ -956,7 +955,7 @@ static void mntput_no_expire(struct mount *mnt)
956955
mnt->mnt_pinned = 0;
957956
rcu_read_unlock();
958957
unlock_mount_hash();
959-
acct_auto_close_mnt(&mnt->mnt_pins);
958+
mnt_pin_kill(mnt);
960959
goto put_again;
961960
}
962961
if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) {

‎fs/super.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#include <linux/export.h>
2424
#include <linux/slab.h>
25-
#include <linux/acct.h>
2625
#include <linux/blkdev.h>
2726
#include <linux/mount.h>
2827
#include <linux/security.h>
@@ -707,7 +706,7 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
707706
if (remount_ro) {
708707
if (sb->s_pins.first) {
709708
up_write(&sb->s_umount);
710-
acct_auto_close(&sb->s_pins);
709+
sb_pin_kill(sb);
711710
down_write(&sb->s_umount);
712711
if (!sb->s_root)
713712
return 0;

‎include/linux/acct.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ extern void acct_exit_ns(struct pid_namespace *);
3232
#define acct_process() do { } while (0)
3333
#define acct_exit_ns(ns) do { } while (0)
3434
#endif
35-
extern void acct_auto_close(struct hlist_head *);
36-
extern void acct_auto_close_mnt(struct hlist_head *);
3735

3836
/*
3937
* ACCT_VERSION numbers as yet defined:

0 commit comments

Comments
 (0)