Page MenuHomeFreeBSD

blist_fill()'s return type is too narrow
ClosedPublic

Authored by alc on Jun 8 2017, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 28, 3:28 AM
Unknown Object (File)
Jan 28 2025, 10:08 AM
Unknown Object (File)
Jan 17 2025, 4:58 PM
Unknown Object (File)
Jan 13 2025, 5:24 AM
Unknown Object (File)
Dec 30 2024, 7:35 AM
Unknown Object (File)
Dec 30 2024, 7:17 AM
Unknown Object (File)
Dec 21 2024, 2:46 AM
Unknown Object (File)
Dec 21 2024, 12:01 AM
Subscribers
None

Details

Summary

It makes no sense for blist_fill() and its helper functions to take a daddr_t "count" of blocks to fill, but return an int type value of allocated blocks. At the moment, this bug is harmless because swaponsomething() limits the size of a swap area.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib added inline comments.
kern/subr_blist.c
1049

bde prefers uintmax_t and %jx for such situations.

sys/blist.h
101

externs are excessive, they could be removed once.

This revision is now accepted and ready to land.Jun 8 2017, 5:52 PM
alc edited edge metadata.

Use intmax_t instead of long long.

This revision now requires review to proceed.Jun 9 2017, 2:47 AM
alc marked an inline comment as done.Jun 9 2017, 2:48 AM
sys/blist.h
101

I interpreted your comment as suggesting a separate change for removing the externs.

sys/blist.h
101

Exactly, this is a separate change.

This revision was automatically updated to reflect the committed changes.