mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
netfs: Defer the emission of trace_netfs_folio()
Change netfs_perform_write() to keep the netfs_folio trace value in a variable and emit it later to make it easier to choose the value displayed. This is a prerequisite for a subsequent patch. Closes: https://sashiko.dev/#/patchset/20260414082004.3756080-1-dhowells%40redhat.com Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260512123404.719402-13-dhowells@redhat.com cc: Paulo Alcantara <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
156ac2ec2e
commit
daeb443b92
|
|
@ -149,6 +149,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
}
|
||||
|
||||
do {
|
||||
enum netfs_folio_trace trace;
|
||||
struct netfs_folio *finfo;
|
||||
struct netfs_group *group;
|
||||
unsigned long long fpos;
|
||||
|
|
@ -222,7 +223,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
if (unlikely(copied == 0))
|
||||
goto copy_failed;
|
||||
netfs_set_group(folio, netfs_group);
|
||||
trace_netfs_folio(folio, netfs_folio_is_uptodate);
|
||||
trace = netfs_folio_is_uptodate;
|
||||
goto copied;
|
||||
}
|
||||
|
||||
|
|
@ -238,7 +239,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
folio_zero_segment(folio, offset + copied, flen);
|
||||
__netfs_set_group(folio, netfs_group);
|
||||
folio_mark_uptodate(folio);
|
||||
trace_netfs_folio(folio, netfs_modify_and_clear);
|
||||
trace = netfs_modify_and_clear;
|
||||
goto copied;
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +257,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
}
|
||||
__netfs_set_group(folio, netfs_group);
|
||||
folio_mark_uptodate(folio);
|
||||
trace_netfs_folio(folio, netfs_whole_folio_modify);
|
||||
trace = netfs_whole_folio_modify;
|
||||
goto copied;
|
||||
}
|
||||
|
||||
|
|
@ -283,7 +284,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
if (unlikely(copied == 0))
|
||||
goto copy_failed;
|
||||
netfs_set_group(folio, netfs_group);
|
||||
trace_netfs_folio(folio, netfs_just_prefetch);
|
||||
trace = netfs_just_prefetch;
|
||||
goto copied;
|
||||
}
|
||||
|
||||
|
|
@ -297,7 +298,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
if (offset == 0 && copied == flen) {
|
||||
__netfs_set_group(folio, netfs_group);
|
||||
folio_mark_uptodate(folio);
|
||||
trace_netfs_folio(folio, netfs_streaming_filled_page);
|
||||
trace = netfs_streaming_filled_page;
|
||||
goto copied;
|
||||
}
|
||||
|
||||
|
|
@ -312,7 +313,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
finfo->dirty_len = copied;
|
||||
folio_attach_private(folio, (void *)((unsigned long)finfo |
|
||||
NETFS_FOLIO_INFO));
|
||||
trace_netfs_folio(folio, netfs_streaming_write);
|
||||
trace = netfs_streaming_write;
|
||||
goto copied;
|
||||
}
|
||||
|
||||
|
|
@ -332,9 +333,9 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
folio_detach_private(folio);
|
||||
folio_mark_uptodate(folio);
|
||||
kfree(finfo);
|
||||
trace_netfs_folio(folio, netfs_streaming_cont_filled_page);
|
||||
trace = netfs_streaming_cont_filled_page;
|
||||
} else {
|
||||
trace_netfs_folio(folio, netfs_streaming_write_cont);
|
||||
trace = netfs_streaming_write_cont;
|
||||
}
|
||||
goto copied;
|
||||
}
|
||||
|
|
@ -350,6 +351,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
|
|||
continue;
|
||||
|
||||
copied:
|
||||
trace_netfs_folio(folio, trace);
|
||||
flush_dcache_folio(folio);
|
||||
|
||||
/* Update the inode size if we moved the EOF marker */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user