HomeFreeBSD

Stop treating size 0 as unknown size in vnode_create_vobject().

Description

Stop treating size 0 as unknown size in vnode_create_vobject().

Whenever file is created, the vnode_create_vobject() function will
try to determine its size by calling vn_getsize_locked() as size 0
is ambigious: it means either the file size is 0 or the file size
is unknown.

Introduce special value for the size argument: VNODE_NO_SIZE.
Only when it is given, the vnode_create_vobject() will try to obtain
file's size on its own.

Introduce dedicated vnode_disk_create_vobject() for use by
g_vfs_open(), so we don't have to call vn_isdisk() in the common case
(for regular files).

Handle the case of mediasize==0 in g_vfs_open().

Reviewed by: alc, kib, markj, olce
Approved by: oshogbo (mentor), allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D45244

Details

Provenance
pjdAuthored on Sun, May 19, 1:08 AM
Reviewer
alc
Differential Revision
D45244: Stop treating size 0 as unknown size in vnode_create_vobject().
Parents
rGd76ef58d566c: freebsd-update: Correctly check if pkg(8) is present
Branches
Unknown
Tags
Unknown