Skip to content

Commit 0779f4a

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: remove XFS_IFINLINE
Just check for an inline format fork instead of the using the equivalent in-memory XFS_IFINLINE flag. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent ac1e067 commit 0779f4a

File tree

11 files changed

+18
-29
lines changed

11 files changed

+18
-29
lines changed

fs/xfs/libxfs/xfs_attr.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,8 @@ xfs_has_attr(
362362
if (!xfs_inode_hasattr(dp))
363363
return -ENOATTR;
364364

365-
if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) {
366-
ASSERT(dp->i_afp->if_flags & XFS_IFINLINE);
365+
if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL)
367366
return xfs_attr_sf_findname(args, NULL, NULL);
368-
}
369367

370368
if (xfs_attr_is_leaf(dp)) {
371369
error = xfs_attr_leaf_hasname(args, &bp);
@@ -389,10 +387,8 @@ xfs_attr_remove_args(
389387
if (!xfs_inode_hasattr(args->dp))
390388
return -ENOATTR;
391389

392-
if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) {
393-
ASSERT(args->dp->i_afp->if_flags & XFS_IFINLINE);
390+
if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL)
394391
return xfs_attr_shortform_remove(args);
395-
}
396392
if (xfs_attr_is_leaf(args->dp))
397393
return xfs_attr_leaf_removename(args);
398394
return xfs_attr_node_removename(args);

