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)
Thu, Dec 12, 9:29 PM
Unknown Object (File)
Thu, Dec 5, 5:40 AM
Unknown Object (File)
Sun, Dec 1, 12:58 PM
Unknown Object (File)
Wed, Nov 27, 11:43 AM
Unknown Object (File)
Fri, Nov 22, 8:45 PM
Unknown Object (File)
Fri, Nov 22, 8:01 PM
Unknown Object (File)
Nov 17 2024, 1:20 PM
Unknown Object (File)
Nov 15 2024, 5:58 PM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib added inline comments.
kern/subr_blist.c
1049 ↗(On Diff #29344)

bde prefers uintmax_t and %jx for such situations.

sys/blist.h
101 ↗(On Diff #29344)

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 ↗(On Diff #29344)

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

sys/blist.h
101 ↗(On Diff #29344)

Exactly, this is a separate change.

This revision was automatically updated to reflect the committed changes.