From: Al Viro <viro@ftp.linux.org.uk>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: dealing with excessive includes
Date: Fri, 20 Oct 2006 01:53:37 +0100 [thread overview]
Message-ID: <20061020005337.GV29920@ftp.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.64.0610180926380.3962@g5.osdl.org>
On Wed, Oct 18, 2006 at 09:32:08AM -0700, Linus Torvalds wrote:
> guess it protects against "sync()", but that's pretty much it. ]
>
> That said, I'd rather do any lock_super() cleanup totally _independently_
> of a include file cleanup.
>
> So since it's clearly not performance-critical, how about just making it
> be out-of-line in fs/super.c, and turn the header file into just a
> declaration?
Done. Several more in followups.
---
arch/i386/kernel/acpi/cstate.c | 1 +
drivers/acpi/dock.c | 1 +
drivers/char/hw_random/core.c | 1 +
drivers/char/tpm/tpm.h | 1 +
drivers/hwmon/hdaps.c | 1 +
drivers/spi/spi_butterfly.c | 1 +
fs/9p/conv.c | 1 +
fs/9p/fcall.c | 1 +
fs/9p/fid.c | 1 +
fs/9p/v9fs.c | 1 +
fs/9p/vfs_dir.c | 1 +
fs/9p/vfs_file.c | 1 +
fs/inotify.c | 1 +
fs/jffs2/acl.c | 1 +
fs/jffs2/wbuf.c | 1 +
fs/jfs/ioctl.c | 1 +
fs/proc/root.c | 1 +
fs/super.c | 18 ++++++++++++++++++
fs/sync.c | 1 +
fs/utimes.c | 1 +
include/linux/fs.h | 37 +++++++------------------------------
include/linux/radix-tree.h | 1 -
22 files changed, 44 insertions(+), 31 deletions(-)
diff --git a/arch/i386/kernel/acpi/cstate.c b/arch/i386/kernel/acpi/cstate.c
index 20563e5..4664b55 100644
--- a/arch/i386/kernel/acpi/cstate.c
+++ b/arch/i386/kernel/acpi/cstate.c
@@ -11,6 +11,7 @@ #include <linux/module.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/cpu.h>
+#include <linux/sched.h>
#include <acpi/processor.h>
#include <asm/acpi.h>
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 578b99b..bf5b79e 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -27,6 +27,7 @@ #include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/notifier.h>
+#include <linux/jiffies.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 154a81d..b8c9417 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -36,6 +36,7 @@ #include <linux/hw_random.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/delay.h>
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 050ced2..bb9a43c 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -22,6 +22,7 @@ #include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/platform_device.h>
#include <linux/io.h>
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c
index 26be4ea..e8ef62b 100644
--- a/drivers/hwmon/hdaps.c
+++ b/drivers/hwmon/hdaps.c
@@ -33,6 +33,7 @@ #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/timer.h>
#include <linux/dmi.h>
+#include <linux/jiffies.h>
#include <asm/io.h>
#define HDAPS_LOW_PORT 0x1600 /* first port used by hdaps */
diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c
index 39d9b20..c2f601f 100644
--- a/drivers/spi/spi_butterfly.c
+++ b/drivers/spi/spi_butterfly.c
@@ -23,6 +23,7 @@ #include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/parport.h>
+#include <linux/sched.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi_bitbang.h>
#include <linux/spi/flash.h>
diff --git a/fs/9p/conv.c b/fs/9p/conv.c
index 56d88c1..a3ed571 100644
--- a/fs/9p/conv.c
+++ b/fs/9p/conv.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/idr.h>
#include <asm/uaccess.h>
#include "debug.h"
diff --git a/fs/9p/fcall.c b/fs/9p/fcall.c
index 8556097..dc336a6 100644
--- a/fs/9p/fcall.c
+++ b/fs/9p/fcall.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/idr.h>
#include "debug.h"
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 70492cc..2750720 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -23,6 +23,7 @@
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/idr.h>
#include "debug.h"
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 0f62804..0b96fae 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -26,6 +26,7 @@
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/parser.h>
#include <linux/idr.h>
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index e32d597..905c882 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -30,6 +30,7 @@ #include <linux/file.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/smp_lock.h>
+#include <linux/sched.h>
#include <linux/inet.h>
#include <linux/idr.h>
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index c3c47ed..79e6f9c 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -26,6 +26,7 @@
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/file.h>
#include <linux/stat.h>
#include <linux/string.h>
diff --git a/fs/inotify.c b/fs/inotify.c
index 723836a..f5099d8 100644
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -27,6 +27,7 @@ #include <linux/spinlock.h>
#include <linux/idr.h>
#include <linux/slab.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/writeback.h>
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index 0ae3cd1..73f0d60 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -11,6 +11,7 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/time.h>
#include <linux/crc32.h>
#include <linux/jffs2.h>
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index b9b7007..7070730 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -19,6 +19,7 @@ #include <linux/mtd/mtd.h>
#include <linux/crc32.h>
#include <linux/mtd/nand.h>
#include <linux/jiffies.h>
+#include <linux/sched.h>
#include "nodelist.h"
diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c
index 37db524..ed814b1 100644
--- a/fs/jfs/ioctl.c
+++ b/fs/jfs/ioctl.c
@@ -9,6 +9,7 @@ #include <linux/fs.h>
#include <linux/ctype.h>
#include <linux/capability.h>
#include <linux/time.h>
+#include <linux/sched.h>
#include <asm/current.h>
#include <asm/uaccess.h>
diff --git a/fs/proc/root.c b/fs/proc/root.c
index ffe66c3..64d242b 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -13,6 +13,7 @@ #include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/init.h>
+#include <linux/sched.h>
#include <linux/module.h>
#include <linux/bitops.h>
#include <linux/smp_lock.h>
diff --git a/fs/super.c b/fs/super.c
index 47e554c..84c320f 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -221,6 +221,24 @@ static int grab_super(struct super_block
}
/*
+ * Superblock locking. We really ought to get rid of these two.
+ */
+void lock_super(struct super_block * sb)
+{
+ get_fs_excl();
+ mutex_lock(&sb->s_lock);
+}
+
+void unlock_super(struct super_block * sb)
+{
+ put_fs_excl();
+ mutex_unlock(&sb->s_lock);
+}
+
+EXPORT_SYMBOL(lock_super);
+EXPORT_SYMBOL(unlock_super);
+
+/*
* Write out and wait upon all dirty data associated with this
* superblock. Filesystem data as well as the underlying block
* device. Takes the superblock lock. Requires a second blkdev
diff --git a/fs/sync.c b/fs/sync.c
index 1de747b..865f32b 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -6,6 +6,7 @@ #include <linux/kernel.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/module.h>
+#include <linux/sched.h>
#include <linux/writeback.h>
#include <linux/syscalls.h>
#include <linux/linkage.h>
diff --git a/fs/utimes.c b/fs/utimes.c
index 1bcd852..99cf2cb 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -2,6 +2,7 @@ #include <linux/compiler.h>
#include <linux/fs.h>
#include <linux/linkage.h>
#include <linux/namei.h>
+#include <linux/sched.h>
#include <linux/utime.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 34406ed..2eadd84 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -276,7 +276,7 @@ #include <linux/list.h>
#include <linux/radix-tree.h>
#include <linux/prio_tree.h>
#include <linux/init.h>
-#include <linux/sched.h>
+#include <linux/pid.h>
#include <linux/mutex.h>
#include <asm/atomic.h>
@@ -970,36 +970,13 @@ enum {
#define vfs_check_frozen(sb, level) \
wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
-static inline void get_fs_excl(void)
-{
- atomic_inc(¤t->fs_excl);
-}
-
-static inline void put_fs_excl(void)
-{
- atomic_dec(¤t->fs_excl);
-}
-
-static inline int has_fs_excl(void)
-{
- return atomic_read(¤t->fs_excl);
-}
+#define get_fs_excl() atomic_inc(¤t->fs_excl)
+#define put_fs_excl() atomic_dec(¤t->fs_excl)
+#define has_fs_excl() atomic_read(¤t->fs_excl)
-
-/*
- * Superblock locking.
- */
-static inline void lock_super(struct super_block * sb)
-{
- get_fs_excl();
- mutex_lock(&sb->s_lock);
-}
-
-static inline void unlock_super(struct super_block * sb)
-{
- put_fs_excl();
- mutex_unlock(&sb->s_lock);
-}
+/* not quite ready to be deprecated, but... */
+extern void lock_super(struct super_block *);
+extern void unlock_super(struct super_block *);
/*
* VFS helper functions..
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 9158a68..cbfa115 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -19,7 +19,6 @@
#ifndef _LINUX_RADIX_TREE_H
#define _LINUX_RADIX_TREE_H
-#include <linux/sched.h>
#include <linux/preempt.h>
#include <linux/types.h>
--
1.4.2.GIT
next prev parent reply other threads:[~2006-10-20 0:53 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-17 0:50 [RFC] typechecking for get_unaligned/put_unaligned Al Viro
2006-10-17 1:50 ` Linus Torvalds
2006-10-17 4:37 ` Al Viro
2006-10-17 15:24 ` Linus Torvalds
2006-10-18 4:40 ` dealing with excessive includes Al Viro
2006-10-18 9:19 ` Alexey Dobriyan
2006-10-18 9:31 ` Al Viro
2006-10-18 10:00 ` Alexey Dobriyan
2006-10-18 17:42 ` Al Viro
2006-10-18 21:48 ` Alexey Dobriyan
2006-10-18 15:04 ` Linus Torvalds
2006-10-18 15:13 ` Matthew Wilcox
2006-10-18 16:06 ` Al Viro
2006-10-18 16:32 ` Linus Torvalds
2006-10-18 17:44 ` Al Viro
2006-10-19 16:23 ` Al Viro
2006-10-19 18:24 ` Andreas Gruenbacher
2006-10-20 0:53 ` Al Viro [this message]
2006-10-20 0:57 ` Al Viro
2006-10-20 12:43 ` Matthew Wilcox
2006-10-20 0:58 ` Al Viro
2006-10-20 0:59 ` Al Viro
2006-10-20 1:02 ` Al Viro
2006-10-20 4:35 ` Randy Dunlap
2006-10-20 9:26 ` Stefan Richter
2006-10-20 16:13 ` Randy Dunlap
2006-10-20 17:51 ` Stefan Richter
2006-10-22 17:58 ` Geert Uytterhoeven
2006-10-22 22:59 ` Andi Kleen
2006-10-23 8:29 ` Geert Uytterhoeven
2006-10-23 16:09 ` Linus Torvalds
2006-10-23 16:13 ` Geert Uytterhoeven
2006-10-23 16:31 ` Linus Torvalds
2006-10-23 16:52 ` Geert Uytterhoeven
2006-10-23 17:05 ` Linus Torvalds
2006-10-23 0:31 ` Matthew Wilcox
2006-10-23 0:42 ` Andi Kleen
2006-10-23 1:08 ` Matthew Wilcox
2006-10-23 1:31 ` Andi Kleen
2006-10-23 1:36 ` Matthew Wilcox
2006-10-23 1:41 ` Andi Kleen
2006-10-23 8:34 ` Geert Uytterhoeven
2006-10-23 1:48 ` Randy Dunlap
2006-10-23 1:49 ` Nick Piggin
2006-10-23 6:34 ` Stefan Richter
2006-10-18 16:15 ` Jan Engelhardt
2006-10-18 16:21 ` Matthew Wilcox
2006-10-18 5:42 ` [RFC] typechecking for get_unaligned/put_unaligned Dave Jones
2006-10-18 6:05 ` Al Viro
2006-10-19 16:52 ` Denis Vlasenko
2006-10-19 16:58 ` Al Viro
2006-10-17 9:04 ` David Howells
2006-10-17 15:28 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2006-10-30 10:45 dealing with excessive includes Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061020005337.GV29920@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=adobriyan@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).