libxfs: resync with the userspace libxfs
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 16 Dec 2019 19:14:09 +0000 (11:14 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 19 Dec 2019 15:53:47 +0000 (07:53 -0800)
Prepare to resync the userspace libxfs with the kernel libxfs.  There
were a few things I missed -- a couple of static inline directory
functions that have to be exported for xfs_repair; a couple of directory
naming functions that make porting much easier if they're /not/ static
inline; and a u16 usage that should have been uint16_t.

None of these things are bugs in their own right; this just makes
porting xfsprogs easier.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_dir2.c
fs/xfs/libxfs/xfs_dir2_priv.h
fs/xfs/libxfs/xfs_dir2_sf.c

index 4a802b3abe77cef538df4c7ef39472eae78ffa68..4c2e046fbfaded8a22ffe2e17cf150eb9d27947a 100644 (file)
@@ -4561,7 +4561,7 @@ xfs_bmapi_convert_delalloc(
        struct xfs_mount        *mp = ip->i_mount;
        xfs_fileoff_t           offset_fsb = XFS_B_TO_FSBT(mp, offset);
        struct xfs_bmalloca     bma = { NULL };
-       u16                     flags = 0;
+       uint16_t                flags = 0;
        struct xfs_trans        *tp;
        int                     error;
 
index 0aa87cbde49e8819bfd8c7e0ec10edba585c4c7d..dd6fcaaea318a84e7fd999a8e412ae1161705894 100644 (file)
@@ -724,3 +724,24 @@ xfs_dir2_namecheck(
        /* There shouldn't be any slashes or nulls here */
        return !memchr(name, '/', length) && !memchr(name, 0, length);
 }
+
+xfs_dahash_t
+xfs_dir2_hashname(
+       struct xfs_mount        *mp,
+       struct xfs_name         *name)
+{
+       if (unlikely(xfs_sb_version_hasasciici(&mp->m_sb)))
+               return xfs_ascii_ci_hashname(name);
+       return xfs_da_hashname(name->name, name->len);
+}
+
+enum xfs_dacmp
+xfs_dir2_compname(
+       struct xfs_da_args      *args,
+       const unsigned char     *name,
+       int                     len)
+{
+       if (unlikely(xfs_sb_version_hasasciici(&args->dp->i_mount->m_sb)))
+               return xfs_ascii_ci_compname(args, name, len);
+       return xfs_da_compname(args, name, len);
+}
index c031c53d0f0d06798a66de7d7bb5621af32added..01ee0b9265721d52688ddcfff6a57f53deae400f 100644 (file)
@@ -175,6 +175,12 @@ extern int xfs_dir2_sf_lookup(struct xfs_da_args *args);
 extern int xfs_dir2_sf_removename(struct xfs_da_args *args);
 extern int xfs_dir2_sf_replace(struct xfs_da_args *args);
 extern xfs_failaddr_t xfs_dir2_sf_verify(struct xfs_inode *ip);
+int xfs_dir2_sf_entsize(struct xfs_mount *mp,
+               struct xfs_dir2_sf_hdr *hdr, int len);
+void xfs_dir2_sf_put_ino(struct xfs_mount *mp, struct xfs_dir2_sf_hdr *hdr,
+               struct xfs_dir2_sf_entry *sfep, xfs_ino_t ino);
+void xfs_dir2_sf_put_ftype(struct xfs_mount *mp,
+               struct xfs_dir2_sf_entry *sfep, uint8_t ftype);
 
 /* xfs_dir2_readdir.c */
 extern int xfs_readdir(struct xfs_trans *tp, struct xfs_inode *dp,
@@ -194,25 +200,8 @@ xfs_dir2_data_entsize(
        return round_up(len, XFS_DIR2_DATA_ALIGN);
 }
 
-static inline xfs_dahash_t
-xfs_dir2_hashname(
-       struct xfs_mount        *mp,
-       struct xfs_name         *name)
-{
-       if (unlikely(xfs_sb_version_hasasciici(&mp->m_sb)))
-               return xfs_ascii_ci_hashname(name);
-       return xfs_da_hashname(name->name, name->len);
-}
-
-static inline enum xfs_dacmp
-xfs_dir2_compname(
-       struct xfs_da_args      *args,
-       const unsigned char     *name,
-       int                     len)
-{
-       if (unlikely(xfs_sb_version_hasasciici(&args->dp->i_mount->m_sb)))
-               return xfs_ascii_ci_compname(args, name, len);
-       return xfs_da_compname(args, name, len);
-}
+xfs_dahash_t xfs_dir2_hashname(struct xfs_mount *mp, struct xfs_name *name);
+enum xfs_dacmp xfs_dir2_compname(struct xfs_da_args *args,
+               const unsigned char *name, int len);
 
 #endif /* __XFS_DIR2_PRIV_H__ */
index 8b94d33d232f5097fdce280bc22358c81f2446ad..7b7f6fb2ea3b2549f325b7a333cd59a9f6d91c05 100644 (file)
@@ -37,7 +37,7 @@ static void xfs_dir2_sf_check(xfs_da_args_t *args);
 static void xfs_dir2_sf_toino4(xfs_da_args_t *args);
 static void xfs_dir2_sf_toino8(xfs_da_args_t *args);
 
-static int
+int
 xfs_dir2_sf_entsize(
        struct xfs_mount        *mp,
        struct xfs_dir2_sf_hdr  *hdr,
@@ -84,7 +84,7 @@ xfs_dir2_sf_get_ino(
        return get_unaligned_be64(from) & XFS_MAXINUMBER;
 }
 
-static void
+void
 xfs_dir2_sf_put_ino(
        struct xfs_mount                *mp,
        struct xfs_dir2_sf_hdr          *hdr,
@@ -145,7 +145,7 @@ xfs_dir2_sf_get_ftype(
        return XFS_DIR3_FT_UNKNOWN;
 }
 
-static void
+void
 xfs_dir2_sf_put_ftype(
        struct xfs_mount        *mp,
        struct xfs_dir2_sf_entry *sfep,