提交 07f3f05c 编写于 作者: D David Howells 提交者: Jens Axboe

[PATCH] BLOCK: Move extern declarations out of fs/*.c into header files [try #6]

Create a new header file, fs/internal.h, for common definitions local to the
sources in the fs/ directory.

Move extern definitions that should be in header files from fs/*.c to
fs/internal.h or other main header files where they span directories.
Signed-Off-By: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 65e6f5bc
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#include "signal-common.h" #include "signal-common.h"
extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
/* /*
* Including <asm/unistd.h> would give use the 64-bit syscall numbers ... * Including <asm/unistd.h> would give use the 64-bit syscall numbers ...
*/ */
...@@ -81,8 +83,6 @@ struct rt_sigframe_n32 { ...@@ -81,8 +83,6 @@ struct rt_sigframe_n32 {
#endif #endif
}; };
extern void sigset_from_compat (sigset_t *set, compat_sigset_t *compat);
save_static_function(sysn32_rt_sigsuspend); save_static_function(sysn32_rt_sigsuspend);
__attribute_used__ noinline static int __attribute_used__ noinline static int
_sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) _sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs); static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs);
static int load_elf_library(struct file *); static int load_elf_library(struct file *);
static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int); static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int);
extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
#ifndef elf_addr_t #ifndef elf_addr_t
#define elf_addr_t unsigned long #define elf_addr_t unsigned long
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/uio.h> #include <linux/uio.h>
#include <linux/namei.h> #include <linux/namei.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "internal.h"
struct bdev_inode { struct bdev_inode {
struct block_device bdev; struct block_device bdev;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#ifdef CONFIG_KMOD #ifdef CONFIG_KMOD
#include <linux/kmod.h> #include <linux/kmod.h>
#endif #endif
#include "internal.h"
/* /*
* capabilities for /dev/mem, /dev/kmem and similar directly mappable character * capabilities for /dev/mem, /dev/kmem and similar directly mappable character
......
...@@ -52,11 +52,12 @@ ...@@ -52,11 +52,12 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/ioctls.h> #include <asm/ioctls.h>
#include "internal.h"
extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
int compat_log = 1; int compat_log = 1;
extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
int compat_printk(const char *fmt, ...) int compat_printk(const char *fmt, ...)
{ {
va_list ap; va_list ap;
...@@ -313,9 +314,6 @@ asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, struct c ...@@ -313,9 +314,6 @@ asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, struct c
#define IOCTL_HASHSIZE 256 #define IOCTL_HASHSIZE 256
static struct ioctl_trans *ioctl32_hash_table[IOCTL_HASHSIZE]; static struct ioctl_trans *ioctl32_hash_table[IOCTL_HASHSIZE];
extern struct ioctl_trans ioctl_start[];
extern int ioctl_table_size;
static inline unsigned long ioctl32_hash(unsigned long cmd) static inline unsigned long ioctl32_hash(unsigned long cmd)
{ {
return (((cmd >> 6) ^ (cmd >> 4) ^ cmd)) % IOCTL_HASHSIZE; return (((cmd >> 6) ^ (cmd >> 4) ^ cmd)) % IOCTL_HASHSIZE;
...@@ -838,8 +836,6 @@ static int do_nfs4_super_data_conv(void *raw_data) ...@@ -838,8 +836,6 @@ static int do_nfs4_super_data_conv(void *raw_data)
return 0; return 0;
} }
extern int copy_mount_options (const void __user *, unsigned long *);
#define SMBFS_NAME "smbfs" #define SMBFS_NAME "smbfs"
#define NCPFS_NAME "ncpfs" #define NCPFS_NAME "ncpfs"
#define NFS4_NAME "nfs4" #define NFS4_NAME "nfs4"
......
...@@ -1279,8 +1279,6 @@ static int loop_status(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -1279,8 +1279,6 @@ static int loop_status(unsigned int fd, unsigned int cmd, unsigned long arg)
return err; return err;
} }
extern int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg);
#ifdef CONFIG_VT #ifdef CONFIG_VT
static int vt_check(struct file *file) static int vt_check(struct file *file)
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/seqlock.h> #include <linux/seqlock.h>
#include <linux/swap.h> #include <linux/swap.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include "internal.h"
int sysctl_vfs_cache_pressure __read_mostly = 100; int sysctl_vfs_cache_pressure __read_mostly = 100;
...@@ -1877,9 +1878,6 @@ kmem_cache_t *filp_cachep __read_mostly; ...@@ -1877,9 +1878,6 @@ kmem_cache_t *filp_cachep __read_mostly;
EXPORT_SYMBOL(d_genocide); EXPORT_SYMBOL(d_genocide);
extern void bdev_cache_init(void);
extern void chrdev_init(void);
void __init vfs_caches_init_early(void) void __init vfs_caches_init_early(void)
{ {
dcache_init_early(); dcache_init_early();
......
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include "internal.h"
extern struct super_block *blockdev_superblock;
/** /**
* __mark_inode_dirty - internal function * __mark_inode_dirty - internal function
......
/* 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.
*/
#include <linux/ioctl32.h>
/*
* block_dev.c
*/
extern struct super_block *blockdev_superblock;
extern void __init bdev_cache_init(void);
/*
* char_dev.c
*/
extern void __init chrdev_init(void);
/*
* compat_ioctl.c
*/
#ifdef CONFIG_COMPAT
extern struct ioctl_trans ioctl_start[];
extern int ioctl_table_size;
#endif
/*
* namespace.c
*/
extern int copy_mount_options(const void __user *, unsigned long *);
...@@ -24,12 +24,11 @@ ...@@ -24,12 +24,11 @@
#include <linux/namei.h> #include <linux/namei.h>
#include <linux/security.h> #include <linux/security.h>
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/ramfs.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include "pnode.h" #include "pnode.h"
extern int __init init_rootfs(void);
/* spinlock for vfsmount related operations, inplace of dcache_lock */ /* spinlock for vfsmount related operations, inplace of dcache_lock */
__cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock); __cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock);
......
...@@ -17,5 +17,6 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); ...@@ -17,5 +17,6 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
extern const struct file_operations ramfs_file_operations; extern const struct file_operations ramfs_file_operations;
extern struct vm_operations_struct generic_file_vm_ops; extern struct vm_operations_struct generic_file_vm_ops;
extern int __init init_rootfs(void);
#endif #endif
...@@ -307,6 +307,9 @@ extern void tty_ldisc_put(int); ...@@ -307,6 +307,9 @@ extern void tty_ldisc_put(int);
extern void tty_wakeup(struct tty_struct *tty); extern void tty_wakeup(struct tty_struct *tty);
extern void tty_ldisc_flush(struct tty_struct *tty); extern void tty_ldisc_flush(struct tty_struct *tty);
extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg);
extern struct mutex tty_mutex; extern struct mutex tty_mutex;
/* n_tty.c */ /* n_tty.c */
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
int get_compat_timespec(struct timespec *ts, const struct compat_timespec __user *cts) int get_compat_timespec(struct timespec *ts, const struct compat_timespec __user *cts)
{ {
return (!access_ok(VERIFY_READ, cts, sizeof(*cts)) || return (!access_ok(VERIFY_READ, cts, sizeof(*cts)) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册