internal.h 2.9 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
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);
73
extern int finish_automount(struct vfsmount *, struct path *);
74 75
extern int do_add_mount(struct vfsmount *, struct path *, int);
extern void mnt_clear_expiry(struct vfsmount *);
76

A
Al Viro 已提交
77 78 79
extern void mnt_make_longterm(struct vfsmount *);
extern void mnt_make_shortterm(struct vfsmount *);

80
extern void __init mnt_init(void);
81

N
Nick Piggin 已提交
82 83
DECLARE_BRLOCK(vfsmount_lock);

A
Al Viro 已提交
84

85 86 87 88
/*
 * fs_struct.c
 */
extern void chroot_fs_refs(struct path *, struct path *);
89 90 91 92

/*
 * file_table.c
 */
N
Nick Piggin 已提交
93 94
extern void file_sb_list_add(struct file *f, struct super_block *sb);
extern void file_sb_list_del(struct file *f);
95
extern void mark_files_ro(struct super_block *);
96
extern struct file *get_empty_filp(void);
A
Al Viro 已提交
97 98 99 100 101

/*
 * super.c
 */
extern int do_remount_sb(struct super_block *, int, void *, int);
A
Al Viro 已提交
102 103
extern void __put_super(struct super_block *sb);
extern void put_super(struct super_block *sb);
104 105 106 107 108 109 110

/*
 * open.c
 */
struct nameidata;
extern struct file *nameidata_to_filp(struct nameidata *);
extern void release_open_intent(struct nameidata *);
A
Al Viro 已提交
111 112 113 114

/*
 * inode.c
 */
115
extern int get_nr_dirty_inodes(void);
A
Al Viro 已提交
116
extern void evict_inodes(struct super_block *);
A
Al Viro 已提交
117
extern int invalidate_inodes(struct super_block *);