您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ spl_fstrans_unmark函数代码示例

51自学网 2021-06-03 08:10:35
  C++
这篇教程C++ spl_fstrans_unmark函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中spl_fstrans_unmark函数的典型用法代码示例。如果您正苦于以下问题:C++ spl_fstrans_unmark函数的具体用法?C++ spl_fstrans_unmark怎么用?C++ spl_fstrans_unmark使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了spl_fstrans_unmark函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: zpl_link

static intzpl_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry){	cred_t *cr = CRED();	struct inode *ip = old_dentry->d_inode;	int error;	fstrans_cookie_t cookie;	if (ip->i_nlink >= ZFS_LINK_MAX)		return (-EMLINK);	crhold(cr);	ip->i_ctime = CURRENT_TIME_SEC;	igrab(ip); /* Use ihold() if available */	cookie = spl_fstrans_mark();	error = -zfs_link(dir, ip, dname(dentry), cr);	if (error) {		VN_RELE(ip);		goto out;	}	d_instantiate(dentry, ip);out:	spl_fstrans_unmark(cookie);	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:RichardChen3511,项目名称:zfs-1,代码行数:30,


示例2: zpl_truncate_range

static voidzpl_truncate_range(struct inode *ip, loff_t start, loff_t end){	cred_t *cr = CRED();	flock64_t bf;	fstrans_cookie_t cookie;	ASSERT3S(start, <=, end);	/*	 * zfs_freesp() will interpret (len == 0) as meaning "truncate until	 * the end of the file". We don't want that.	 */	if (start == end)		return;	crhold(cr);	bf.l_type = F_WRLCK;	bf.l_whence = 0;	bf.l_start = start;	bf.l_len = end - start;	bf.l_pid = 0;	cookie = spl_fstrans_mark();	zfs_space(ip, F_FREESP, &bf, FWRITE, start, cr);	spl_fstrans_unmark(cookie);	crfree(cr);}
开发者ID:RichardChen3511,项目名称:zfs-1,代码行数:29,


示例3: zpl_lookup

zpl_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)#endif{	cred_t *cr = CRED();	struct inode *ip;	int error;	fstrans_cookie_t cookie;	if (dlen(dentry) > ZFS_MAXNAMELEN)		return (ERR_PTR(-ENAMETOOLONG));	crhold(cr);	cookie = spl_fstrans_mark();	error = -zfs_lookup(dir, dname(dentry), &ip, 0, cr, NULL, NULL);	spl_fstrans_unmark(cookie);	ASSERT3S(error, <=, 0);	crfree(cr);	spin_lock(&dentry->d_lock);	dentry->d_time = jiffies;#ifndef HAVE_S_D_OP	d_set_d_op(dentry, &zpl_dentry_operations);#endif /* HAVE_S_D_OP */	spin_unlock(&dentry->d_lock);	if (error) {		if (error == -ENOENT)			return (d_splice_alias(NULL, dentry));		else			return (ERR_PTR(error));	}	return (d_splice_alias(ip, dentry));}
开发者ID:RichardChen3511,项目名称:zfs-1,代码行数:34,


示例4: zpl_follow_link

static void *zpl_follow_link(struct dentry *dentry, struct nameidata *nd){	cred_t *cr = CRED();	struct inode *ip = dentry->d_inode;	struct iovec iov;	uio_t uio;	char *link;	int error;	fstrans_cookie_t cookie;	crhold(cr);	iov.iov_len = MAXPATHLEN;	iov.iov_base = link = kmem_zalloc(MAXPATHLEN, KM_SLEEP);	uio.uio_iov = &iov;	uio.uio_iovcnt = 1;	uio.uio_resid = (MAXPATHLEN - 1);	uio.uio_segflg = UIO_SYSSPACE;	cookie = spl_fstrans_mark();	error = -zfs_readlink(ip, &uio, cr);	spl_fstrans_unmark(cookie);	if (error) {		kmem_free(link, MAXPATHLEN);		nd_set_link(nd, ERR_PTR(error));	} else {		nd_set_link(nd, link);	}	crfree(cr);	return (NULL);}
开发者ID:RichardChen3511,项目名称:zfs-1,代码行数:34,


