Skip to contentSkip to conversation

severing fs.h, radix-tree.h -> sched.h

PATCH In review Al Viro 3 participants 3 messages Oct 30, 2006 – Oct 31, 2006

Subsystems (11)
lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 2/7 severing fs.h, radix-tree.h -> sched.h

---
 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(-)
arch/i386/kernel/acpi/cstate.c +1 -0
index 20563e5..4664b55 100644
@@ -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>
drivers/acpi/dock.c +1 -0
index 578b99b..bf5b79e 100644
@@ -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>
 
drivers/char/hw_random/core.c +1 -0
index 154a81d..b8c9417 100644
@@ -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>
drivers/char/tpm/tpm.h +1 -0
index 050ced2..bb9a43c 100644
@@ -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>
drivers/hwmon/hdaps.c +1 -0
index 26be4ea..e8ef62b 100644
@@ -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 */
drivers/spi/spi_butterfly.c +1 -0
index 39d9b20..c2f601f 100644
@@ -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>
fs/9p/conv.c +1 -0
index 56d88c1..a3ed571 100644
@@ -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"
fs/9p/fcall.c +1 -0
index 8556097..dc336a6 100644
@@ -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"
fs/9p/fid.c +1 -0
index 70492cc..2750720 100644
@@ -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"
fs/9p/v9fs.c +1 -0
index 0f62804..0b96fae 100644
@@ -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>
 
fs/9p/vfs_dir.c +1 -0
index e32d597..905c882 100644
@@ -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>
 
fs/9p/vfs_file.c +1 -0
index c3c47ed..79e6f9c 100644
@@ -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>
fs/inotify.c +1 -0
index 723836a..f5099d8 100644
@@ -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>
fs/jffs2/acl.c +1 -0
index 0ae3cd1..73f0d60 100644
@@ -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>
fs/jffs2/wbuf.c +1 -0
index b9b7007..7070730 100644
@@ -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"
 
fs/jfs/ioctl.c +1 -0
index 37db524..ed814b1 100644
@@ -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>
 
fs/proc/root.c +1 -0
index ffe66c3..64d242b 100644
@@ -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>
fs/super.c +18 -0
index 47e554c..84c320f 100644
@@ -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
fs/sync.c +1 -0
index 1de747b..865f32b 100644
@@ -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>
fs/utimes.c +1 -0
index 1bcd852..99cf2cb 100644
@@ -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>
include/linux/fs.h +7 -30
index 2fe6e3f..cac7b1e 100644
@@ -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>
@@ -977,36 +977,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(&current->fs_excl);
-}
-
-static inline void put_fs_excl(void)
-{
-	atomic_dec(&current->fs_excl);
-}
-
-static inline int has_fs_excl(void)
-{
-	return atomic_read(&current->fs_excl);
-}
+#define get_fs_excl() atomic_inc(&current->fs_excl)
+#define put_fs_excl() atomic_dec(&current->fs_excl)
+#define has_fs_excl() atomic_read(&current->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..
include/linux/radix-tree.h +0 -1
index 9158a68..cbfa115 100644
@@ -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>
 
Signature · 1 line
1.4.2.GIT
#1 lore raw

Trivial comment:

Quoted 7 lines

/*
+ * Superblock locking. We really ought to get rid of these two.
+ */

fs/super.c +4 -0
+void lock_super(struct super_block * sb)
+{
+	get_fs_excl();
+	mutex_lock(&sb->s_lock);

fs/super.c static int grab_super(struct super_block · line 239

Quoted 10 lines
fs/super.c +10 -0
+}
+
+void unlock_super(struct super_block * sb)
+{
+	put_fs_excl();
+	mutex_unlock(&sb->s_lock);
+}
+
+EXPORT_SYMBOL(lock_super);
+EXPORT_SYMBOL(unlock_super);

isn't the current fashion to do this like:

void lock_super(struct super_block * sb)

{
	get_fs_excl();
	mutex_lock(&sb->s_lock);
}

EXPORT_SYMBOL(lock_super);

void unlock_super(struct super_block * sb)

{
	put_fs_excl();
	mutex_unlock(&sb->s_lock);
}

EXPORT_SYMBOL(unlock_super);

#2 lore raw
Quoted 11 lines

fs/super.c static int grab_super(struct super_block · line 239

Quoted 3 lines
fs/super.c +2 -0
+EXPORT_SYMBOL(lock_super);
+EXPORT_SYMBOL(unlock_super);

isn't the current fashion to do this like:

void lock_super(struct super_block * sb)

{
	get_fs_excl();
	mutex_lock(&sb->s_lock);
}
Quoted 8 lines

EXPORT_SYMBOL(lock_super);

void unlock_super(struct super_block * sb)

{
	put_fs_excl();
	mutex_unlock(&sb->s_lock);
}

EXPORT_SYMBOL(unlock_super);

Seems to be a draw:

fs$ grep -nr EXPORT . ./dcache.c:2113:EXPORT_SYMBOL(d_move); ./dcache.c:2114:EXPORT_SYMBOL_GPL(d_materialise_unique); ./dcache.c:2115:EXPORT_SYMBOL(d_path); ./dcache.c:2116:EXPORT_SYMBOL(d_prune_aliases); ./dcache.c:2117:EXPORT_SYMBOL(d_rehash); ./dcache.c:2118:EXPORT_SYMBOL(d_splice_alias); ./dcache.c:2119:EXPORT_SYMBOL(d_validate);

vs

./debugfs/file.c:86:EXPORT_SYMBOL_GPL(debugfs_create_u8); ./debugfs/file.c:127:EXPORT_SYMBOL_GPL(debugfs_create_u16); ./debugfs/file.c:168:EXPORT_SYMBOL_GPL(debugfs_create_u32); ./debugfs/file.c:247:EXPORT_SYMBOL_GPL(debugfs_create_bool); ./debugfs/file.c:292:EXPORT_SYMBOL_GPL(debugfs_create_blob);

	-`J'