]> Zhao Yanbai Git Server - minix.git/commit
Implementation of truncate(), ftruncate() and the F_FREESP fcntl().
authorBen Gras <ben@minix3.org>
Wed, 11 Jan 2006 17:14:51 +0000 (17:14 +0000)
committerBen Gras <ben@minix3.org>
Wed, 11 Jan 2006 17:14:51 +0000 (17:14 +0000)
commit50b06261b6e33185ded5b84a5d75d0d7e788c241
tree01925beec27c48f28ef255c643e36937bee08b58
parentd9827f56bafd57fb1ed19608e8c7fa36be16fdb9
Implementation of truncate(), ftruncate() and the F_FREESP fcntl().

Implemented by changing write_map to accept a WMAP_FREE flag. In that
case, it doesn't update the datablock (creating indirect zones as
necessary) pointer, but it frees the datablock if present. Also it
frees the single and double indirect blocks if unused.

This makes the implementation of truncate_inode() simpler.
truncate_inode() now accepts a truncation length which makes
implementing truncate() and ftruncate() simple.

This also allowed implementing the F_FREESP fcntl().
16 files changed:
include/fcntl.h
include/minix/callnr.h
lib/posix/_fcntl.c
lib/posix/_truncate.c
servers/fs/const.h
servers/fs/inode.c
servers/fs/link.c
servers/fs/misc.c
servers/fs/open.c
servers/fs/path.c
servers/fs/proto.h
servers/fs/read.c
servers/fs/select.c
servers/fs/table.c
servers/fs/write.c
servers/pm/table.c