Copyright (c) 2008 Joe Marcus Clarke All rights reserved. This program is free software. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclai...
NAMEVOP_VPTOCNP - translate a vnode to its component name
SYNOPSISIn sys/param.h In sys/ucred.h In sys/vnode.h Ft int Fn VOP_VPTOCNP struct vnode *vp struct vnode **dvp struct ucred *cred char *buf int *buflen
DESCRIPTIONThis translates a vnode into its component name, and writes that name to the head of the buffer specified by Fa buf .
- Fa vp
- The vnode to translate.
- Fa dvp
- The vnode of the parent directory of Fa vp .
- Fa cred
- The caller credentials.
- Fa buf
- The buffer into which to prepend the component name.
- Fa buflen
- The remaining size of the buffer.
The default implementation of sysctl Cm net.inet.tcp.syncookies scans through Fa vp Ns 's parent directory looking for a dirent with a matching file number. If Fa vp is not a directory, then sysctl Cm net.inet.tcp.syncookies returns ENOENT.
LOCKSThe vnode should be locked on entry and will still be locked on exit. The parent directory vnode will be unlocked on a successful exit. However, it will have its use count incremented.
RETURN VALUESZero is returned on success, otherwise an error code is returned.
- Bq Er ENOMEM
- The buffer was not large enough to hold the vnode's component name.
- Bq Er ENOENT
- The vnode was not found on the file system.