fs/xfs/libxfs/xfs_attr_leaf.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,6 @@ xfs_attr_shortform_create(
654654
if (ifp->if_format == XFS_DINODE_FMT_EXTENTS) {
655655
ifp->if_flags &= ~XFS_IFEXTENTS; /* just in case */
656656
ifp->if_format = XFS_DINODE_FMT_LOCAL;
657-
ifp->if_flags |= XFS_IFINLINE;
658-
} else {
659-
ASSERT(ifp->if_flags & XFS_IFINLINE);
660657
}
661658
xfs_idata_realloc(dp, sizeof(*hdr), XFS_ATTR_FORK);
662659
hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data;
@@ -733,7 +730,7 @@ xfs_attr_shortform_add(
733730
dp->i_forkoff = forkoff;
734731

735732
ifp = dp->i_afp;
736-
ASSERT(ifp->if_flags & XFS_IFINLINE);
733+
ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL);
737734
sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data;
738735
if (xfs_attr_sf_findname(args, &sfe, NULL) == -EEXIST)
739736
ASSERT(0);
@@ -851,7 +848,7 @@ xfs_attr_shortform_lookup(xfs_da_args_t *args)
851848
trace_xfs_attr_sf_lookup(args);
852849

853850
ifp = args->dp->i_afp;
854-
ASSERT(ifp->if_flags & XFS_IFINLINE);
851+
ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL);
855852
sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data;
856853
sfe = &sf->list[0];
857854
for (i = 0; i < sf->hdr.count;
@@ -878,7 +875,7 @@ xfs_attr_shortform_getvalue(
878875
struct xfs_attr_sf_entry *sfe;
879876
int i;
880877

881-
ASSERT(args->dp->i_afp->if_flags == XFS_IFINLINE);
878+
ASSERT(args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL);
882879
sf = (struct xfs_attr_shortform *)args->dp->i_afp->if_u1.if_data;
883880
sfe = &sf->list[0];
884881
for (i = 0; i < sf->hdr.count;

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,6 @@ xfs_bmap_local_to_extents_empty(
805805
ASSERT(ifp->if_nextents == 0);
806806

807807
xfs_bmap_forkoff_reset(ip, whichfork);
808-
ifp->if_flags &= ~XFS_IFINLINE;
809808
ifp->if_flags |= XFS_IFEXTENTS;
810809
ifp->if_u1.if_root = NULL;
811810
ifp->if_height = 0;
@@ -850,7 +849,7 @@ xfs_bmap_local_to_extents(
850849

851850
flags = 0;
852851
error = 0;
853-
ASSERT((ifp->if_flags & (XFS_IFINLINE|XFS_IFEXTENTS)) == XFS_IFINLINE);
852+
ASSERT(!(ifp->if_flags & XFS_IFEXTENTS));
854853
memset(&args, 0, sizeof(args));
855854
args.tp = tp;
856855
args.mp = ip->i_mount;

fs/xfs/libxfs/xfs_dir2_block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ xfs_dir2_sf_to_block(
10961096

10971097
trace_xfs_dir2_sf_to_block(args);
10981098

1099-
ASSERT(ifp->if_flags & XFS_IFINLINE);
1099+
ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL);
11001100
ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
11011101

11021102
oldsfp = (xfs_dir2_sf_hdr_t *)ifp->if_u1.if_data;

fs/xfs/libxfs/xfs_dir2_sf.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ xfs_dir2_sf_addname(
378378

379379
ASSERT(xfs_dir2_sf_lookup(args) == -ENOENT);
380380
dp = args->dp;
381-
ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
381+
ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
382382
ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
383383
ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
384384
ASSERT(dp->i_df.if_u1.if_data != NULL);
@@ -830,9 +830,8 @@ xfs_dir2_sf_create(
830830
dp->i_df.if_flags &= ~XFS_IFEXTENTS; /* just in case */
831831
dp->i_df.if_format = XFS_DINODE_FMT_LOCAL;
832832
xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE);
833-
dp->i_df.if_flags |= XFS_IFINLINE;
834833
}
835-
ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
834+
ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
836835
ASSERT(dp->i_df.if_bytes == 0);
837836
i8count = pino > XFS_DIR2_MAX_SHORT_INUM;
838837
size = xfs_dir2_sf_hdr_size(i8count);
@@ -877,7 +876,7 @@ xfs_dir2_sf_lookup(
877876

878877
xfs_dir2_sf_check(args);
879878

880-
ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
879+
ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
881880
ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
882881
ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
883882
ASSERT(dp->i_df.if_u1.if_data != NULL);
@@ -954,7 +953,7 @@ xfs_dir2_sf_removename(
954953

955954
trace_xfs_dir2_sf_removename(args);
956955

957-
ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
956+
ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
958957
oldsize = (int)dp->i_disk_size;
959958
ASSERT(oldsize >= offsetof(struct xfs_dir2_sf_hdr, parent));
960959
ASSERT(dp->i_df.if_bytes == oldsize);
@@ -1053,7 +1052,7 @@ xfs_dir2_sf_replace(
10531052

10541053
trace_xfs_dir2_sf_replace(args);
10551054

1056-
ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
1055+
ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
10571056
ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
10581057
ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
10591058
ASSERT(dp->i_df.if_u1.if_data != NULL);

fs/xfs/libxfs/xfs_inode_fork.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ xfs_init_local_fork(
6161

6262
ifp->if_bytes = size;
6363
ifp->if_flags &= ~XFS_IFEXTENTS;
64-
ifp->if_flags |= XFS_IFINLINE;
6564
}
6665

6766
/*

fs/xfs/libxfs/xfs_inode_fork.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ struct xfs_ifork {
3030
/*
3131
* Per-fork incore inode flags.
3232
*/
33-
#define XFS_IFINLINE 0x01 /* Inline data is read in */
3433
#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */
3534

3635
/*

fs/xfs/scrub/symlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ xchk_symlink(
5151
}
5252

5353
/* Inline symlink? */
54-
if (ifp->if_flags & XFS_IFINLINE) {
54+
if (ifp->if_format == XFS_DINODE_FMT_LOCAL) {
5555
if (len > XFS_IFORK_DSIZE(ip) ||
5656
len > strnlen(ifp->if_u1.if_data, XFS_IFORK_DSIZE(ip)))
5757
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);

fs/xfs/xfs_dir2_readdir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ xfs_dir2_sf_getdents(
5757
xfs_ino_t ino;
5858
struct xfs_da_geometry *geo = args->geo;
5959

60-
ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
60+
ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
6161
ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
6262
ASSERT(dp->i_df.if_u1.if_data != NULL);
6363

fs/xfs/xfs_iops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ xfs_vn_get_link_inline(
519519
struct xfs_inode *ip = XFS_I(inode);
520520
char *link;
521521

522-
ASSERT(ip->i_df.if_flags & XFS_IFINLINE);
522+
ASSERT(ip->i_df.if_format == XFS_DINODE_FMT_LOCAL);
523523

524524
/*
525525
* The VFS crashes on a NULL pointer, so return -EFSCORRUPTED if
@@ -1401,7 +1401,7 @@ xfs_setup_iops(
14011401
inode->i_fop = &xfs_dir_file_operations;
14021402
break;
14031403
case S_IFLNK:
1404-
if (ip->i_df.if_flags & XFS_IFINLINE)
1404+
if (ip->i_df.if_format == XFS_DINODE_FMT_LOCAL)
14051405
inode->i_op = &xfs_inline_symlink_inode_operations;
14061406
else
14071407
inode->i_op = &xfs_symlink_inode_operations;

0 commit comments

Comments
 (0)