Skip to content

Commit 0af2b37

Browse files
committed
iomap: Use iomap_punch_t typedef
It makes it much easier if we have iomap_punch_t typedef for "punch" function pointer in all delalloc related punch, scan and release functions. It will be useful in later patches when we will factor out iomap_write_delalloc_punch() function. Suggested-by: Matthew Wilcox <[email protected]> Signed-off-by: Ritesh Harjani (IBM) <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]>
1 parent eee2d2e commit 0af2b37

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

fs/iomap/buffered-io.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#define IOEND_BATCH_SIZE 4096
2525

26+
typedef int (*iomap_punch_t)(struct inode *inode, loff_t offset, loff_t length);
2627
/*
2728
* Structure allocated for each folio to track per-block uptodate state
2829
* and I/O completions.
@@ -901,7 +902,7 @@ EXPORT_SYMBOL_GPL(iomap_file_buffered_write);
901902
*/
902903
static int iomap_write_delalloc_scan(struct inode *inode,
903904
loff_t *punch_start_byte, loff_t start_byte, loff_t end_byte,
904-
int (*punch)(struct inode *inode, loff_t offset, loff_t length))
905+
iomap_punch_t punch)
905906
{
906907
while (start_byte < end_byte) {
907908
struct folio *folio;
@@ -979,8 +980,7 @@ static int iomap_write_delalloc_scan(struct inode *inode,
979980
* the code to subtle off-by-one bugs....
980981
*/
981982
static int iomap_write_delalloc_release(struct inode *inode,
982-
loff_t start_byte, loff_t end_byte,
983-
int (*punch)(struct inode *inode, loff_t pos, loff_t length))
983+
loff_t start_byte, loff_t end_byte, iomap_punch_t punch)
984984
{
985985
loff_t punch_start_byte = start_byte;
986986
loff_t scan_end_byte = min(i_size_read(inode), end_byte);
@@ -1073,8 +1073,7 @@ static int iomap_write_delalloc_release(struct inode *inode,
10731073
*/
10741074
int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
10751075
struct iomap *iomap, loff_t pos, loff_t length,
1076-
ssize_t written,
1077-
int (*punch)(struct inode *inode, loff_t pos, loff_t length))
1076+
ssize_t written, iomap_punch_t punch)
10781077
{
10791078
loff_t start_byte;
10801079
loff_t end_byte;

0 commit comments

Comments
 (0)