aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-09-30 14:52:18 -0400
committerJens Axboe <axboe@kernel.dk>2006-09-30 14:52:18 -0400
commit07f3f05c1e3052b8656129b2a5aca9f888241a34 (patch)
tree3338b004d518a0d2189efdc3fb88e94e1c02c0ce /fs
parent65e6f5bc8149165efb9d7bdbd142bb837d5edfeb (diff)
[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: David Howells <dhowells@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_elf.c1
-rw-r--r--fs/block_dev.c1
-rw-r--r--fs/char_dev.c1
-rw-r--r--fs/compat.c10
-rw-r--r--fs/compat_ioctl.c2
-rw-r--r--fs/dcache.c4
-rw-r--r--fs/fs-writeback.c3
-rw-r--r--fs/internal.h36
-rw-r--r--fs/namespace.c3
9 files changed, 44 insertions, 17 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 6eb48e1446ec..bad52433de69 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -46,7 +46,6 @@
46static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs); 46static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs);
47static int load_elf_library(struct file *); 47static int load_elf_library(struct file *);
48static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int); 48static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int);
49extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
50 49
51#ifndef elf_addr_t 50#ifndef elf_addr_t
52#define elf_addr_t unsigned long 51#define elf_addr_t unsigned long
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 4346468139e8..20f7333ba372 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -22,6 +22,7 @@
22#include <linux/uio.h> 22#include <linux/uio.h>
23#include <linux/namei.h> 23#include <linux/namei.h>
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include "internal.h"
25 26
26struct bdev_inode { 27struct bdev_inode {
27 struct block_device bdev; 28 struct block_device bdev;
diff --git a/fs/char_dev.c b/fs/char_dev.c
index 1f3285affa39..a885f46ca001 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -24,6 +24,7 @@
24#ifdef CONFIG_KMOD 24#ifdef CONFIG_KMOD
25#include <linux/kmod.h> 25#include <linux/kmod.h>
26#endif 26#endif
27#include "internal.h"
27 28
28/* 29/*
29 * capabilities for /dev/mem, /dev/kmem and similar directly mappable character 30 * capabilities for /dev/mem, /dev/kmem and similar directly mappable character
diff --git a/fs/compat.c b/fs/compat.c
index ce982f6e8c80..122b4e3992b5 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -52,11 +52,12 @@
52#include <asm/uaccess.h> 52#include <asm/uaccess.h>
53#include <asm/mmu_context.h> 53#include <asm/mmu_context.h>
54#include <asm/ioctls.h> 54#include <asm/ioctls.h>
55 55#include "internal.h"
56extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
57 56
58int compat_log = 1; 57int compat_log = 1;
59 58
59extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
60
60int compat_printk(const char *fmt, ...) 61int compat_printk(const char *fmt, ...)
61{ 62{
62 va_list ap; 63 va_list ap;
@@ -313,9 +314,6 @@ out:
313#define IOCTL_HASHSIZE 256 314#define IOCTL_HASHSIZE 256
314static struct ioctl_trans *ioctl32_hash_table[IOCTL_HASHSIZE]; 315static struct ioctl_trans *ioctl32_hash_table[IOCTL_HASHSIZE];
315 316
316extern struct ioctl_trans ioctl_start[];
317extern int ioctl_table_size;
318
319static inline unsigned long ioctl32_hash(unsigned long cmd) 317static inline unsigned long ioctl32_hash(unsigned long cmd)
320{ 318{
321 return (((cmd >> 6) ^ (cmd >> 4) ^ cmd)) % IOCTL_HASHSIZE; 319 return (((cmd >> 6) ^ (cmd >> 4) ^ cmd)) % IOCTL_HASHSIZE;
@@ -838,8 +836,6 @@ static int do_nfs4_super_data_conv(void *raw_data)
838 return 0; 836 return 0;
839} 837}
840 838
841extern int copy_mount_options (const void __user *, unsigned long *);
842
843#define SMBFS_NAME "smbfs" 839#define SMBFS_NAME "smbfs"
844#define NCPFS_NAME "ncpfs" 840#define NCPFS_NAME "ncpfs"
845#define NFS4_NAME "nfs4" 841#define NFS4_NAME "nfs4"
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 4063a9396977..ab74c9bd55fe 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1279,8 +1279,6 @@ static int loop_status(unsigned int fd, unsigned int cmd, unsigned long arg)
1279 return err; 1279 return err;
1280} 1280}
1281 1281
1282extern int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg);
1283
1284#ifdef CONFIG_VT 1282#ifdef CONFIG_VT
1285 1283
1286static int vt_check(struct file *file) 1284static int vt_check(struct file *file)
diff --git a/fs/dcache.c b/fs/dcache.c
index 17b392a2049e..fc2faa44f8d1 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -32,6 +32,7 @@
32#include <linux/seqlock.h> 32#include <linux/seqlock.h>
33#include <linux/swap.h> 33#include <linux/swap.h>
34#include <linux/bootmem.h> 34#include <linux/bootmem.h>
35#include "internal.h"
35 36
36 37
37int sysctl_vfs_cache_pressure __read_mostly = 100; 38int sysctl_vfs_cache_pressure __read_mostly = 100;
@@ -1877,9 +1878,6 @@ kmem_cache_t *filp_cachep __read_mostly;
1877 1878
1878EXPORT_SYMBOL(d_genocide); 1879EXPORT_SYMBOL(d_genocide);
1879 1880
1880extern void bdev_cache_init(void);
1881extern void chrdev_init(void);
1882
1883void __init vfs_caches_init_early(void) 1881void __init vfs_caches_init_early(void)
1884{ 1882{
1885 dcache_init_early(); 1883 dcache_init_early();
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 892643dc9af1..0639024d83a9 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -22,8 +22,7 @@
22#include <linux/blkdev.h> 22#include <linux/blkdev.h>
23#include <linux/backing-dev.h> 23#include <linux/backing-dev.h>
24#include <linux/buffer_head.h> 24#include <linux/buffer_head.h>
25 25#include "internal.h"
26extern struct super_block *blockdev_superblock;
27 26
28/** 27/**
29 * __mark_inode_dirty - internal function 28 * __mark_inode_dirty - internal function
diff --git a/fs/internal.h b/fs/internal.h
new file mode 100644
index 000000000000..c21ecd37b1e7
--- /dev/null
+++ b/fs/internal.h
@@ -0,0 +1,36 @@
1/* fs/ internal definitions
2 *
3 * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <linux/ioctl32.h>
13
14/*
15 * block_dev.c
16 */
17extern struct super_block *blockdev_superblock;
18extern void __init bdev_cache_init(void);
19
20/*
21 * char_dev.c
22 */
23extern void __init chrdev_init(void);
24
25/*
26 * compat_ioctl.c
27 */
28#ifdef CONFIG_COMPAT
29extern struct ioctl_trans ioctl_start[];
30extern int ioctl_table_size;
31#endif
32
33/*
34 * namespace.c
35 */
36extern int copy_mount_options(const void __user *, unsigned long *);
diff --git a/fs/namespace.c b/fs/namespace.c
index 6ede3a539ed8..66d921e14fee 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -24,12 +24,11 @@
24#include <linux/namei.h> 24#include <linux/namei.h>
25#include <linux/security.h> 25#include <linux/security.h>
26#include <linux/mount.h> 26#include <linux/mount.h>
27#include <linux/ramfs.h>
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28#include <asm/unistd.h> 29#include <asm/unistd.h>
29#include "pnode.h" 30#include "pnode.h"
30 31
31extern int __init init_rootfs(void);
32
33/* spinlock for vfsmount related operations, inplace of dcache_lock */ 32/* spinlock for vfsmount related operations, inplace of dcache_lock */
34__cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock); 33__cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock);
35 34