tree ac5dbf60deb2b97ec3cc0f0278da24efecacef21
parent 1ca70351af02b1f0eb9cd2e7eb7a547f8ad5d893
author Artem B. Bityuckiy <[EMAIL PROTECTED]> Thu, 07 Jul 2005 16:45:32 +0100
committer Thomas Gleixner <[EMAIL PROTECTED]> Tue, 12 Jul 2005 23:55:05 +0200

[JFFS2] Avoid alloc/dealloc for zero sized nodes

Signed-off-by: Artem B. Bityuckiy <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 fs/jffs2/readinode.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: readinode.c,v 1.120 2005/07/05 21:03:07 dwmw2 Exp $
+ * $Id: readinode.c,v 1.124 2005/07/07 15:45:29 dedekind Exp $
  *
  */
 
@@ -151,6 +151,9 @@ int jffs2_add_full_dnode_to_inode(struct
 
        D1(printk(KERN_DEBUG "jffs2_add_full_dnode_to_inode(ino #%u, f %p, fn 
%p)\n", f->inocache->ino, f, fn));
 
+       if (unlikely(!fn->size))
+               return 0;
+
        newfrag = jffs2_alloc_node_frag();
        if (unlikely(!newfrag))
                return -ENOMEM;
@@ -158,11 +161,6 @@ int jffs2_add_full_dnode_to_inode(struct
        D2(printk(KERN_DEBUG "adding node %04x-%04x @0x%08x on flash, newfrag 
*%p\n",
                  fn->ofs, fn->ofs+fn->size, ref_offset(fn->raw), newfrag));
        
-       if (unlikely(!fn->size)) {
-               jffs2_free_node_frag(newfrag);
-               return 0;
-       }
-
        newfrag->ofs = fn->ofs;
        newfrag->size = fn->size;
        newfrag->node = fn;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to