Skip to content

Commit 044c644

Browse files
Brian FosterDarrick J. Wong
authored andcommitted
xfs: drop unused ioend private merge and setfilesize code
XFS no longer attaches anthing to ioend->io_private. Remove the unnecessary ->io_private merging code. This removes the only remaining user of xfs_setfilesize_ioend() so remove that function as well. Signed-off-by: Brian Foster <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 7adb8f1 commit 044c644

File tree

1 file changed

+1
-45
lines changed

1 file changed

+1
-45
lines changed

fs/xfs/xfs_aops.c

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -85,31 +85,6 @@ xfs_setfilesize(
8585
return __xfs_setfilesize(ip, tp, offset, size);
8686
}
8787

88-
STATIC int
89-
xfs_setfilesize_ioend(
90-
struct iomap_ioend *ioend,
91-
int error)
92-
{
93-
struct xfs_inode *ip = XFS_I(ioend->io_inode);
94-
struct xfs_trans *tp = ioend->io_private;
95-
96-
/*
97-
* The transaction may have been allocated in the I/O submission thread,
98-
* thus we need to mark ourselves as being in a transaction manually.
99-
* Similarly for freeze protection.
100-
*/
101-
xfs_trans_set_context(tp);
102-
__sb_writers_acquired(VFS_I(ip)->i_sb, SB_FREEZE_FS);
103-
104-
/* we abort the update if there was an IO error */
105-
if (error) {
106-
xfs_trans_cancel(tp);
107-
return error;
108-
}
109-
110-
return __xfs_setfilesize(ip, tp, ioend->io_offset, ioend->io_size);
111-
}
112-
11388
/*
11489
* IO write completion.
11590
*/
@@ -163,25 +138,6 @@ xfs_end_ioend(
163138
memalloc_nofs_restore(nofs_flag);
164139
}
165140

166-
/*
167-
* If the to be merged ioend has a preallocated transaction for file
168-
* size updates we need to ensure the ioend it is merged into also
169-
* has one. If it already has one we can simply cancel the transaction
170-
* as it is guaranteed to be clean.
171-
*/
172-
static void
173-
xfs_ioend_merge_private(
174-
struct iomap_ioend *ioend,
175-
struct iomap_ioend *next)
176-
{
177-
if (!ioend->io_private) {
178-
ioend->io_private = next->io_private;
179-
next->io_private = NULL;
180-
} else {
181-
xfs_setfilesize_ioend(next, -ECANCELED);
182-
}
183-
}
184-
185141
/* Finish all pending io completions. */
186142
void
187143
xfs_end_io(
@@ -201,7 +157,7 @@ xfs_end_io(
201157
while ((ioend = list_first_entry_or_null(&tmp, struct iomap_ioend,
202158
io_list))) {
203159
list_del_init(&ioend->io_list);
204-
iomap_ioend_try_merge(ioend, &tmp, xfs_ioend_merge_private);
160+
iomap_ioend_try_merge(ioend, &tmp, NULL);
205161
xfs_end_ioend(ioend);
206162
}
207163
}

0 commit comments

Comments
 (0)