示例5: zpl_symlink

static intzpl_symlink(struct inode *dir, struct dentry *dentry, const char *name){	cred_t *cr = CRED();	vattr_t *vap;	struct inode *ip;	int error;	fstrans_cookie_t cookie;	crhold(cr);	vap = kmem_zalloc(sizeof (vattr_t), KM_SLEEP);	zpl_vap_init(vap, dir, S_IFLNK | S_IRWXUGO, cr);	cookie = spl_fstrans_mark();	error = -zfs_symlink(dir, dname(dentry), vap, (char *)name, &ip, cr, 0);	if (error == 0) {		d_instantiate(dentry, ip);		error = zpl_xattr_security_init(ip, dir, &dentry->d_name);		if (error)			(void) zfs_remove(dir, dname(dentry), cr);	}	spl_fstrans_unmark(cookie);	kmem_free(vap, sizeof (vattr_t));	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:RichardChen3511,项目名称:zfs-1,代码行数:30,


示例6: zpl_getattr

static intzpl_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat){	boolean_t issnap = ITOZSB(dentry->d_inode)->z_issnap;	int error;	fstrans_cookie_t cookie;	/*	 * Ensure MNT_SHRINKABLE is set on snapshots to ensure they are	 * unmounted automatically with the parent file system.  This	 * is done on the first getattr because it's not easy to get the	 * vfsmount structure at mount time.  This call path is explicitly	 * marked unlikely to avoid any performance impact.  FWIW, ext4	 * resorts to a similar trick for sysadmin convenience.	 */	if (unlikely(issnap && !(mnt->mnt_flags & MNT_SHRINKABLE)))		mnt->mnt_flags |= MNT_SHRINKABLE;	cookie = spl_fstrans_mark();	error = -zfs_getattr_fast(dentry->d_inode, stat);	spl_fstrans_unmark(cookie);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:RichardChen3511,项目名称:zfs-1,代码行数:25,


示例7: zpl_mkdir

static intzpl_mkdir(struct inode *dir, struct dentry *dentry, zpl_umode_t mode){	cred_t *cr = CRED();	vattr_t *vap;	struct inode *ip;	int error;	fstrans_cookie_t cookie;	crhold(cr);	vap = kmem_zalloc(sizeof (vattr_t), KM_SLEEP);	zpl_vap_init(vap, dir, mode | S_IFDIR, cr);	cookie = spl_fstrans_mark();	error = -zfs_mkdir(dir, dname(dentry), vap, &ip, cr, 0, NULL);	if (error == 0) {		d_instantiate(dentry, ip);		error = zpl_xattr_security_init(ip, dir, &dentry->d_name);		if (error == 0)			error = zpl_init_acl(ip, dir);		if (error)			(void) zfs_rmdir(dir, dname(dentry), NULL, cr, 0);	}	spl_fstrans_unmark(cookie);	kmem_free(vap, sizeof (vattr_t));	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:RichardChen3511,项目名称:zfs-1,代码行数:33,


示例8: zpl_clear_inode

static voidzpl_clear_inode(struct inode *ip){    fstrans_cookie_t cookie;    cookie = spl_fstrans_mark();    zfs_inactive(ip);    spl_fstrans_unmark(cookie);}
开发者ID:koplover,项目名称:zfs,代码行数:9,


示例9: zpl_dirty_inode

static voidzpl_dirty_inode(struct inode *ip){    fstrans_cookie_t cookie;    cookie = spl_fstrans_mark();    zfs_dirty_inode(ip, 0);    spl_fstrans_unmark(cookie);}
开发者ID:koplover,项目名称:zfs,代码行数:9,


示例10: zpl_xattr_set

static intzpl_xattr_set(struct inode *ip, const char *name, const void *value,    size_t size, int flags){	znode_t *zp = ITOZ(ip);	zfs_sb_t *zsb = ZTOZSB(zp);	cred_t *cr = CRED();	fstrans_cookie_t cookie;	int error;	crhold(cr);	cookie = spl_fstrans_mark();	rrm_enter_read(&(zsb)->z_teardown_lock, FTAG);	rw_enter(&ITOZ(ip)->z_xattr_lock, RW_WRITER);	/*	 * Before setting the xattr check to see if it already exists.	 * This is done to ensure the following optional flags are honored.	 *	 *   XATTR_CREATE: fail if xattr already exists	 *   XATTR_REPLACE: fail if xattr does not exist	 */	error = __zpl_xattr_get(ip, name, NULL, 0, cr);	if (error < 0) {		if (error != -ENODATA)			goto out;		if (flags & XATTR_REPLACE)			goto out;		/* The xattr to be removed already doesn't exist */		error = 0;		if (value == NULL)			goto out;	} else {		error = -EEXIST;		if (flags & XATTR_CREATE)			goto out;	}	/* Preferentially store the xattr as a SA for better performance */	if (zsb->z_use_sa && zsb->z_xattr_sa && zp->z_is_sa) {		error = zpl_xattr_set_sa(ip, name, value, size, flags, cr);		if (error == 0)			goto out;	}	error = zpl_xattr_set_dir(ip, name, value, size, flags, cr);out:	rw_exit(&ITOZ(ip)->z_xattr_lock);	rrm_exit(&(zsb)->z_teardown_lock, FTAG);	spl_fstrans_unmark(cookie);	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:ClusterHQ,项目名称:zfs,代码行数:57,


示例11: zpl_evict_inode

static voidzpl_evict_inode(struct inode *ip){    fstrans_cookie_t cookie;    cookie = spl_fstrans_mark();    truncate_setsize(ip, 0);    clear_inode(ip);    zfs_inactive(ip);    spl_fstrans_unmark(cookie);}
开发者ID:koplover,项目名称:zfs,代码行数:11,


示例12: zpl_put_super

static voidzpl_put_super(struct super_block *sb){    fstrans_cookie_t cookie;    int error;    cookie = spl_fstrans_mark();    error = -zfs_umount(sb);    spl_fstrans_unmark(cookie);    ASSERT3S(error, <=, 0);}
开发者ID:koplover,项目名称:zfs,代码行数:11,


示例13: zvol_write

/* * Common write path running under the zvol taskq context.  This function * is responsible for copying the request structure data in to the DMU and * signaling the request queue with the result of the copy. */static voidzvol_write(void *arg){    struct request *req = (struct request *)arg;    struct request_queue *q = req->q;    zvol_state_t *zv = q->queuedata;    fstrans_cookie_t cookie = spl_fstrans_mark();    uint64_t offset = blk_rq_pos(req) << 9;    uint64_t size = blk_rq_bytes(req);    int error = 0;    dmu_tx_t *tx;    rl_t *rl;    if (req->cmd_flags & VDEV_REQ_FLUSH)        zil_commit(zv->zv_zilog, ZVOL_OBJ);    /*     * Some requests are just for flush and nothing else.     */    if (size == 0) {        error = 0;        goto out;    }    rl = zfs_range_lock(&zv->zv_znode, offset, size, RL_WRITER);    tx = dmu_tx_create(zv->zv_objset);    dmu_tx_hold_write(tx, ZVOL_OBJ, offset, size);    /* This will only fail for ENOSPC */    error = dmu_tx_assign(tx, TXG_WAIT);    if (error) {        dmu_tx_abort(tx);        zfs_range_unlock(rl);        goto out;    }    error = dmu_write_req(zv->zv_objset, ZVOL_OBJ, req, tx);    if (error == 0)        zvol_log_write(zv, tx, offset, size,                       req->cmd_flags & VDEV_REQ_FUA);    dmu_tx_commit(tx);    zfs_range_unlock(rl);    if ((req->cmd_flags & VDEV_REQ_FUA) ||            zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS)        zil_commit(zv->zv_zilog, ZVOL_OBJ);out:    blk_end_request(req, -error, size);    spl_fstrans_unmark(cookie);}
开发者ID:avg-I,项目名称:zfs,代码行数:58,


示例14: zvol_set_snapdev_impl

static voidzvol_set_snapdev_impl(char *name, uint64_t snapdev){	zvol_snapdev_cb_arg_t arg = {snapdev};	fstrans_cookie_t cookie = spl_fstrans_mark();	/*	 * The zvol_set_snapdev_sync() sets snapdev appropriately	 * in the dataset hierarchy. Here, we only scan snapshots.	 */	dmu_objset_find(name, zvol_set_snapdev_cb, &arg, DS_FIND_SNAPSHOTS);	spl_fstrans_unmark(cookie);}
开发者ID:alek-p,项目名称:zfs,代码行数:12,


示例15: zvol_request

static MAKE_REQUEST_FN_RETzvol_request(struct request_queue *q, struct bio *bio){	zvol_state_t *zv = q->queuedata;	fstrans_cookie_t cookie = spl_fstrans_mark();	uint64_t offset = BIO_BI_SECTOR(bio);	unsigned int sectors = bio_sectors(bio);	int rw = bio_data_dir(bio);#ifdef HAVE_GENERIC_IO_ACCT	unsigned long start = jiffies;#endif	int error = 0;	if (bio_has_data(bio) && offset + sectors >	    get_capacity(zv->zv_disk)) {		printk(KERN_INFO		    "%s: bad access: block=%llu, count=%lu/n",		    zv->zv_disk->disk_name,		    (long long unsigned)offset,		    (long unsigned)sectors);		error = SET_ERROR(EIO);		goto out1;	}	generic_start_io_acct(rw, sectors, &zv->zv_disk->part0);	if (rw == WRITE) {		if (unlikely(zv->zv_flags & ZVOL_RDONLY)) {			error = SET_ERROR(EROFS);			goto out2;		}		if (bio->bi_rw & VDEV_REQ_DISCARD) {			error = zvol_discard(bio);			goto out2;		}		error = zvol_write(bio);	} else		error = zvol_read(bio);out2:	generic_end_io_acct(rw, &zv->zv_disk->part0, start);out1:	BIO_END_IO(bio, -error);	spl_fstrans_unmark(cookie);#ifdef HAVE_MAKE_REQUEST_FN_RET_INT	return (0);#elif defined(HAVE_MAKE_REQUEST_FN_RET_QC)	return (BLK_QC_T_NONE);#endif}
开发者ID:koplover,项目名称:zfs,代码行数:52,


示例16: zpl_ioctl_setflags

static intzpl_ioctl_setflags(struct file *filp, void __user *arg){	struct inode	*ip = file_inode(filp);	uint64_t	zfs_flags = ITOZ(ip)->z_pflags;	unsigned int	ioctl_flags;	cred_t		*cr = CRED();	xvattr_t	xva;	xoptattr_t	*xoap;	int		error;	fstrans_cookie_t cookie;	if (copy_from_user(&ioctl_flags, arg, sizeof (ioctl_flags)))		return (-EFAULT);	if ((ioctl_flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_NODUMP_FL)))		return (-EOPNOTSUPP);	if ((ioctl_flags & ~(FS_FL_USER_MODIFIABLE)))		return (-EACCES);	if ((fchange(ioctl_flags, zfs_flags, FS_IMMUTABLE_FL, ZFS_IMMUTABLE) ||	    fchange(ioctl_flags, zfs_flags, FS_APPEND_FL, ZFS_APPENDONLY)) &&	    !capable(CAP_LINUX_IMMUTABLE))		return (-EACCES);	if (!zpl_inode_owner_or_capable(ip))		return (-EACCES);	xva_init(&xva);	xoap = xva_getxoptattr(&xva);	XVA_SET_REQ(&xva, XAT_IMMUTABLE);	if (ioctl_flags & FS_IMMUTABLE_FL)		xoap->xoa_immutable = B_TRUE;	XVA_SET_REQ(&xva, XAT_APPENDONLY);	if (ioctl_flags & FS_APPEND_FL)		xoap->xoa_appendonly = B_TRUE;	XVA_SET_REQ(&xva, XAT_NODUMP);	if (ioctl_flags & FS_NODUMP_FL)		xoap->xoa_nodump = B_TRUE;	crhold(cr);	cookie = spl_fstrans_mark();	error = -zfs_setattr(ip, (vattr_t *)&xva, 0, cr);	spl_fstrans_unmark(cookie);	crfree(cr);	return (error);}
开发者ID:Alyseo,项目名称:zfs,代码行数:52,


示例17: zpl_statfs

static intzpl_statfs(struct dentry *dentry, struct kstatfs *statp){    fstrans_cookie_t cookie;    int error;    cookie = spl_fstrans_mark();    error = -zfs_statvfs(dentry, statp);    spl_fstrans_unmark(cookie);    ASSERT3S(error, <=, 0);    return (error);}
开发者ID:koplover,项目名称:zfs,代码行数:13,


示例18: zpl_getattr

static intzpl_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat){	int error;	fstrans_cookie_t cookie;	cookie = spl_fstrans_mark();	error = -zfs_getattr_fast(dentry->d_inode, stat);	spl_fstrans_unmark(cookie);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:MarkGavalda,项目名称:zfs,代码行数:13,


示例19: zpl_fill_super

static intzpl_fill_super(struct super_block *sb, void *data, int silent){    zfs_mntopts_t *zmo = (zfs_mntopts_t *)data;    fstrans_cookie_t cookie;    int error;    cookie = spl_fstrans_mark();    error = -zfs_domount(sb, zmo, silent);    spl_fstrans_unmark(cookie);    ASSERT3S(error, <=, 0);    return (error);}
开发者ID:koplover,项目名称:zfs,代码行数:14,


示例20: zpl_putpage

intzpl_putpage(struct page *pp, struct writeback_control *wbc, void *data){	struct address_space *mapping = data;	fstrans_cookie_t cookie;	ASSERT(PageLocked(pp));	ASSERT(!PageWriteback(pp));	cookie = spl_fstrans_mark();	(void) zfs_putpage(mapping->host, pp, wbc);	spl_fstrans_unmark(cookie);	return (0);}
开发者ID:Alyseo,项目名称:zfs,代码行数:15,


示例21: zpl_commit_metadata

static intzpl_commit_metadata(struct inode *inode){	cred_t *cr = CRED();	fstrans_cookie_t cookie;	int error;	crhold(cr);	cookie = spl_fstrans_mark();	error = -zfs_fsync(inode, 0, cr);	spl_fstrans_unmark(cookie);	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:RichardChen3511,项目名称:zfs-1,代码行数:16,


示例22: zpl_iterate

static intzpl_iterate(struct file *filp, struct dir_context *ctx){	cred_t *cr = CRED();	int error;	fstrans_cookie_t cookie;	crhold(cr);	cookie = spl_fstrans_mark();	error = -zfs_readdir(file_inode(filp), ctx, cr);	spl_fstrans_unmark(cookie);	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:krichter722,项目名称:zfs,代码行数:16,


示例23: zpl_sync_fs

static intzpl_sync_fs(struct super_block *sb, int wait){    fstrans_cookie_t cookie;    cred_t *cr = CRED();    int error;    crhold(cr);    cookie = spl_fstrans_mark();    error = -zfs_sync(sb, wait, cr);    spl_fstrans_unmark(cookie);    crfree(cr);    ASSERT3S(error, <=, 0);    return (error);}
开发者ID:koplover,项目名称:zfs,代码行数:16,


示例24: zpl_fsync

/* * Linux 2.6.x - 2.6.34 API, * Through 2.6.34 the nfsd kernel server would pass a NULL 'file struct *' * to the fops->fsync() hook.  For this reason, we must be careful not to * use filp unconditionally. */static intzpl_fsync(struct file *filp, struct dentry *dentry, int datasync){	cred_t *cr = CRED();	int error;	fstrans_cookie_t cookie;	crhold(cr);	cookie = spl_fstrans_mark();	error = -zfs_fsync(dentry->d_inode, datasync, cr);	spl_fstrans_unmark(cookie);	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:Alyseo,项目名称:zfs,代码行数:22,


示例25: zpl_rmdir

static intzpl_rmdir(struct inode * dir, struct dentry *dentry){	cred_t *cr = CRED();	int error;	fstrans_cookie_t cookie;	crhold(cr);	cookie = spl_fstrans_mark();	error = -zfs_rmdir(dir, dname(dentry), NULL, cr, 0);	spl_fstrans_unmark(cookie);	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:10144161,项目名称:zfs,代码行数:16,


示例26: zpl_iterate

static intzpl_iterate(struct file *filp, struct dir_context *ctx){	struct dentry *dentry = filp->f_path.dentry;	cred_t *cr = CRED();	int error;	fstrans_cookie_t cookie;	crhold(cr);	cookie = spl_fstrans_mark();	error = -zfs_readdir(dentry->d_inode, ctx, cr);	spl_fstrans_unmark(cookie);	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:Alyseo,项目名称:zfs,代码行数:17,


示例27: zpl_rename

static intzpl_rename(struct inode *sdip, struct dentry *sdentry,    struct inode *tdip, struct dentry *tdentry){	cred_t *cr = CRED();	int error;	fstrans_cookie_t cookie;	crhold(cr);	cookie = spl_fstrans_mark();	error = -zfs_rename(sdip, dname(sdentry), tdip, dname(tdentry), cr, 0);	spl_fstrans_unmark(cookie);	crfree(cr);	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:MarkGavalda,项目名称:zfs,代码行数:17,


示例28: zpl_follow_link

const char *zpl_follow_link(struct dentry *dentry, void **symlink_cookie)#endif{	cred_t *cr = CRED();	struct inode *ip = dentry->d_inode;	struct iovec iov;	uio_t uio;	char *link;	int error;	fstrans_cookie_t cookie;	crhold(cr);	iov.iov_len = MAXPATHLEN;	iov.iov_base = link = kmem_zalloc(MAXPATHLEN, KM_SLEEP);	uio.uio_iov = &iov;	uio.uio_iovcnt = 1;	uio.uio_skip = 0;	uio.uio_resid = (MAXPATHLEN - 1);	uio.uio_segflg = UIO_SYSSPACE;	cookie = spl_fstrans_mark();	error = -zfs_readlink(ip, &uio, cr);	spl_fstrans_unmark(cookie);	if (error)		kmem_free(link, MAXPATHLEN);	crfree(cr);#ifdef HAVE_FOLLOW_LINK_NAMEIDATA	if (error)		nd_set_link(nd, ERR_PTR(error));	else		nd_set_link(nd, link);	return (NULL);#else	if (error)		return (ERR_PTR(error));	else		return (*symlink_cookie = link);#endif}
开发者ID:10144161,项目名称:zfs,代码行数:46,


示例29: zpl_fallocate_common

longzpl_fallocate_common(struct inode *ip, int mode, loff_t offset, loff_t len){	int error = -EOPNOTSUPP;#if defined(FALLOC_FL_PUNCH_HOLE) && defined(FALLOC_FL_KEEP_SIZE)	cred_t *cr = CRED();	flock64_t bf;	loff_t olen;	fstrans_cookie_t cookie;	if (mode != (FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))		return (error);	crhold(cr);	if (offset < 0 || len <= 0)		return (-EINVAL);	spl_inode_lock(ip);	olen = i_size_read(ip);	if (offset > olen) {		spl_inode_unlock(ip);		return (0);	}	if (offset + len > olen)		len = olen - offset;	bf.l_type = F_WRLCK;	bf.l_whence = 0;	bf.l_start = offset;	bf.l_len = len;	bf.l_pid = 0;	cookie = spl_fstrans_mark();	error = -zfs_space(ip, F_FREESP, &bf, FWRITE, offset, cr);	spl_fstrans_unmark(cookie);	spl_inode_unlock(ip);	crfree(cr);#endif /* defined(FALLOC_FL_PUNCH_HOLE) && defined(FALLOC_FL_KEEP_SIZE) */	ASSERT3S(error, <=, 0);	return (error);}
开发者ID:Alyseo,项目名称:zfs,代码行数:45,



注:本文中的spl_fstrans_unmark函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ splash函数代码示例
C++ spl0函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。