OSDN Git Service

staging: lustre: llite: remove code never called
authorwang di <di.wang@intel.com>
Fri, 22 Jul 2016 02:44:09 +0000 (22:44 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Aug 2016 16:31:06 +0000 (18:31 +0200)
We have if (1) conditionals which is pointless so remove
it and the next code block is never called so remove that
as well.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/dir.c
drivers/staging/lustre/lustre/llite/statahead.c

index 907fae4..2307e70 100644 (file)
@@ -576,7 +576,7 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
                         */
                        done = 1;
                        ll_release_page(page, 0);
-               } else if (1 /* chain is exhausted*/) {
+               } else {
                        /*
                         * Normal case: continue to the next
                         * page.
@@ -587,13 +587,6 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
                        next = pos;
                        page = ll_get_dir_page(inode, pos,
                                               &chain);
-               } else {
-                       /*
-                        * go into overflow page.
-                        */
-                       LASSERT(le32_to_cpu(dp->ldp_flags) &
-                               LDF_COLLIDE);
-                       ll_release_page(page, 1);
                }
        }
 
index b1994a7..df51f14 100644 (file)
@@ -1224,7 +1224,7 @@ do_it:
 
                        rc = 0;
                        goto out;
-               } else if (1) {
+               } else {
                        /*
                         * chain is exhausted.
                         * Normal case: continue to the next page.
@@ -1232,12 +1232,6 @@ do_it:
                        ll_release_page(page, le32_to_cpu(dp->ldp_flags) &
                                              LDF_COLLIDE);
                        page = ll_get_dir_page(dir, pos, &chain);
-               } else {
-                       LASSERT(le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE);
-                       ll_release_page(page, 1);
-                       /*
-                        * go into overflow page.
-                        */
                }
        }
 
@@ -1434,8 +1428,8 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
                         * End of directory reached.
                         */
                        ll_release_page(page, 0);
-                       break;
-               } else if (1) {
+                       goto out;
+               } else {
                        /*
                         * chain is exhausted
                         * Normal case: continue to the next page.
@@ -1443,12 +1437,6 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
                        ll_release_page(page, le32_to_cpu(dp->ldp_flags) &
                                              LDF_COLLIDE);
                        page = ll_get_dir_page(dir, pos, &chain);
-               } else {
-                       /*
-                        * go into overflow page.
-                        */
-                       LASSERT(le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE);
-                       ll_release_page(page, 1);
                }
        }