Skip to content

Commit 4d08367

Browse files
committed
btrfs: zlib: drop redundant folio address variable
We're caching the current output folio address but it's not really necessary as we store it in the variable and then pass it to the stream context. We can read the folio address directly. Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 5b93f24 commit 4d08367

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

fs/btrfs/zlib.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ int zlib_compress_bio(struct list_head *ws, struct compressed_bio *cb)
157157
const u32 min_folio_size = btrfs_min_folio_size(fs_info);
158158
int ret;
159159
char *data_in = NULL;
160-
char *cfolio_out;
161160
struct folio *in_folio = NULL;
162161
struct folio *out_folio = NULL;
163162
const u32 blocksize = fs_info->sectorsize;
@@ -180,11 +179,10 @@ int zlib_compress_bio(struct list_head *ws, struct compressed_bio *cb)
180179
ret = -ENOMEM;
181180
goto out;
182181
}
183-
cfolio_out = folio_address(out_folio);
184182

185183
workspace->strm.next_in = workspace->buf;
186184
workspace->strm.avail_in = 0;
187-
workspace->strm.next_out = cfolio_out;
185+
workspace->strm.next_out = folio_address(out_folio);
188186
workspace->strm.avail_out = min_folio_size;
189187

190188
while (workspace->strm.total_in < len) {
@@ -263,9 +261,8 @@ int zlib_compress_bio(struct list_head *ws, struct compressed_bio *cb)
263261
ret = -ENOMEM;
264262
goto out;
265263
}
266-
cfolio_out = folio_address(out_folio);
267264
workspace->strm.avail_out = min_folio_size;
268-
workspace->strm.next_out = cfolio_out;
265+
workspace->strm.next_out = folio_address(out_folio);
269266
}
270267
/* We're all done. */
271268
if (workspace->strm.total_in >= len)
@@ -301,9 +298,8 @@ int zlib_compress_bio(struct list_head *ws, struct compressed_bio *cb)
301298
ret = -ENOMEM;
302299
goto out;
303300
}
304-
cfolio_out = folio_address(out_folio);
305301
workspace->strm.avail_out = min_folio_size;
306-
workspace->strm.next_out = cfolio_out;
302+
workspace->strm.next_out = folio_address(out_folio);
307303
}
308304
}
309305
/* Queue the remaining part of the folio. */

0 commit comments

Comments
 (0)