The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

VOP_MKNOD (9)
  • >> VOP_MKNOD (9) ( FreeBSD man: Ядро )

  • BSD mandoc
     

    NAME

    VOP_CREATE
    
     
    VOP_MKNOD
    
     
    VOP_MKDIR
    
     
    VOP_SYMLINK
    
     - create a file, socket, fifo, device, directory or symlink
    
     
    

    SYNOPSIS

       #include <sys/param.h>
       #include <sys/vnode.h>
       #include <sys/namei.h>
    int VOP_CREATE (struct vnode *dvp struct vnode **vpp struct componentname *cnp struct vattr *vap);
    int VOP_MKNOD (struct vnode *dvp struct vnode **vpp struct componentname *cnp struct vattr *vap);
    int VOP_MKDIR (struct vnode *dvp struct vnode **vpp struct componentname *cnp struct vattr *vap);
    int VOP_SYMLINK (struct vnode *dvp struct vnode **vpp struct componentname *cnp struct vattr *vap char *target);
     

    DESCRIPTION

    These entry points create a new file, socket, fifo, device, directory or symlink in a given directory.

    The arguments are:

    Fa dvp
    The locked vnode of the directory.
    Fa vpp
    The address of a variable where the resulting locked vnode should be stored.
    Fa cnp
    The pathname component created.
    Fa vap
    The attributes that the new object should be created with.
    Fa target
    The pathname of the target of the symlink.

    These entry points are called after VOP_LOOKUP9 when an object is being created.  

    LOCKS

    The directory, Fa dvp will be locked on entry and must remain locked on return. If the call is successful, the new object will be returned locked.  

    RETURN VALUES

    If successful, the vnode for the new object is placed in Fa *vpp and zero is returned. Otherwise, an appropriate error is returned.  

    PSEUDOCODE

    int
    vop_create(struct vnode *dvp,
               struct vnode **vpp,
               struct componentname *cnp
               struct vattr *vap)
    {
        int mode = MAKEIMODE(vap->va_type, vap->va_mode);
        struct vnode *vp;
        int error;
    
        *vpp = NULL;
        if ((mode & IFMT) == 0)
            mode |= IFREG;
    
        error = SOMEFS_VALLOC(dvp, mode, cnp->cn_cred, &vp);
        if (error)
            return error;
    
        /*
         * Update the permissions for the new vnode, including
         * copying the group from the directory.
         */
        ...;
    
    #ifdef QUOTA
        /*
         * Possibly check quota information.
         */
        ...;
    #endif
    
        /*
         * Enter new vnode in directory, taking care that the vnode
         * hits the disk before the directory contents are changed.
         */
        error = ...;
    
        if (error)
            goto bad;
    
        *vpp = vp;
    
        return 0;
    
    bad:
        /*
         * Write error occurred trying to update the inode
         * or the directory so must deallocate the inode.
         */
        vput(vp);
    
        /*
         * Deallocate file system resources for vp.
         */
        ...;
    
        return error;
    }
    
     

    ERRORS

    Bq Er ENOSPC
    The file system is full.
    Bq Er EDQUOT
    The user's file system space or inode quota would be exceeded.

     

    SEE ALSO

    vnode(9), VOP_LOOKUP9  

    HISTORY

    The function appeared in BSD 4.3  

    AUTHORS

    This manual page was written by An Doug Rabson .


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    LOCKS
    RETURN VALUES
    PSEUDOCODE
    ERRORS
    SEE ALSO
    HISTORY
    AUTHORS


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру