Back to index

avfs  1.0.1
Functions
oper.h File Reference
#include "avfs.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int av_open (ventry *ve, int flags, avmode_t mode, vfile **retp)
int av_close (vfile *vf)
avssize_t av_read (vfile *vf, char *buf, avsize_t nbyte)
avssize_t av_write (vfile *vf, const char *buf, avsize_t nbyte)
avssize_t av_pread (vfile *vf, char *buf, avsize_t nbyte, avoff_t offset)
avssize_t av_pwrite (vfile *vf, const char *buf, avsize_t nbyte, avoff_t offset)
avoff_t av_lseek (vfile *vf, avoff_t offset, int whence)
int av_ftruncate (vfile *vf, avoff_t length)
int av_getattr (ventry *ve, struct avstat *buf, int attrmask, int flags)
int av_fgetattr (vfile *vf, struct avstat *buf, int attrmask)
int av_fsetattr (vfile *vf, struct avstat *buf, int attrmask)
int av_access (ventry *ve, int amode)
int av_readlink (ventry *ve, char **bufp)
int av_unlink (ventry *ve)
int av_rmdir (ventry *ve)
int av_mkdir (ventry *ve, avmode_t mode)
int av_mknod (ventry *ve, avmode_t mode, avdev_t dev)
int av_symlink (const char *path, ventry *newve)
int av_rename (ventry *ve, ventry *newve)
int av_link (ventry *ve, ventry *newve)

Function Documentation

int av_access ( ventry *  ve,
int  amode 
)

Definition at line 351 of file oper.c.

{
    int res;
    struct avfs *avfs = ve->mnt->avfs;
    
    AVFS_LOCK(avfs);
    res = avfs->access(ve, amode);
    AVFS_UNLOCK(avfs);

    return res;
}

Here is the caller graph for this function:

int av_close ( vfile *  vf)

Definition at line 236 of file oper.c.

{
    int res = 0;

    if(vf != NULL) {
        res = av_file_close(vf);
        av_unref_obj(vf);
    }

    return res;
}

Here is the caller graph for this function:

int av_fgetattr ( vfile *  vf,
struct avstat buf,
int  attrmask 
)

Definition at line 315 of file oper.c.

