fs: ramfs: make chunk counting in truncate() better readable
In ramfs_truncate() "newchunks" denotes the number of chunks we
want to have after the call. We decrease that number while iterating
over the existing chunks and decrease it further with every newly
allocated chunk until "newchunks" is zero.
This is a bit hard to read. Instead we drop the decreasing while
iterating over existing chunks and increase "oldchunks" while allocating
until it reaches "newchunks".

This is mainly done to make the next patch easier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent a451447 commit 5154902196cb4d2da17a7236e720db0b8d4ac565
@Sascha Hauer Sascha Hauer authored on 26 Sep 2018
Showing 1 changed file
View
fs/ramfs.c