@@ -113,7 +113,14 @@ static int simplefs_writepage(struct page *page, struct writeback_control *wbc)
113
113
* the data into the page cache. This function checks if the write operation
114
114
* can complete and allocates the necessary blocks through block_write_begin().
115
115
*/
116
- #if SIMPLEFS_AT_LEAST (5 , 19 , 0 )
116
+ #if SIMPLEFS_AT_LEAST (6 , 12 , 0 )
117
+ static int simplefs_write_begin (struct file * file ,
118
+ struct address_space * mapping ,
119
+ loff_t pos ,
120
+ unsigned int len ,
121
+ struct folio * * foliop ,
122
+ void * * fsdata )
123
+ #elif SIMPLEFS_AT_LEAST (5 , 19 , 0 )
117
124
static int simplefs_write_begin (struct file * file ,
118
125
struct address_space * mapping ,
119
126
loff_t pos ,
@@ -147,7 +154,9 @@ static int simplefs_write_begin(struct file *file,
147
154
return - ENOSPC ;
148
155
149
156
/* prepare the write */
150
- #if SIMPLEFS_AT_LEAST (5 , 19 , 0 )
157
+ #if SIMPLEFS_AT_LEAST (6 , 12 , 0 )
158
+ err = block_write_begin (mapping , pos , len , foliop , simplefs_file_get_block );
159
+ #elif SIMPLEFS_AT_LEAST (5 , 19 , 0 )
151
160
err = block_write_begin (mapping , pos , len , pagep , simplefs_file_get_block );
152
161
#else
153
162
err = block_write_begin (mapping , pos , len , flags , pagep ,
@@ -163,13 +172,23 @@ static int simplefs_write_begin(struct file *file,
163
172
* cache. This function updates inode metadata and truncates the file if
164
173
* necessary.
165
174
*/
175
+ #if SIMPLEFS_AT_LEAST (6 , 12 , 0 )
176
+ static int simplefs_write_end (struct file * file ,
177
+ struct address_space * mapping ,
178
+ loff_t pos ,
179
+ unsigned int len ,
180
+ unsigned int copied ,
181
+ struct folio * foliop ,
182
+ void * fsdata )
183
+ #else
166
184
static int simplefs_write_end (struct file * file ,
167
185
struct address_space * mapping ,
168
186
loff_t pos ,
169
187
unsigned int len ,
170
188
unsigned int copied ,
171
189
struct page * page ,
172
190
void * fsdata )
191
+ #endif
173
192
{
174
193
struct inode * inode = file -> f_inode ;
175
194
struct simplefs_inode_info * ci = SIMPLEFS_INODE (inode );
@@ -180,7 +199,12 @@ static int simplefs_write_end(struct file *file,
180
199
uint32_t nr_blocks_old ;
181
200
182
201
/* Complete the write() */
202
+ #if SIMPLEFS_AT_LEAST (6 , 12 , 0 )
203
+ int ret =
204
+ generic_write_end (file , mapping , pos , len , copied , foliop , fsdata );
205
+ #else
183
206
int ret = generic_write_end (file , mapping , pos , len , copied , page , fsdata );
207
+ #endif
184
208
if (ret < len ) {
185
209
pr_err ("wrote less than requested." );
186
210
return ret ;
0 commit comments