本文整理汇总了C++中LINVFS_GET_VP函数的典型用法代码示例。如果您正苦于以下问题:C++ LINVFS_GET_VP函数的具体用法?C++ LINVFS_GET_VP怎么用?C++ LINVFS_GET_VP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LINVFS_GET_VP函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: linvfs_setxattr
STATIC int
linvfs_setxattr(
struct dentry *dentry,
const char *name,
const void *data,
size_t size,
int flags)
{
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode);
char *attr = (char *)name;
attrnames_t *namesp;
int xflags = 0;
int error;
namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
if (!namesp)
return -EOPNOTSUPP;
attr += namesp->attr_namelen;
error = namesp->attr_capable(vp, NULL);
if (error)
return error;
/* Convert Linux syscall to XFS internal ATTR flags */
if (flags & XATTR_CREATE)
xflags |= ATTR_CREATE;
if (flags & XATTR_REPLACE)
xflags |= ATTR_REPLACE;
xflags |= namesp->attr_flag;
return namesp->attr_set(vp, attr, (void *)data, size, xflags);
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:30,代码来源:xfs_iops.c
示例2: linvfs_get_parent
STATIC struct dentry *
linvfs_get_parent(
struct dentry *child)
{
int error;
vnode_t *vp, *cvp;
struct dentry *parent;
struct inode *ip = NULL;
struct dentry dotdot;
dotdot.d_name.name = "..";
dotdot.d_name.len = 2;
dotdot.d_inode = 0;
cvp = NULL;
vp = LINVFS_GET_VP(child->d_inode);
VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error);
if (!error) {
ASSERT(cvp);
ip = LINVFS_GET_IP(cvp);
if (!ip) {
VN_RELE(cvp);
return ERR_PTR(-EACCES);
}
}
if (error)
return ERR_PTR(-error);
parent = d_alloc_anon(ip);
if (!parent) {
VN_RELE(cvp);
parent = ERR_PTR(-ENOMEM);
}
return parent;
}
开发者ID:xricson,项目名称:knoppix,代码行数:35,代码来源:xfs_super.c
示例3: linvfs_getxattr
STATIC ssize_t
linvfs_getxattr(
struct dentry *dentry,
const char *name,
void *data,
size_t size)
{
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode);
char *attr = (char *)name;
attrnames_t *namesp;
int xflags = 0;
ssize_t error;
namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
if (!namesp)
return -EOPNOTSUPP;
attr += namesp->attr_namelen;
error = namesp->attr_capable(vp, NULL);
if (error)
return error;
/* Convert Linux syscall to XFS internal ATTR flags */
if (!size) {
xflags |= ATTR_KERNOVAL;
data = NULL;
}
xflags |= namesp->attr_flag;
return namesp->attr_get(vp, attr, (void *)data, size, xflags);
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:29,代码来源:xfs_iops.c
示例4: linvfs_symlink
STATIC int
linvfs_symlink(
struct inode *dir,
struct dentry *dentry,
const char *symname)
{
struct inode *ip;
vattr_t va;
vnode_t *dvp; /* directory containing name of symlink */
vnode_t *cvp; /* used to lookup symlink to put in dentry */
int error;
dvp = LINVFS_GET_VP(dir);
cvp = NULL;
memset(&va, 0, sizeof(va));
va.va_mode = S_IFLNK |
(irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO);
va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
error = 0;
VOP_SYMLINK(dvp, dentry, &va, (char *)symname, &cvp, NULL, error);
if (likely(!error && cvp)) {
error = linvfs_init_security(cvp, dir);
if (likely(!error)) {
ip = LINVFS_GET_IP(cvp);
d_instantiate(dentry, ip);
validate_fields(dir);
validate_fields(ip);
}
}
return -error;
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:33,代码来源:xfs_iops.c
示例5: linvfs_readlink
STATIC int
linvfs_readlink(
struct dentry *dentry,
char *buf,
int size)
{
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode);
uio_t uio;
iovec_t iov;
int error;
iov.iov_base = buf;
iov.iov_len = size;
uio.uio_iov = &iov;
uio.uio_offset = 0;
uio.uio_segflg = UIO_USERSPACE;
uio.uio_resid = size;
uio.uio_iovcnt = 1;
VOP_READLINK(vp, &uio, 0, NULL, error);
if (error)
return -error;
return (size - uio.uio_resid);
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:26,代码来源:xfs_iops.c
示例6: vn_initialize
struct vnode *
vn_initialize(
struct inode *inode)
{
struct vnode *vp = LINVFS_GET_VP(inode);
XFS_STATS_INC(vn_active);
XFS_STATS_INC(vn_alloc);
vp->v_flag = VMODIFIED;
spinlock_init(&vp->v_lock, "v_lock");
spin_lock(&vnumber_lock);
if (!++vn_generation) /* v_number shouldn't be zero */
vn_generation++;
vp->v_number = vn_generation;
spin_unlock(&vnumber_lock);
ASSERT(VN_CACHED(vp) == 0);
/* Initialize the first behavior and the behavior chain head. */
vn_bhv_head_init(VN_BHV_HEAD(vp), "vnode");
#ifdef XFS_VNODE_TRACE
vp->v_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP);
#endif /* XFS_VNODE_TRACE */
vn_trace_exit(vp, "vn_initialize", (inst_t *)__return_address);
return vp;
}
开发者ID:OpenHMR,项目名称:Open-HMR600,代码行数:30,代码来源:xfs_vnode.c
示例7: linvfs_symlink
STATIC int
linvfs_symlink(
struct inode *dir,
struct dentry *dentry,
const char *symname)
{
struct inode *ip;
vattr_t va;
vnode_t *dvp; /* directory containing name of symlink */
vnode_t *cvp; /* used to lookup symlink to put in dentry */
int error;
dvp = LINVFS_GET_VP(dir);
cvp = NULL;
memset(&va, 0, sizeof(va));
va.va_type = VLNK;
va.va_mode = irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO;
va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
error = 0;
VOP_SYMLINK(dvp, dentry, &va, (char *)symname, &cvp, NULL, error);
if (!error && cvp) {
ASSERT(cvp->v_type == VLNK);
ip = LINVFS_GET_IP(cvp);
d_instantiate(dentry, ip);
validate_fields(dir);
validate_fields(ip); /* size needs update */
}
return -error;
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:31,代码来源:xfs_iops.c
示例8: xfs_set_inodeops
STATIC __inline__ void
xfs_set_inodeops(
struct inode *inode)
{
vnode_t *vp = LINVFS_GET_VP(inode);
if (vp->v_type == VNON) {
make_bad_inode(inode);
} else if (S_ISREG(inode->i_mode)) {
inode->i_op = &linvfs_file_inode_operations;
inode->i_fop = &linvfs_file_operations;
inode->i_mapping->a_ops = &linvfs_aops;
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &linvfs_dir_inode_operations;
inode->i_fop = &linvfs_dir_operations;
} else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &linvfs_symlink_inode_operations;
if (inode->i_blocks)
inode->i_mapping->a_ops = &linvfs_aops;
} else {
inode->i_op = &linvfs_file_inode_operations;
init_special_inode(inode, inode->i_mode,
inode->i_rdev);
}
}
开发者ID:xricson,项目名称:knoppix,代码行数:25,代码来源:xfs_super.c
示例9: linvfs_lookup
STATIC struct dentry *
linvfs_lookup(
struct inode *dir,
struct dentry *dentry)
{
struct inode *ip = NULL;
vnode_t *vp, *cvp = NULL;
int error;
if (dentry->d_name.len >= MAXNAMELEN)
return ERR_PTR(-ENAMETOOLONG);
vp = LINVFS_GET_VP(dir);
VOP_LOOKUP(vp, dentry, &cvp, 0, NULL, NULL, error);
if (!error) {
ASSERT(cvp);
ip = LINVFS_GET_IP(cvp);
if (!ip) {
VN_RELE(cvp);
return ERR_PTR(-EACCES);
}
}
if (error && (error != ENOENT))
return ERR_PTR(-error);
d_add(dentry, ip); /* Negative entry goes in if ip is NULL */
return NULL;
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:27,代码来源:xfs_iops.c
示例10: linvfs_file_mmap
STATIC int
linvfs_file_mmap(
struct file *filp,
struct vm_area_struct *vma)
{
struct inode *ip = filp->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(ip);
vattr_t va = { .va_mask = XFS_AT_UPDATIME };
int error;
if (vp->v_vfsp->vfs_flag & VFS_DMI) {
xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
error = -XFS_SEND_MMAP(mp, vma, 0);
if (error)
return error;
}
vma->vm_ops = &linvfs_file_vm_ops;
VOP_SETATTR(vp, &va, XFS_AT_UPDATIME, NULL, error);
if (!error)
vn_revalidate(vp); /* update Linux inode flags */
return 0;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:25,代码来源:xfs_file.c
示例11: linvfs_setattr
STATIC int
linvfs_setattr(
struct dentry *dentry,
struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
unsigned int ia_valid = attr->ia_valid;
vnode_t *vp = LINVFS_GET_VP(inode);
vattr_t vattr;
int flags = 0;
int error;
memset(&vattr, 0, sizeof(vattr_t));
if (ia_valid & ATTR_UID) {
vattr.va_mask |= XFS_AT_UID;
vattr.va_uid = attr->ia_uid;
}
if (ia_valid & ATTR_GID) {
vattr.va_mask |= XFS_AT_GID;
vattr.va_gid = attr->ia_gid;
}
if (ia_valid & ATTR_SIZE) {
vattr.va_mask |= XFS_AT_SIZE;
vattr.va_size = attr->ia_size;
}
if (ia_valid & ATTR_ATIME) {
vattr.va_mask |= XFS_AT_ATIME;
vattr.va_atime = attr->ia_atime;
inode->i_atime = attr->ia_atime;
}
if (ia_valid & ATTR_MTIME) {
vattr.va_mask |= XFS_AT_MTIME;
vattr.va_mtime = attr->ia_mtime;
}
if (ia_valid & ATTR_CTIME) {
vattr.va_mask |= XFS_AT_CTIME;
vattr.va_ctime = attr->ia_ctime;
}
if (ia_valid & ATTR_MODE) {
vattr.va_mask |= XFS_AT_MODE;
vattr.va_mode = attr->ia_mode;
if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
inode->i_mode &= ~S_ISGID;
}
if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET))
flags |= ATTR_UTIME;
#ifdef ATTR_NO_BLOCK
if ((ia_valid & ATTR_NO_BLOCK))
flags |= ATTR_NONBLOCK;
#endif
VOP_SETATTR(vp, &vattr, flags, NULL, error);
if (error)
return -error;
vn_revalidate(vp);
return error;
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:58,代码来源:xfs_iops.c
示例12: linvfs_revalidate
STATIC int
linvfs_revalidate(
struct dentry *dentry)
{
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode);
if (unlikely(vp->v_flag & VMODIFIED))
return vn_revalidate(vp);
return 0;
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:10,代码来源:xfs_iops.c
示例13: linvfs_permission
STATIC int
linvfs_permission(
struct inode *inode,
int mode)
{
vnode_t *vp = LINVFS_GET_VP(inode);
int error;
mode <<= 6; /* convert from linux to vnode access bits */
VOP_ACCESS(vp, mode, NULL, error);
return -error;
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:12,代码来源:xfs_iops.c
示例14: linvfs_release
STATIC int
linvfs_release(
struct inode *inode,
struct file *filp)
{
vnode_t *vp = LINVFS_GET_VP(inode);
int error = 0;
if (vp)
VOP_RELEASE(vp, error);
return -error;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:12,代码来源:xfs_file.c
示例15: linvfs_open
STATIC int linvfs_open(
struct inode *inode,
struct file *filp)
{
vnode_t *vp = LINVFS_GET_VP(inode);
vnode_t *newvp;
int error;
ASSERT(vp);
VOP_OPEN(vp, &newvp, 0, get_current_cred(), error);
return -error;
}
开发者ID:crossmeta,项目名称:sgi,代码行数:14,代码来源:xfs_file.c
示例16: linvfs_follow_link
/*
* careful here - this function can get called recursively, so
* we need to be very careful about how much stack we use.
* uio is kmalloced for this reason...
*/
STATIC void *
linvfs_follow_link(
struct dentry *dentry,
struct nameidata *nd)
{
vnode_t *vp;
uio_t *uio;
iovec_t iov;
int error;
char *link;
ASSERT(dentry);
ASSERT(nd);
link = (char *)kmalloc(MAXPATHLEN+1, GFP_KERNEL);
if (!link) {
nd_set_link(nd, ERR_PTR(-ENOMEM));
return NULL;
}
uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
if (!uio) {
kfree(link);
nd_set_link(nd, ERR_PTR(-ENOMEM));
return NULL;
}
vp = LINVFS_GET_VP(dentry->d_inode);
iov.iov_base = link;
iov.iov_len = MAXPATHLEN;
uio->uio_iov = &iov;
uio->uio_offset = 0;
uio->uio_segflg = UIO_SYSSPACE;
uio->uio_resid = MAXPATHLEN;
uio->uio_iovcnt = 1;
VOP_READLINK(vp, uio, 0, NULL, error);
if (error) {
kfree(link);
link = ERR_PTR(-error);
} else {
link[MAXPATHLEN - uio->uio_resid] = '\0';
}
kfree(uio);
nd_set_link(nd, link);
return NULL;
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:55,代码来源:xfs_iops.c
示例17: linvfs_sendfile
STATIC ssize_t
linvfs_sendfile(
struct file *filp,
loff_t *ppos,
size_t count,
read_actor_t actor,
void *target)
{
vnode_t *vp = LINVFS_GET_VP(filp->f_dentry->d_inode);
ssize_t rval;
VOP_SENDFILE(vp, filp, ppos, 0, count, actor, target, NULL, rval);
return rval;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:14,代码来源:xfs_file.c
示例18: linvfs_follow_link
/*
* careful here - this function can get called recursively, so
* we need to be very careful about how much stack we use.
* uio is kmalloced for this reason...
*/
STATIC int
linvfs_follow_link(
struct dentry *dentry,
struct nameidata *nd)
{
vnode_t *vp;
uio_t *uio;
iovec_t iov;
int error;
char *link;
ASSERT(dentry);
ASSERT(nd);
link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
if (!link)
return -ENOMEM;
uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
if (!uio) {
kfree(link);
return -ENOMEM;
}
vp = LINVFS_GET_VP(dentry->d_inode);
iov.iov_base = link;
iov.iov_len = MAXNAMELEN;
uio->uio_iov = &iov;
uio->uio_offset = 0;
uio->uio_segflg = UIO_SYSSPACE;
uio->uio_resid = MAXNAMELEN;
uio->uio_iovcnt = 1;
VOP_READLINK(vp, uio, 0, NULL, error);
if (error) {
kfree(uio);
kfree(link);
return -error;
}
link[MAXNAMELEN - uio->uio_resid] = '\0';
kfree(uio);
/* vfs_follow_link returns (-) errors */
error = vfs_follow_link(nd, link);
kfree(link);
return error;
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:55,代码来源:xfs_iops.c
示例19: linvfs_write_inode
/*
* Attempt to flush the inode, this will actually fail
* if the inode is pinned, but we dirty the inode again
* at the point when it is unpinned after a log write,
* since this is when the inode itself becomes flushable.
*/
STATIC void
linvfs_write_inode(
struct inode *inode,
int sync)
{
vnode_t *vp = LINVFS_GET_VP(inode);
int error, flags = FLUSH_INODE;
if (vp) {
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
if (sync)
flags |= FLUSH_SYNC;
VOP_IFLUSH(vp, flags, error);
}
}
开发者ID:xricson,项目名称:knoppix,代码行数:21,代码来源:xfs_super.c
示例20: linvfs_clear_inode
STATIC void
linvfs_clear_inode(
struct inode *inode)
{
vnode_t *vp = LINVFS_GET_VP(inode);
if (vp) {
vn_rele(vp);
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
/*
* Do all our cleanup, and remove this vnode.
*/
vn_remove(vp);
}
}
开发者ID:xricson,项目名称:knoppix,代码行数:15,代码来源:xfs_super.c
注:本文中的LINVFS_GET_VP函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论