Skip to content

Commit 2268419

Browse files
committed
Merge tag 'xfs-5.4-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fixes from Darrick Wong: "There are a couple of bug fixes and some small code cleanups that came in recently: - Minor code cleanups - Fix a superblock logging error - Ensure that collapse range converts the data fork to extents format when necessary - Revert the ALLOC_USERDATA cleanup because it caused subtle behavior regressions" * tag 'xfs-5.4-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: avoid unused to_mp() function warning xfs: log proper length of superblock xfs: revert 1baa280 ("xfs: remove the unused XFS_ALLOC_USERDATA flag") xfs: removed unneeded variable xfs: convert inode to extent format after extent merge due to shift
2 parents dadedd8 + 88d32d3 commit 2268419

File tree

5 files changed

+17
-21
lines changed

5 files changed

+17
-21
lines changed

fs/xfs/libxfs/xfs_alloc.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ typedef struct xfs_alloc_arg {
8181
/*
8282
* Defines for datatype
8383
*/
84-
#define XFS_ALLOC_INITIAL_USER_DATA (1 << 0)/* special case start of file */
85-
#define XFS_ALLOC_USERDATA_ZERO (1 << 1)/* zero extent on allocation */
86-
#define XFS_ALLOC_NOBUSY (1 << 2)/* Busy extents not allowed */
84+
#define XFS_ALLOC_USERDATA (1 << 0)/* allocation is for user data*/
85+
#define XFS_ALLOC_INITIAL_USER_DATA (1 << 1)/* special case start of file */
86+
#define XFS_ALLOC_USERDATA_ZERO (1 << 2)/* zero extent on allocation */
87+
#define XFS_ALLOC_NOBUSY (1 << 3)/* Busy extents not allowed */
8788

8889
static inline bool
8990
xfs_alloc_is_userdata(int datatype)

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4042,8 +4042,12 @@ xfs_bmapi_allocate(
40424042
*/
40434043
if (!(bma->flags & XFS_BMAPI_METADATA)) {
40444044
bma->datatype = XFS_ALLOC_NOBUSY;
4045-
if (whichfork == XFS_DATA_FORK && bma->offset == 0)
4046-
bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA;
4045+
if (whichfork == XFS_DATA_FORK) {
4046+
if (bma->offset == 0)
4047+
bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA;
4048+
else
4049+
bma->datatype |= XFS_ALLOC_USERDATA;
4050+
}
40474051
if (bma->flags & XFS_BMAPI_ZERO)
40484052
bma->datatype |= XFS_ALLOC_USERDATA_ZERO;
40494053
}
@@ -5621,6 +5625,11 @@ xfs_bmse_merge(
56215625
if (error)
56225626
return error;
56235627

5628+
/* change to extent format if required after extent removal */
5629+
error = xfs_bmap_btree_to_extents(tp, ip, cur, logflags, whichfork);
5630+
if (error)
5631+
return error;
5632+
56245633
done:
56255634
xfs_iext_remove(ip, icur, 0);
56265635
xfs_iext_prev(XFS_IFORK_PTR(ip, whichfork), icur);

fs/xfs/libxfs/xfs_sb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ xfs_log_sb(
928928

929929
xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb);
930930
xfs_trans_buf_set_type(tp, bp, XFS_BLFT_SB_BUF);
931-
xfs_trans_log_buf(tp, bp, 0, sizeof(struct xfs_dsb));
931+
xfs_trans_log_buf(tp, bp, 0, sizeof(struct xfs_dsb) - 1);
932932
}
933933

934934
/*

fs/xfs/scrub/alloc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ xchk_allocbt_rec(
9797
xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
9898
xfs_agblock_t bno;
9999
xfs_extlen_t len;
100-
int error = 0;
101100

102101
bno = be32_to_cpu(rec->alloc.ar_startblock);
103102
len = be32_to_cpu(rec->alloc.ar_blockcount);
@@ -109,7 +108,7 @@ xchk_allocbt_rec(
109108

110109
xchk_allocbt_xref(bs->sc, bno, len);
111110

112-
return error;
111+
return 0;
113112
}
114113

115114
/* Scrub the freespace btrees for some AG. */

fs/xfs/xfs_sysfs.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,6 @@ static const struct sysfs_ops xfs_sysfs_ops = {
6363
.store = xfs_sysfs_object_store,
6464
};
6565

66-
/*
67-
* xfs_mount kobject. The mp kobject also serves as the per-mount parent object
68-
* that is identified by the fsname under sysfs.
69-
*/
70-
71-
static inline struct xfs_mount *
72-
to_mp(struct kobject *kobject)
73-
{
74-
struct xfs_kobj *kobj = to_kobj(kobject);
75-
76-
return container_of(kobj, struct xfs_mount, m_kobj);
77-
}
78-
7966
static struct attribute *xfs_mp_attrs[] = {
8067
NULL,
8168
};

0 commit comments

Comments
 (0)