These entry points manipulate various attributes of a file or directory,
including file permissions, owner, group, size,
access time and modification time.
VOP_STAT()
returns data in a format suitable for the
stat(2)
system call and by default is implemented as a wrapper around
VOP_GETATTR().
Filesystems may want to implement their own variant for performance reasons.
For
VOP_GETATTR()
and
VOP_SETATTR()
the arguments are:
vp
|
|
The vnode of the file.
|
vap
|
|
The attributes of the file.
|
cred
|
|
The user credentials of the calling thread.
|
For
VOP_STAT()
the arguments are:
vp
|
|
The vnode of the file.
|
sb
|
|
The attributes of the file.
|
active_cred
|
|
The user credentials of the calling thread.
|
file_cred
|
|
The credentials installed on the file description pointing to the vnode or NOCRED.
|
td
|
|
The calling thread.
|
Attributes which are not being modified by
VOP_SETATTR()
should be set to the value
VNOVAL;
VATTR_NULL()
may be used to clear all the values, and should generally be used to reset
the contents of
*vap
prior to setting specific values.