]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge master.kernel.org:/home/rmk/linux-2.6-arm
authorLinus Torvalds <torvalds@g5.osdl.org>
Thu, 16 Mar 2006 02:17:11 +0000 (18:17 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 16 Mar 2006 02:17:11 +0000 (18:17 -0800)
* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 3362/1: [cleanup] - duplicate decleration of mem_fclk_21285
  [ARM] 3365/1: [cleanup] header for compat.c exported functions
  [ARM] 3364/1: [cleanup] warning fix - definitions for enable_hlt and disable_hlt
  [ARM] 3363/1: [cleanup] process.c - fix warnings
  [ARM] 3358/1: [S3C2410] add missing SPI DMA resources
  [ARM] 3357/1: enable frontlight on collie
  [ARM] Fix "thead" typo

fs/ext2/dir.c
fs/namespace.c

index 7442bdd1267a48da409f0f813113b04c6f9ae1a6..b3dbd716cd3a19b537c87b88048cd54ee43d7e50 100644 (file)
@@ -256,11 +256,10 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
        unsigned long npages = dir_pages(inode);
        unsigned chunk_mask = ~(ext2_chunk_size(inode)-1);
        unsigned char *types = NULL;
-       int need_revalidate = (filp->f_version != inode->i_version);
-       int ret;
+       int need_revalidate = filp->f_version != inode->i_version;
 
        if (pos > inode->i_size - EXT2_DIR_REC_LEN(1))
-               goto success;
+               return 0;
 
        if (EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE))
                types = ext2_filetype_table;
@@ -275,12 +274,15 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
                                   "bad page in #%lu",
                                   inode->i_ino);
                        filp->f_pos += PAGE_CACHE_SIZE - offset;
-                       ret = -EIO;
-                       goto done;
+                       return -EIO;
                }
                kaddr = page_address(page);
-               if (need_revalidate) {
-                       offset = ext2_validate_entry(kaddr, offset, chunk_mask);
+               if (unlikely(need_revalidate)) {
+                       if (offset) {
+                               offset = ext2_validate_entry(kaddr, offset, chunk_mask);
+                               filp->f_pos = (n<<PAGE_CACHE_SHIFT) + offset;
+                       }
+                       filp->f_version = inode->i_version;
                        need_revalidate = 0;
                }
                de = (ext2_dirent *)(kaddr+offset);
@@ -289,9 +291,8 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
                        if (de->rec_len == 0) {
                                ext2_error(sb, __FUNCTION__,
                                        "zero-length directory entry");
-                               ret = -EIO;
                                ext2_put_page(page);
-                               goto done;
+                               return -EIO;
                        }
                        if (de->inode) {
                                int over;
@@ -306,19 +307,14 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
                                                le32_to_cpu(de->inode), d_type);
                                if (over) {
                                        ext2_put_page(page);
-                                       goto success;
+                                       return 0;
                                }
                        }
                        filp->f_pos += le16_to_cpu(de->rec_len);
                }
                ext2_put_page(page);
        }
-
-success:
-       ret = 0;
-done:
-       filp->f_version = inode->i_version;
-       return ret;
+       return 0;
 }
 
 /*
index 058a44865bebdad95cb9416eefcedd1dd1473c25..39c81a8d6316aee918d618f61ff4e4d400e70977 100644 (file)
@@ -1338,7 +1338,7 @@ struct namespace *dup_namespace(struct task_struct *tsk, struct fs_struct *fs)
 
        new_ns = kmalloc(sizeof(struct namespace), GFP_KERNEL);
        if (!new_ns)
-               goto out;
+               return NULL;
 
        atomic_set(&new_ns->count, 1);
        INIT_LIST_HEAD(&new_ns->list);
@@ -1352,7 +1352,7 @@ struct namespace *dup_namespace(struct task_struct *tsk, struct fs_struct *fs)
        if (!new_ns->root) {
                up_write(&namespace_sem);
                kfree(new_ns);
-               goto out;
+               return NULL;
        }
        spin_lock(&vfsmount_lock);
        list_add_tail(&new_ns->list, &new_ns->root->mnt_list);
@@ -1393,7 +1393,6 @@ struct namespace *dup_namespace(struct task_struct *tsk, struct fs_struct *fs)
        if (altrootmnt)
                mntput(altrootmnt);
 
-out:
        return new_ns;
 }