{
    int res;
    
    AV_LOCK(vf->lock);
    res = av_file_getattr(vf, buf, attrmask);
    AV_UNLOCK(vf->lock);

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int av_fsetattr ( vfile *  vf,
struct avstat buf,
int  attrmask 
)

Definition at line 326 of file oper.c.

{
    int res;

    AV_LOCK(vf->lock);
    res = av_file_setattr(vf, buf, attrmask);
    AV_UNLOCK(vf->lock);

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int av_ftruncate ( vfile *  vf,
avoff_t  length 
)

Definition at line 304 of file oper.c.

{
    int res;

    AV_LOCK(vf->lock);
    res = av_file_truncate(vf, length);
    AV_UNLOCK(vf->lock);

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int av_getattr ( ventry *  ve,
struct avstat buf,
int  attrmask,
int  flags 
)

Definition at line 337 of file oper.c.

{
    int res;
    vfile vf;

    res = av_file_open(&vf, ve, AVO_NOPERM | flags, 0);
    if(res == 0) {
        res = av_file_getattr(&vf, buf, attrmask);
        av_file_close(&vf);
    }

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int av_link ( ventry *  ve,
ventry *  newve 
)

Definition at line 576 of file oper.c.

{
    int res;

    res = compare_mount(ve->mnt, newve->mnt);
    if(res == 0) {
        struct avfs *avfs = ve->mnt->avfs;
        
        AVFS_LOCK(avfs);
        res = avfs->link(ve, newve);
        AVFS_UNLOCK(avfs);
    }
    
    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

avoff_t av_lseek ( vfile *  vf,
avoff_t  offset,
int  whence 
)

Definition at line 293 of file oper.c.

{
    avoff_t res;

    AV_LOCK(vf->lock);
    res = av_file_lseek(vf, offset, whence);
    AV_UNLOCK(vf->lock);
    
    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int av_mkdir ( ventry *  ve,
avmode_t  mode 
)

Definition at line 496 of file oper.c.

{
    int res;
    struct avfs *avfs = ve->mnt->avfs;
    
    AVFS_LOCK(avfs);
    res = avfs->mkdir(ve, (mode & 07777));
    AVFS_UNLOCK(avfs);
    
    return res;
}

Here is the caller graph for this function:

int av_mknod ( ventry *  ve,
avmode_t  mode,
avdev_t  dev 
)

Definition at line 508 of file oper.c.

{
    int res;
    struct avfs *avfs = ve->mnt->avfs;
    
    AVFS_LOCK(avfs);
    res = avfs->mknod(ve, mode, dev);
    AVFS_UNLOCK(avfs);
    
    return res;
}

Here is the caller graph for this function:

int av_open ( ventry *  ve,
int  flags,
avmode_t  mode,
vfile **  retp 
)

Definition at line 215 of file oper.c.

{
    int res;
    vfile *vf;

    AV_NEW_OBJ(vf, file_destroy);
    AV_INITLOCK(vf->lock);
    res = av_file_open(vf, ve, flags, mode);
    if(res < 0) {
        AV_FREELOCK(vf->lock);
        av_unref_obj(vf);
    }
    else 
        *resp = vf;

    return res;
}

Here is the caller graph for this function:

avssize_t av_pread ( vfile *  vf,
char *  buf,
avsize_t  nbyte,
avoff_t  offset 
)

Definition at line 259 of file oper.c.

{
    avssize_t res;

    AV_LOCK(vf->lock);
    res = av_file_pread(vf, buf, nbyte, offset);
    AV_UNLOCK(vf->lock);

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

avssize_t av_pwrite ( vfile *  vf,
const char *  buf,
avsize_t  nbyte,
avoff_t  offset 
)

Definition at line 281 of file oper.c.

{
    avssize_t res;

    AV_LOCK(vf->lock);
    res = av_file_pwrite(vf, buf, nbyte, offset);
    AV_UNLOCK(vf->lock);

    return res;
}

Here is the call graph for this function:

avssize_t av_read ( vfile *  vf,
char *  buf,
avsize_t  nbyte 
)

Definition at line 248 of file oper.c.

{
    avssize_t res;

    AV_LOCK(vf->lock);
    res = av_file_read(vf, buf, nbyte);
    AV_UNLOCK(vf->lock);

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int av_readlink ( ventry *  ve,
char **  bufp 
)

Definition at line 441 of file oper.c.

{
    int res;
    struct avfs *avfs = ve->mnt->avfs;

    AVFS_LOCK(avfs);
    res = avfs->readlink(ve, bufp);
    AVFS_UNLOCK(avfs);
    
    if(res == 0) {
        if(*bufp[0] == '/' && av_get_symlink_rewrite() == 1) {
            char *rel_link = NULL;
            char *path = NULL;
            int res2;
            
            res2 = av_generate_path(ve, &path);
            if(res2 == 0) {
                transform_symlink(path, *bufp, &rel_link);
                if(rel_link != NULL) {
                    free(*bufp);
                    *bufp = rel_link;
                }
                av_free(path);
            }
        }
    }

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int av_rename ( ventry *  ve,
ventry *  newve 
)

Definition at line 560 of file oper.c.

{
    int res;

    res = compare_mount(ve->mnt, newve->mnt);
    if(res == 0) {
        struct avfs *avfs = ve->mnt->avfs;
        
        AVFS_LOCK(avfs);
        res = avfs->rename(ve, newve);
        AVFS_UNLOCK(avfs);
    }
    
    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int av_rmdir ( ventry *  ve)

Definition at line 484 of file oper.c.

{
    int res;
    struct avfs *avfs = ve->mnt->avfs;
    
    AVFS_LOCK(avfs);
    res = avfs->rmdir(ve);
    AVFS_UNLOCK(avfs);
    
    return res;
}

Here is the caller graph for this function:

int av_symlink ( const char *  path,
ventry *  newve 
)

Definition at line 520 of file oper.c.

{
    int res;
    struct avfs *avfs = newve->mnt->avfs;
    
    AVFS_LOCK(avfs);
    res = avfs->symlink(path, newve);
    AVFS_UNLOCK(avfs);
    
    return res;
}

Here is the caller graph for this function:

int av_unlink ( ventry *  ve)

Definition at line 472 of file oper.c.

{
    int res;
    struct avfs *avfs = ve->mnt->avfs;
    
    AVFS_LOCK(avfs);
    res = avfs->unlink(ve);
    AVFS_UNLOCK(avfs);

    return res;
}

Here is the caller graph for this function:

avssize_t av_write ( vfile *  vf,
const char *  buf,
avsize_t  nbyte 
)

Definition at line 270 of file oper.c.

{
    avssize_t res;

    AV_LOCK(vf->lock);
    res = av_file_write(vf, buf, nbyte);
    AV_UNLOCK(vf->lock);

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function: