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)
Mon, Jun 23, 1:57 PM
Unknown Object (File)
Sat, Jun 21, 8:35 PM
Unknown Object (File)
Fri, Jun 20, 3:46 PM
Unknown Object (File)
Fri, Jun 20, 3:53 AM
Unknown Object (File)
Tue, Jun 17, 3:31 AM
Unknown Object (File)
Thu, Jun 12, 9:27 AM
Unknown Object (File)
Wed, Jun 11, 2:29 AM
Unknown Object (File)
Thu, Jun 5, 8: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

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.