internal.h 2.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
/* fs/ internal definitions
 *
 * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

N
Nick Piggin 已提交
12 13
#include <linux/lglock.h>

14
struct super_block;
15
struct linux_binprm;
16
struct path;
17

18 19 20
/*
 * block_dev.c
 */
21
#ifdef CONFIG_BLOCK
22 23 24
extern struct super_block *blockdev_superblock;
extern void __init bdev_cache_init(void);

25 26 27 28 29
static inline int sb_is_blkdev_sb(struct super_block *sb)
{
	return sb == blockdev_superblock;
}

30 31
extern int __sync_blockdev(struct block_device *bdev, int wait);

32
#else
33 34 35
static inline void bdev_cache_init(void)
{
}
36

37 38 39 40
static inline int sb_is_blkdev_sb(struct super_block *sb)
{
	return 0;
}
41 42 43 44 45

static inline int __sync_blockdev(struct block_device *bdev, int wait)
{
	return 0;
}
46
#endif
47

48 49 50 51 52
/*
 * char_dev.c
 */
extern void __init chrdev_init(void);

53 54 55
/*
 * exec.c
 */
A
Al Viro 已提交
56
extern int check_unsafe_exec(struct linux_binprm *);
57

58 59 60 61
/*
 * namespace.c
 */
extern int copy_mount_options(const void __user *, unsigned long *);
62
extern int copy_mount_string(const void __user *, char **);
63 64 65

extern void free_vfsmnt(struct vfsmount *);
extern struct vfsmount *alloc_vfsmnt(const char *);
N
Nick Piggin 已提交
66
extern unsigned int mnt_get_count(struct vfsmount *mnt);
67 68 69 70 71 72 73 74
extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
				struct vfsmount *);
extern void release_mounts(struct list_head *);
extern void umount_tree(struct vfsmount *, int, struct list_head *);
extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);

extern void __init mnt_init(void);
75

N
Nick Piggin 已提交
76 77
DECLARE_BRLOCK(vfsmount_lock);

A
Al Viro 已提交
78

79 80 81 82
/*
 * fs_struct.c
 */
extern void chroot_fs_refs(struct path *, struct path *);
83 84 85 86

/*
 * file_table.c
 */
N
Nick Piggin 已提交
87 88
extern void file_sb_list_add(struct file *f, struct super_block *sb);
extern void file_sb_list_del(struct file *f);
89
extern void mark_files_ro(struct super_block *);
90
extern struct file *get_empty_filp(void);
A
Al Viro 已提交
91 92 93 94 95

/*
 * super.c
 */
extern int do_remount_sb(struct super_block *, int, void *, int);
A
Al Viro 已提交
96 97
extern void __put_super(struct super_block *sb);
extern void put_super(struct super_block *sb);
98 99 100 101 102 103 104

/*
 * open.c
 */
struct nameidata;
extern struct file *nameidata_to_filp(struct nameidata *);
extern void release_open_intent(struct nameidata *);
A
Al Viro 已提交
105 106 107 108

/*
 * inode.c
 */
109
extern int get_nr_dirty_inodes(void);
A
Al Viro 已提交
110
extern void evict_inodes(struct super_block *);
A
Al Viro 已提交
111
extern int invalidate_inodes(struct super_block *);