Skip to content

Commit af952ae

Browse files
committed
libxfs: resync with the userspace libxfs
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 <[email protected]> Reviewed-by: Eric Sandeen <[email protected]>
1 parent 826f7e3 commit af952ae

File tree

4 files changed

+34
-24
lines changed

4 files changed

+34
-24
lines changed

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4561,7 +4561,7 @@ xfs_bmapi_convert_delalloc(
45614561
struct xfs_mount *mp = ip->i_mount;
45624562
xfs_fileoff_t offset_fsb = XFS_B_TO_FSBT(mp, offset);
45634563
struct xfs_bmalloca bma = { NULL };
4564-
u16 flags = 0;
4564+
uint16_t flags = 0;
45654565
struct xfs_trans *tp;
45664566
int error;
45674567

fs/xfs/libxfs/xfs_dir2.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,3 +724,24 @@ xfs_dir2_namecheck(
724724
/* There shouldn't be any slashes or nulls here */
725725
return !memchr(name, '/', length) && !memchr(name, 0, length);
726726
}
727+
728+
xfs_dahash_t
729+
xfs_dir2_hashname(
730+
struct xfs_mount *mp,
731+
struct xfs_name *name)
732+
{
733+
if (unlikely(xfs_sb_version_hasasciici(&mp->m_sb)))
734+
return xfs_ascii_ci_hashname(name);
735+
return xfs_da_hashname(name->name, name->len);
736+
}
737+
738+
enum xfs_dacmp
739+
xfs_dir2_compname(
740+
struct xfs_da_args *args,
741+
const unsigned char *name,
742+
int len)
743+
{
744+
if (unlikely(xfs_sb_version_hasasciici(&args->dp->i_mount->m_sb)))
745+
return xfs_ascii_ci_compname(args, name, len);
746+
return xfs_da_compname(args, name, len);
747+
}

fs/xfs/libxfs/xfs_dir2_priv.h

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ extern int xfs_dir2_sf_lookup(struct xfs_da_args *args);
175175
extern int xfs_dir2_sf_removename(struct xfs_da_args *args);
176176
extern int xfs_dir2_sf_replace(struct xfs_da_args *args);
177177
extern xfs_failaddr_t xfs_dir2_sf_verify(struct xfs_inode *ip);
178+
int xfs_dir2_sf_entsize(struct xfs_mount *mp,
179+
struct xfs_dir2_sf_hdr *hdr, int len);
180+
void xfs_dir2_sf_put_ino(struct xfs_mount *mp, struct xfs_dir2_sf_hdr *hdr,
181+
struct xfs_dir2_sf_entry *sfep, xfs_ino_t ino);
182+
void xfs_dir2_sf_put_ftype(struct xfs_mount *mp,
183+
struct xfs_dir2_sf_entry *sfep, uint8_t ftype);
178184

179185
/* xfs_dir2_readdir.c */
180186
extern int xfs_readdir(struct xfs_trans *tp, struct xfs_inode *dp,
@@ -194,25 +200,8 @@ xfs_dir2_data_entsize(
194200
return round_up(len, XFS_DIR2_DATA_ALIGN);
195201
}
196202

197-
static inline xfs_dahash_t
198-
xfs_dir2_hashname(
199-
struct xfs_mount *mp,
200-
struct xfs_name *name)
201-
{
202-
if (unlikely(xfs_sb_version_hasasciici(&mp->m_sb)))
203-
return xfs_ascii_ci_hashname(name);
204-
return xfs_da_hashname(name->name, name->len);
205-
}
206-
207-
static inline enum xfs_dacmp
208-
xfs_dir2_compname(
209-
struct xfs_da_args *args,
210-
const unsigned char *name,
211-
int len)
212-
{
213-
if (unlikely(xfs_sb_version_hasasciici(&args->dp->i_mount->m_sb)))
214-
return xfs_ascii_ci_compname(args, name, len);
215-
return xfs_da_compname(args, name, len);
216-
}
203+
xfs_dahash_t xfs_dir2_hashname(struct xfs_mount *mp, struct xfs_name *name);
204+
enum xfs_dacmp xfs_dir2_compname(struct xfs_da_args *args,
205+
const unsigned char *name, int len);
217206

218207
#endif /* __XFS_DIR2_PRIV_H__ */

fs/xfs/libxfs/xfs_dir2_sf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static void xfs_dir2_sf_check(xfs_da_args_t *args);
3737
static void xfs_dir2_sf_toino4(xfs_da_args_t *args);
3838
static void xfs_dir2_sf_toino8(xfs_da_args_t *args);
3939

40-
static int
40+
int
4141
xfs_dir2_sf_entsize(
4242
struct xfs_mount *mp,
4343
struct xfs_dir2_sf_hdr *hdr,
@@ -84,7 +84,7 @@ xfs_dir2_sf_get_ino(
8484
return get_unaligned_be64(from) & XFS_MAXINUMBER;
8585
}
8686

87-
static void
87+
void
8888
xfs_dir2_sf_put_ino(
8989
struct xfs_mount *mp,
9090
struct xfs_dir2_sf_hdr *hdr,
@@ -145,7 +145,7 @@ xfs_dir2_sf_get_ftype(
145145
return XFS_DIR3_FT_UNKNOWN;
146146
}
147147

148-
static void
148+
void
149149
xfs_dir2_sf_put_ftype(
150150
struct xfs_mount *mp,
151151
struct xfs_dir2_sf_entry *sfep,

0 commit comments

Comments
 (0)