]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - repair/dino_chunks.c
xfs_repair: fix incorrect return value in namecheck()
[thirdparty/xfsprogs-dev.git] / repair / dino_chunks.c
index 4db9512a2f1520aca8dbf0050d04e7839cd9289d..b4ede461805d981902f1b8996b3b358502f13f21 100644 (file)
@@ -1,19 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
  * All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include "libxfs.h"
@@ -689,7 +677,7 @@ process_inode_chunk(
 
                pftrace("readbuf %p (%llu, %d) in AG %d", bplist[bp_index],
                        (long long)XFS_BUF_ADDR(bplist[bp_index]),
-                       XFS_BUF_COUNT(bplist[bp_index]), agno);
+                       bplist[bp_index]->b_bcount, agno);
 
                bplist[bp_index]->b_ops = &xfs_inode_buf_ops;
 
@@ -826,8 +814,6 @@ next_readbuf:
                 * we do now, this is where to start.
                 */
                if (is_used)  {
-                       __uint16_t      di_mode;
-
                        if (is_inode_free(ino_rec, irec_offset))  {
                                if (verbose || no_modify)  {
                                        do_warn(
@@ -846,10 +832,8 @@ next_readbuf:
                         * store the on-disk file type for comparing in
                         * phase 6.
                         */
-                       di_mode = be16_to_cpu(dino->di_mode);
-                       di_mode = (di_mode & S_IFMT) >> S_SHIFT;
                        set_inode_ftype(ino_rec, irec_offset,
-                                       xfs_mode_to_ftype[di_mode]);
+                               libxfs_mode_to_ftype(be16_to_cpu(dino->di_mode)));
 
                        /*
                         * store on-disk nlink count for comparing in phase 7