[Top] [All Lists]

[PATCH 38/49] xfs: remove __KERNEL__ check from xfs_dir2_leaf.c

To: xfs@xxxxxxxxxxx
Subject: [PATCH 38/49] xfs: remove __KERNEL__ check from xfs_dir2_leaf.c
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 19 Jul 2013 16:45:13 +1000
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1374216324-8781-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1374216324-8781-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

It's actually an ifndef section, which means it is only included in
userspace. however, it's deep within the libxfs code, so it's
unlikely that the condition checked in userspace can actually occur
(search an empty leaf) through the libxfs interfaces. i.e. if it can
happen in usrspace, it can happen in the kernel, so remove it from
userspace too....

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
 libxfs/xfs_dir2_leaf.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libxfs/xfs_dir2_leaf.c b/libxfs/xfs_dir2_leaf.c
index 8c20b9e..55b7d05 100644
--- a/libxfs/xfs_dir2_leaf.c
+++ b/libxfs/xfs_dir2_leaf.c
@@ -1568,10 +1568,6 @@ xfs_dir2_leaf_search_hash(
        ents = xfs_dir3_leaf_ents_p(leaf);
        xfs_dir3_leaf_hdr_from_disk(&leafhdr, leaf);
-#ifndef __KERNEL__
-       if (!leafhdr.count)
-               return 0;
         * Note, the table cannot be empty, so we have to go through the loop.
         * Binary search the leaf entries looking for our hash value.

<Prev in Thread] Current Thread [Next in Thread>