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

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

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

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

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

示例1: decode_lockowner

static __be32 decode_lockowner(struct xdr_stream *xdr, struct cb_notify_lock_args *args){	__be32		*p;	unsigned int	len;	p = read_buf(xdr, 12);	if (unlikely(p == NULL))		return htonl(NFS4ERR_BADXDR);	p = xdr_decode_hyper(p, &args->cbnl_owner.clientid);	len = be32_to_cpu(*p);	p = read_buf(xdr, len);	if (unlikely(p == NULL))		return htonl(NFS4ERR_BADXDR);	/* Only try to decode if the length is right */	if (len == 20) {		p += 2;	/* skip "lock id:" */		args->cbnl_owner.s_dev = be32_to_cpu(*p++);		xdr_decode_hyper(p, &args->cbnl_owner.id);		args->cbnl_valid = true;	} else {		args->cbnl_owner.s_dev = 0;		args->cbnl_owner.id = 0;		args->cbnl_valid = false;	}	return 0;}
开发者ID:AshishNamdev,项目名称:linux,代码行数:29,


示例2: nlm4clt_decode_testres

static intnlm4clt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp){    if (!(p = nlm4_decode_cookie(p, &resp->cookie)))        return -EIO;    resp->status = *p++;    if (resp->status == nlm_lck_denied) {        struct file_lock    *fl = &resp->lock.fl;        u32            excl;        __u64            start, len;        __s64            end;        memset(&resp->lock, 0, sizeof(resp->lock));        locks_init_lock(fl);        excl = ntohl(*p++);        resp->lock.svid = ntohl(*p++);        fl->fl_pid = (pid_t)resp->lock.svid;        if (!(p = nlm4_decode_oh(p, &resp->lock.oh)))            return -EIO;        fl->fl_flags = FL_POSIX;        fl->fl_type  = excl? F_WRLCK : F_RDLCK;        p = xdr_decode_hyper(p, &start);        p = xdr_decode_hyper(p, &len);        end = start + len - 1;        fl->fl_start = s64_to_loff_t(start);        if (len == 0 || end < 0)            fl->fl_end = OFFSET_MAX;        else            fl->fl_end = s64_to_loff_t(end);    }    return 0;}
开发者ID:274914765,项目名称:C,代码行数:34,


示例3: nlm4_decode_lock

static __be32 *nlm4_decode_lock(__be32 *p, struct nlm_lock *lock){	struct file_lock	*fl = &lock->fl;	__u64			len, start;	__s64			end;	if (!(p = xdr_decode_string_inplace(p, &lock->caller,					    &lock->len, NLM_MAXSTRLEN))	 || !(p = nlm4_decode_fh(p, &lock->fh))	 || !(p = nlm4_decode_oh(p, &lock->oh)))		return NULL;	lock->svid  = ntohl(*p++);	locks_init_lock(fl);	fl->fl_owner = current->files;	fl->fl_pid   = (pid_t)lock->svid;	fl->fl_flags = FL_POSIX;	fl->fl_type  = F_RDLCK;		/* as good as anything else */	p = xdr_decode_hyper(p, &start);	p = xdr_decode_hyper(p, &len);	end = start + len - 1;	fl->fl_start = s64_to_loff_t(start);	if (len == 0 || end < 0)		fl->fl_end = OFFSET_MAX;	else		fl->fl_end = s64_to_loff_t(end);	return p;}
开发者ID:mdamt,项目名称:linux,代码行数:31,


示例4: decode_layoutrecall_args

static __be32 decode_layoutrecall_args(struct svc_rqst *rqstp,				       struct xdr_stream *xdr,				       struct cb_layoutrecallargs *args){	__be32 *p;	__be32 status = 0;	uint32_t iomode;	args->cbl_addr = svc_addr(rqstp);	p = read_buf(xdr, 4 * sizeof(uint32_t));	if (unlikely(p == NULL)) {		status = htonl(NFS4ERR_BADXDR);		goto out;	}	args->cbl_layout_type = ntohl(*p++);	/* Depite the spec's xdr, iomode really belongs in the FILE switch,	 * as it is unusable and ignored with the other types.	 */	iomode = ntohl(*p++);	args->cbl_layoutchanged = ntohl(*p++);	args->cbl_recall_type = ntohl(*p++);	if (args->cbl_recall_type == RETURN_FILE) {		args->cbl_range.iomode = iomode;		status = decode_fh(xdr, &args->cbl_fh);		if (unlikely(status != 0))			goto out;		p = read_buf(xdr, 2 * sizeof(uint64_t));		if (unlikely(p == NULL)) {			status = htonl(NFS4ERR_BADXDR);			goto out;		}		p = xdr_decode_hyper(p, &args->cbl_range.offset);		p = xdr_decode_hyper(p, &args->cbl_range.length);		status = decode_stateid(xdr, &args->cbl_stateid);		if (unlikely(status != 0))			goto out;	} else if (args->cbl_recall_type == RETURN_FSID) {		p = read_buf(xdr, 2 * sizeof(uint64_t));		if (unlikely(p == NULL)) {			status = htonl(NFS4ERR_BADXDR);			goto out;		}		p = xdr_decode_hyper(p, &args->cbl_fsid.major);		p = xdr_decode_hyper(p, &args->cbl_fsid.minor);	} else if (args->cbl_recall_type != RETURN_ALL) {		status = htonl(NFS4ERR_BADXDR);		goto out;	}	dprintk("%s: ltype 0x%x iomode %d changed %d recall_type %d/n",		__func__,		args->cbl_layout_type, iomode,		args->cbl_layoutchanged, args->cbl_recall_type);out:	dprintk("%s: exit with status = %d/n", __func__, ntohl(status));	return status;}
开发者ID:JamesAng,项目名称:lx-sk,代码行数:59,


示例5: _osd_xdr_decode_objid

static __be32 *_osd_xdr_decode_objid(__be32 *p, struct pnfs_osd_objid *objid){	p = xdr_decode_opaque_fixed(p, objid->oid_device_id.data,				    sizeof(objid->oid_device_id.data));	p = xdr_decode_hyper(p, &objid->oid_partition_id);	p = xdr_decode_hyper(p, &objid->oid_object_id);	return p;}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:10,


示例6: decode_fattr3

static int decode_fattr3(struct xdr_stream *xdr, struct nfs_fattr *fattr){	umode_t fmode;	__be32 *p;	p = xdr_inline_decode(xdr, NFS3_fattr_sz << 2);	if (unlikely(p == NULL))		goto out_overflow;	p = xdr_decode_ftype3(p, &fmode);	fattr->mode = (be32_to_cpup(p++) & ~S_IFMT) | fmode;	fattr->nlink = be32_to_cpup(p++);	fattr->uid = be32_to_cpup(p++);	fattr->gid = be32_to_cpup(p++);	p = xdr_decode_size3(p, &fattr->size);	p = xdr_decode_size3(p, &fattr->du.nfs3.used);	p = xdr_decode_specdata3(p, &fattr->rdev);	p = xdr_decode_hyper(p, &fattr->fsid.major);	fattr->fsid.minor = 0;	p = xdr_decode_fileid3(p, &fattr->fileid);	p = xdr_decode_nfstime3(p, &fattr->atime);	p = xdr_decode_nfstime3(p, &fattr->mtime);	xdr_decode_nfstime3(p, &fattr->ctime);	fattr->valid |= NFS_ATTR_FATTR_V3;	return 0;out_overflow:	print_overflow_msg(__func__, xdr);	return -EIO;}
开发者ID:Albinoman887,项目名称:pyramid-3.4.10,代码行数:34,


示例7: nfs3svc_decode_readdirplusargs

intnfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p){	struct nfsd3_readdirargs *args = rqstp->rq_argp;	int len;	u32 max_blocksize = svc_max_payload(rqstp);	p = decode_fh(p, &args->fh);	if (!p)		return 0;	p = xdr_decode_hyper(p, &args->cookie);	args->verf     = p; p += 2;	args->dircount = ntohl(*p++);	args->count    = ntohl(*p++);	len = args->count = min(args->count, max_blocksize);	while (len > 0) {		struct page *p = *(rqstp->rq_next_page++);		if (!args->buffer)			args->buffer = page_address(p);		len -= PAGE_SIZE;	}	return xdr_argsize_check(rqstp, p);}
开发者ID:Anjali05,项目名称:linux,代码行数:25,


示例8: nfs3svc_decode_readargs

intnfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p){	struct nfsd3_readargs *args = rqstp->rq_argp;	unsigned int len;	int v;	u32 max_blocksize = svc_max_payload(rqstp);	p = decode_fh(p, &args->fh);	if (!p)		return 0;	p = xdr_decode_hyper(p, &args->offset);	args->count = ntohl(*p++);	len = min(args->count, max_blocksize);	/* set up the kvec */	v=0;	while (len > 0) {		struct page *p = *(rqstp->rq_next_page++);		rqstp->rq_vec[v].iov_base = page_address(p);		rqstp->rq_vec[v].iov_len = min_t(unsigned int, len, PAGE_SIZE);		len -= rqstp->rq_vec[v].iov_len;		v++;	}	args->vlen = v;	return xdr_argsize_check(rqstp, p);}
开发者ID:Anjali05,项目名称:linux,代码行数:29,


示例9: decode_nlm4_holder

static int decode_nlm4_holder(struct xdr_stream *xdr, struct nlm_res *result){	struct nlm_lock *lock = &result->lock;	struct file_lock *fl = &lock->fl;	u64 l_offset, l_len;	u32 exclusive;	int error;	__be32 *p;	s32 end;	memset(lock, 0, sizeof(*lock));	locks_init_lock(fl);	p = xdr_inline_decode(xdr, 4 + 4);	if (unlikely(p == NULL))		goto out_overflow;	exclusive = be32_to_cpup(p++);	lock->svid = be32_to_cpup(p);	fl->fl_pid = (pid_t)lock->svid;	error = decode_netobj(xdr, &lock->oh);	if (unlikely(error))		goto out;	p = xdr_inline_decode(xdr, 8 + 8);	if (unlikely(p == NULL))		goto out_overflow;	fl->fl_flags = FL_POSIX;	fl->fl_type  = exclusive != 0 ? F_WRLCK : F_RDLCK;	p = xdr_decode_hyper(p, &l_offset);	xdr_decode_hyper(p, &l_len);	end = l_offset + l_len - 1;	fl->fl_start = (loff_t)l_offset;	if (l_len == 0 || end < 0)		fl->fl_end = OFFSET_MAX;	else		fl->fl_end = (loff_t)end;	error = 0;out:	return error;out_overflow:	print_overflow_msg(__func__, xdr);	return -EIO;}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:46,


示例10: xdr_decode_wcc_attr

static inline u32 *xdr_decode_wcc_attr(u32 *p, struct nfs_fattr *fattr){	p = xdr_decode_hyper(p, &fattr->pre_size);	p = xdr_decode_time3(p, &fattr->pre_mtime);	p = xdr_decode_time3(p, &fattr->pre_ctime);	fattr->valid |= NFS_ATTR_WCC;	return p;}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:9,


示例11: gssx_dec_status

static int gssx_dec_status(struct xdr_stream *xdr,			   struct gssx_status *status){	__be32 *p;	int err;	/* status->major_status */	p = xdr_inline_decode(xdr, 8);	if (unlikely(p == NULL))		return -ENOSPC;	p = xdr_decode_hyper(p, &status->major_status);	/* status->mech */	err = gssx_dec_buffer(xdr, &status->mech);	if (err)		return err;	/* status->minor_status */	p = xdr_inline_decode(xdr, 8);	if (unlikely(p == NULL))		return -ENOSPC;	p = xdr_decode_hyper(p, &status->minor_status);	/* status->major_status_string */	err = gssx_dec_buffer(xdr, &status->major_status_string);	if (err)		return err;	/* status->minor_status_string */	err = gssx_dec_buffer(xdr, &status->minor_status_string);	if (err)		return err;	/* status->server_ctx */	err = gssx_dec_buffer(xdr, &status->server_ctx);	if (err)		return err;	/* we assume we have no options for now, so simply consume them */	/* status->options */	err = dummy_dec_opt_array(xdr, &status->options);	return err;}
开发者ID:Lyude,项目名称:linux,代码行数:44,


示例12: decode_layoutrecall_args

static __be32 decode_layoutrecall_args(struct svc_rqst *rqstp,				       struct xdr_stream *xdr, void *argp){	struct cb_layoutrecallargs *args = argp;	__be32 *p;	__be32 status = 0;	uint32_t iomode;	p = read_buf(xdr, 4 * sizeof(uint32_t));	if (unlikely(p == NULL))		return htonl(NFS4ERR_BADXDR);	args->cbl_layout_type = ntohl(*p++);	/* Depite the spec's xdr, iomode really belongs in the FILE switch,	 * as it is unusable and ignored with the other types.	 */	iomode = ntohl(*p++);	args->cbl_layoutchanged = ntohl(*p++);	args->cbl_recall_type = ntohl(*p++);	if (args->cbl_recall_type == RETURN_FILE) {		args->cbl_range.iomode = iomode;		status = decode_fh(xdr, &args->cbl_fh);		if (unlikely(status != 0))			return status;		p = read_buf(xdr, 2 * sizeof(uint64_t));		if (unlikely(p == NULL))			return htonl(NFS4ERR_BADXDR);		p = xdr_decode_hyper(p, &args->cbl_range.offset);		p = xdr_decode_hyper(p, &args->cbl_range.length);		return decode_layout_stateid(xdr, &args->cbl_stateid);	} else if (args->cbl_recall_type == RETURN_FSID) {		p = read_buf(xdr, 2 * sizeof(uint64_t));		if (unlikely(p == NULL))			return htonl(NFS4ERR_BADXDR);		p = xdr_decode_hyper(p, &args->cbl_fsid.major);		p = xdr_decode_hyper(p, &args->cbl_fsid.minor);	} else if (args->cbl_recall_type != RETURN_ALL)		return htonl(NFS4ERR_BADXDR);	return 0;}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:42,


示例13: nfs3svc_decode_commitargs

intnfs3svc_decode_commitargs(struct svc_rqst *rqstp, u32 *p,					struct nfsd3_commitargs *args){	if (!(p = decode_fh(p, &args->fh)))		return 0;	p = xdr_decode_hyper(p, &args->offset);	args->count = ntohl(*p++);	return xdr_argsize_check(rqstp, p);}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:11,


示例14: nfs3svc_decode_commitargs

intnfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p){	struct nfsd3_commitargs *args = rqstp->rq_argp;	p = decode_fh(p, &args->fh);	if (!p)		return 0;	p = xdr_decode_hyper(p, &args->offset);	args->count = ntohl(*p++);	return xdr_argsize_check(rqstp, p);}
开发者ID:Anjali05,项目名称:linux,代码行数:12,


示例15: nfs3svc_decode_readdirplusargs

intnfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, u32 *p,					struct nfsd3_readdirargs *args){	if (!(p = decode_fh(p, &args->fh)))		return 0;	p = xdr_decode_hyper(p, &args->cookie);	args->verf     = p; p += 2;	args->dircount = ntohl(*p++);	args->count    = ntohl(*p++);	return xdr_argsize_check(rqstp, p);}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:13,


示例16: decode_uint64

static int decode_uint64(struct xdr_stream *xdr, u64 *value){	__be32 *p;	p = xdr_inline_decode(xdr, 8);	if (unlikely(p == NULL))		goto out_overflow;	xdr_decode_hyper(p, value);	return 0;out_overflow:	print_overflow_msg(__func__, xdr);	return -EIO;}
开发者ID:Albinoman887,项目名称:pyramid-3.4.10,代码行数:13,


示例17: nfs3svc_decode_writeargs

intnfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p){	struct nfsd3_writeargs *args = rqstp->rq_argp;	unsigned int len, hdr, dlen;	u32 max_blocksize = svc_max_payload(rqstp);	struct kvec *head = rqstp->rq_arg.head;	struct kvec *tail = rqstp->rq_arg.tail;	p = decode_fh(p, &args->fh);	if (!p)		return 0;	p = xdr_decode_hyper(p, &args->offset);	args->count = ntohl(*p++);	args->stable = ntohl(*p++);	len = args->len = ntohl(*p++);	if ((void *)p > head->iov_base + head->iov_len)		return 0;	/*	 * The count must equal the amount of data passed.	 */	if (args->count != args->len)		return 0;	/*	 * Check to make sure that we got the right number of	 * bytes.	 */	hdr = (void*)p - head->iov_base;	dlen = head->iov_len + rqstp->rq_arg.page_len + tail->iov_len - hdr;	/*	 * Round the length of the data which was specified up to	 * the next multiple of XDR units and then compare that	 * against the length which was actually received.	 * Note that when RPCSEC/GSS (for example) is used, the	 * data buffer can be padded so dlen might be larger	 * than required.  It must never be smaller.	 */	if (dlen < XDR_QUADLEN(len)*4)		return 0;	if (args->count > max_blocksize) {		args->count = max_blocksize;		len = args->len = max_blocksize;	}	args->first.iov_base = (void *)p;	args->first.iov_len = head->iov_len - hdr;	return 1;}
开发者ID:Anjali05,项目名称:linux,代码行数:51,


示例18: xdr_decode_fattr

static u32 *xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr){    unsigned int	type, major, minor;    int		fmode;    type = ntohl(*p++);    if (type >= NF3BAD)        type = NF3BAD;    fmode = nfs_type2fmt[type].mode;    fattr->type = nfs_type2fmt[type].nfs2type;    fattr->mode = (ntohl(*p++) & ~S_IFMT) | fmode;    fattr->nlink = ntohl(*p++);    fattr->uid = ntohl(*p++);    fattr->gid = ntohl(*p++);    p = xdr_decode_hyper(p, &fattr->size);    p = xdr_decode_hyper(p, &fattr->du.nfs3.used);    /* Turn remote device info into Linux-specific dev_t */    major = ntohl(*p++);    minor = ntohl(*p++);    fattr->rdev = MKDEV(major, minor);    if (MAJOR(fattr->rdev) != major || MINOR(fattr->rdev) != minor)        fattr->rdev = 0;    p = xdr_decode_hyper(p, &fattr->fsid_u.nfs3);    p = xdr_decode_hyper(p, &fattr->fileid);    p = xdr_decode_time3(p, &fattr->atime);    p = xdr_decode_time3(p, &fattr->mtime);    p = xdr_decode_time3(p, &fattr->ctime);    /* Update the mode bits */    fattr->valid |= (NFS_ATTR_FATTR | NFS_ATTR_FATTR_V3);    fattr->timestamp = jiffies;    return p;}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:36,


示例19: nfs3svc_decode_writeargs

intnfs3svc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,					struct nfsd3_writeargs *args){	if (!(p = decode_fh(p, &args->fh))	 || !(p = xdr_decode_hyper(p, &args->offset)))		return 0;	args->count = ntohl(*p++);	args->stable = ntohl(*p++);	args->len = ntohl(*p++);	args->data = (char *) p;	p += XDR_QUADLEN(args->len);	return xdr_argsize_check(rqstp, p);}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:16,


示例20: nfs3svc_decode_readdirargs

intnfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p){	struct nfsd3_readdirargs *args = rqstp->rq_argp;	u32 max_blocksize = svc_max_payload(rqstp);	p = decode_fh(p, &args->fh);	if (!p)		return 0;	p = xdr_decode_hyper(p, &args->cookie);	args->verf   = p; p += 2;	args->dircount = ~0;	args->count  = ntohl(*p++);	args->count  = min_t(u32, args->count, max_blocksize);	args->buffer = page_address(*(rqstp->rq_next_page++));	return xdr_argsize_check(rqstp, p);}
开发者ID:Anjali05,项目名称:linux,代码行数:18,


示例21: decode_sattr3

static inline u32 *decode_sattr3(u32 *p, struct iattr *iap){	u32	tmp;	iap->ia_valid = 0;	if (*p++) {		iap->ia_valid |= ATTR_MODE;		iap->ia_mode = ntohl(*p++);	}	if (*p++) {		iap->ia_valid |= ATTR_UID;		iap->ia_uid = ntohl(*p++);	}	if (*p++) {		iap->ia_valid |= ATTR_GID;		iap->ia_gid = ntohl(*p++);	}	if (*p++) {		u64	newsize;		iap->ia_valid |= ATTR_SIZE;		p = xdr_decode_hyper(p, &newsize);		if (newsize <= NFS_OFFSET_MAX)			iap->ia_size = newsize;		else			iap->ia_size = NFS_OFFSET_MAX;	}	if ((tmp = ntohl(*p++)) == 1) {	/* set to server time */		iap->ia_valid |= ATTR_ATIME;	} else if (tmp == 2) {		/* set to client time */		iap->ia_valid |= ATTR_ATIME | ATTR_ATIME_SET;		iap->ia_atime = ntohl(*p++), p++;	}	if ((tmp = ntohl(*p++)) == 1) {	/* set to server time */		iap->ia_valid |= ATTR_MTIME;	} else if (tmp == 2) {		/* set to client time */		iap->ia_valid |= ATTR_MTIME | ATTR_MTIME_SET;		iap->ia_mtime = ntohl(*p++), p++;	}	return p;}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:43,


示例22: return

/* * Decodes a write chunk list. The expected format is as follows: *    descrim  : xdr_one *    nchunks  : <count> *       handle   : u32 RKEY              ---+ *       length   : u32 <len of segment>     | *       offset   : remove va                + <count> *       . . .                               | *                                        ---+ */static u32 *decode_write_list(u32 *va, u32 *vaend){	int ch_no;	struct rpcrdma_write_array *ary =		(struct rpcrdma_write_array *)va;	/* Check for not write-array */	if (ary->wc_discrim == xdr_zero)		return (u32 *)&ary->wc_nchunks;	if ((unsigned long)ary + sizeof(struct rpcrdma_write_array) >	    (unsigned long)vaend) {;		return NULL;	}	ary->wc_discrim = ntohl(ary->wc_discrim);	ary->wc_nchunks = ntohl(ary->wc_nchunks);	if (((unsigned long)&ary->wc_array[0] +	     (sizeof(struct rpcrdma_write_chunk) * ary->wc_nchunks)) >	    (unsigned long)vaend) {//		dprintk("svcrdma: ary=%p, wc_nchunks=%d, vaend=%p/n",;		return NULL;	}	for (ch_no = 0; ch_no < ary->wc_nchunks; ch_no++) {		u64 ch_offset;		ary->wc_array[ch_no].wc_target.rs_handle =			ntohl(ary->wc_array[ch_no].wc_target.rs_handle);		ary->wc_array[ch_no].wc_target.rs_length =			ntohl(ary->wc_array[ch_no].wc_target.rs_length);		va = (u32 *)&ary->wc_array[ch_no].wc_target.rs_offset;		xdr_decode_hyper(va, &ch_offset);		put_unaligned(ch_offset, (u64 *)va);	}	/*	 * rs_length is the 2nd 4B field in wc_target and taking its	 * address skips the list terminator	 */	return (u32 *)&ary->wc_array[ch_no].wc_target.rs_length;}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:52,


示例23: _osd_xdr_decode_data_map

static __be32 *_osd_xdr_decode_data_map(__be32 *p, struct pnfs_osd_data_map *data_map){	data_map->odm_num_comps = be32_to_cpup(p++);	p = xdr_decode_hyper(p, &data_map->odm_stripe_unit);	data_map->odm_group_width = be32_to_cpup(p++);	data_map->odm_group_depth = be32_to_cpup(p++);	data_map->odm_mirror_cnt = be32_to_cpup(p++);	data_map->odm_raid_algorithm = be32_to_cpup(p++);	dprintk("%s: odm_num_comps=%u odm_stripe_unit=%llu odm_group_width=%u "		"odm_group_depth=%u odm_mirror_cnt=%u odm_raid_algorithm=%u/n",		__func__,		data_map->odm_num_comps,		(unsigned long long)data_map->odm_stripe_unit,		data_map->odm_group_width,		data_map->odm_group_depth,		data_map->odm_mirror_cnt,		data_map->odm_raid_algorithm);	return p;}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:20,


示例24: nfs4_xdr_enc_seek

/* * Encode SEEK request */static void nfs4_xdr_enc_seek(struct rpc_rqst *req,			      struct xdr_stream *xdr,			      struct nfs42_seek_args *args){	struct compound_hdr hdr = {		.minorversion = nfs4_xdr_minorversion(&args->seq_args),	};	encode_compound_hdr(xdr, req, &hdr);	encode_sequence(xdr, &args->seq_args, &hdr);	encode_putfh(xdr, args->sa_fh, &hdr);	encode_seek(xdr, args, &hdr);	encode_nops(&hdr);}static int decode_seek(struct xdr_stream *xdr, struct nfs42_seek_res *res){	int status;	__be32 *p;	status = decode_op_hdr(xdr, OP_SEEK);	if (status)		return status;	p = xdr_inline_decode(xdr, 4 + 8);	if (unlikely(!p))		goto out_overflow;	res->sr_eof = be32_to_cpup(p++);	p = xdr_decode_hyper(p, &res->sr_offset);	return 0;out_overflow:	print_overflow_msg(__func__, xdr);	return -EIO;}
开发者ID:3null,项目名称:linux,代码行数:39,


示例25: while

/* * Decodes a read chunk list. The expected format is as follows: *    descrim  : xdr_one *    position : u32 offset into XDR stream *    handle   : u32 RKEY *    . . . *  end-of-list: xdr_zero */static u32 *decode_read_list(u32 *va, u32 *vaend){	struct rpcrdma_read_chunk *ch = (struct rpcrdma_read_chunk *)va;	while (ch->rc_discrim != xdr_zero) {		u64 ch_offset;		if (((unsigned long)ch + sizeof(struct rpcrdma_read_chunk)) >		    (unsigned long)vaend) {;			return NULL;		}		ch->rc_discrim = ntohl(ch->rc_discrim);		ch->rc_position = ntohl(ch->rc_position);		ch->rc_target.rs_handle = ntohl(ch->rc_target.rs_handle);		ch->rc_target.rs_length = ntohl(ch->rc_target.rs_length);		va = (u32 *)&ch->rc_target.rs_offset;		xdr_decode_hyper(va, &ch_offset);		put_unaligned(ch_offset, (u64 *)va);		ch++;	}	return (u32 *)&ch->rc_position;}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:32,


示例26: rdma_read_chunks

static int rdma_read_chunks(struct svcxprt_rdma *xprt,			    struct rpcrdma_msg *rmsgp,			    struct svc_rqst *rqstp,			    struct svc_rdma_op_ctxt *head){	int page_no, ch_count, ret;	struct rpcrdma_read_chunk *ch;	u32 page_offset, byte_count;	u64 rs_offset;	rdma_reader_fn reader;	/* If no read list is present, return 0 */	ch = svc_rdma_get_read_chunk(rmsgp);	if (!ch)		return 0;	svc_rdma_rcl_chunk_counts(ch, &ch_count, &byte_count);	if (ch_count > RPCSVC_MAXPAGES)		return -EINVAL;	/* The request is completed when the RDMA_READs complete. The	 * head context keeps all the pages that comprise the	 * request.	 */	head->arg.head[0] = rqstp->rq_arg.head[0];	head->arg.tail[0] = rqstp->rq_arg.tail[0];	head->arg.pages = &head->pages[head->count];	head->hdr_count = head->count;	head->arg.page_base = 0;	head->arg.page_len = 0;	head->arg.len = rqstp->rq_arg.len;	head->arg.buflen = rqstp->rq_arg.buflen;	/* Use FRMR if supported */	if (xprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG)		reader = rdma_read_chunk_frmr;	else		reader = rdma_read_chunk_lcl;	page_no = 0; page_offset = 0;	for (ch = (struct rpcrdma_read_chunk *)&rmsgp->rm_body.rm_chunks[0];	     ch->rc_discrim != 0; ch++) {		xdr_decode_hyper((__be32 *)&ch->rc_target.rs_offset,				 &rs_offset);		byte_count = ntohl(ch->rc_target.rs_length);		while (byte_count > 0) {			ret = reader(xprt, rqstp, head,				     &page_no, &page_offset,				     ntohl(ch->rc_target.rs_handle),				     byte_count, rs_offset,				     ((ch+1)->rc_discrim == 0) /* last */				     );			if (ret < 0)				goto err;			byte_count -= ret;			rs_offset += ret;			head->arg.buflen += ret;		}	}	ret = 1; err:	/* Detach arg pages. svc_recv will replenish them */	for (page_no = 0;	     &rqstp->rq_pages[page_no] < rqstp->rq_respages; page_no++)		rqstp->rq_pages[page_no] = NULL;	return ret;}
开发者ID:antiguru,项目名称:ofed-compat-rdma,代码行数:70,



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


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