[PATCH] ext3: uninline large functions
authorAndrew Morton <akpm@osdl.org>
Thu, 7 Dec 2006 04:37:14 +0000 (20:37 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Thu, 7 Dec 2006 16:39:35 +0000 (08:39 -0800)
Saves nearly 4kbytes on x86.

Cc: Arnaldo Carvalho de Melo <acme@mandriva.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ext3/Makefile
fs/ext3/ext3_jbd.c [new file with mode: 0644]
include/linux/ext3_jbd.h

index 704cd44a40c256e10ccc097aae36f35dd32309ab..e77766a8b3f07a8f3e37f7f66ce917b5e79ea061 100644 (file)
@@ -5,7 +5,7 @@
 obj-$(CONFIG_EXT3_FS) += ext3.o
 
 ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
-          ioctl.o namei.o super.o symlink.o hash.o resize.o
+          ioctl.o namei.o super.o symlink.o hash.o resize.o ext3_jbd.o
 
 ext3-$(CONFIG_EXT3_FS_XATTR)    += xattr.o xattr_user.o xattr_trusted.o
 ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
diff --git a/fs/ext3/ext3_jbd.c b/fs/ext3/ext3_jbd.c
new file mode 100644 (file)
index 0000000..e1f91fd
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Interface between ext3 and JBD
+ */
+
+#include <linux/ext3_jbd.h>
+
+int __ext3_journal_get_undo_access(const char *where, handle_t *handle,
+                               struct buffer_head *bh)
+{
+       int err = journal_get_undo_access(handle, bh);
+       if (err)
+               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+       return err;
+}
+
+int __ext3_journal_get_write_access(const char *where, handle_t *handle,
+                               struct buffer_head *bh)
+{
+       int err = journal_get_write_access(handle, bh);
+       if (err)
+               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+       return err;
+}
+
+int __ext3_journal_forget(const char *where, handle_t *handle,
+                               struct buffer_head *bh)
+{
+       int err = journal_forget(handle, bh);
+       if (err)
+               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+       return err;
+}
+
+int __ext3_journal_revoke(const char *where, handle_t *handle,
+                               unsigned long blocknr, struct buffer_head *bh)
+{
+       int err = journal_revoke(handle, blocknr, bh);
+       if (err)
+               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+       return err;
+}
+
+int __ext3_journal_get_create_access(const char *where,
+                               handle_t *handle, struct buffer_head *bh)
+{
+       int err = journal_get_create_access(handle, bh);
+       if (err)
+               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+       return err;
+}
+
+int __ext3_journal_dirty_metadata(const char *where,
+                               handle_t *handle, struct buffer_head *bh)
+{
+       int err = journal_dirty_metadata(handle, bh);
+       if (err)
+               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+       return err;
+}
index ce0e6109aff0cdb83e05cd350909da82b5a50d99..8c43b13a02fe1df033f161ab91d69cdd7a389858 100644 (file)
@@ -109,74 +109,32 @@ int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode);
  * been done yet.
  */
 
-void ext3_journal_abort_handle(const char *caller, const char *err_fn,
-               struct buffer_head *bh, handle_t *handle, int err);
-
-static inline int
-__ext3_journal_get_undo_access(const char *where, handle_t *handle,
-                               struct buffer_head *bh)
+static inline void ext3_journal_release_buffer(handle_t *handle,
+                                               struct buffer_head *bh)
 {
-       int err = journal_get_undo_access(handle, bh);
-       if (err)
-               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
-       return err;
+       journal_release_buffer(handle, bh);
 }
 
-static inline int
-__ext3_journal_get_write_access(const char *where, handle_t *handle,
-                               struct buffer_head *bh)
-{
-       int err = journal_get_write_access(handle, bh);
-       if (err)
-               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
-       return err;
-}
+void ext3_journal_abort_handle(const char *caller, const char *err_fn,
+               struct buffer_head *bh, handle_t *handle, int err);
 
-static inline void
-ext3_journal_release_buffer(handle_t *handle, struct buffer_head *bh)
-{
-       journal_release_buffer(handle, bh);
-}
+int __ext3_journal_get_undo_access(const char *where, handle_t *handle,
+                               struct buffer_head *bh);
 
-static inline int
-__ext3_journal_forget(const char *where, handle_t *handle, struct buffer_head *bh)
-{
-       int err = journal_forget(handle, bh);
-       if (err)
-               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
-       return err;
-}
+int __ext3_journal_get_write_access(const char *where, handle_t *handle,
+                               struct buffer_head *bh);
 
-static inline int
-__ext3_journal_revoke(const char *where, handle_t *handle,
-                     unsigned long blocknr, struct buffer_head *bh)
-{
-       int err = journal_revoke(handle, blocknr, bh);
-       if (err)
-               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
-       return err;
-}
+int __ext3_journal_forget(const char *where, handle_t *handle,
+                               struct buffer_head *bh);
 
-static inline int
-__ext3_journal_get_create_access(const char *where,
-                                handle_t *handle, struct buffer_head *bh)
-{
-       int err = journal_get_create_access(handle, bh);
-       if (err)
-               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
-       return err;
-}
+int __ext3_journal_revoke(const char *where, handle_t *handle,
+                               unsigned long blocknr, struct buffer_head *bh);
 
-static inline int
-__ext3_journal_dirty_metadata(const char *where,
-                             handle_t *handle, struct buffer_head *bh)
-{
-       int err = journal_dirty_metadata(handle, bh);
-       if (err)
-               ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
-       return err;
-}
+int __ext3_journal_get_create_access(const char *where,
+                               handle_t *handle, struct buffer_head *bh);
 
+int __ext3_journal_dirty_metadata(const char *where,
+                               handle_t *handle, struct buffer_head *bh);
 
 #define ext3_journal_get_undo_access(handle, bh) \
        __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh))