本文整理汇总了C++中P9_DPRINTK函数的典型用法代码示例。如果您正苦于以下问题:C++ P9_DPRINTK函数的具体用法?C++ P9_DPRINTK怎么用?C++ P9_DPRINTK使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了P9_DPRINTK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: v9fs_cache_session_get_cookie
void v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses)
{
/* If no cache session tag was specified, we generate a random one. */
if (!v9ses->cachetag)
v9fs_random_cachetag(v9ses);
v9ses->fscache = fscache_acquire_cookie(v9fs_cache_netfs.primary_index,
&v9fs_cache_session_index_def,
v9ses);
P9_DPRINTK(P9_DEBUG_FSC, "session %p get cookie %p", v9ses,
v9ses->fscache);
}
示例2: v9fs_cache_inode_flush_cookie
void v9fs_cache_inode_flush_cookie(struct inode *inode)
{
struct v9fs_inode *v9inode = V9FS_I(inode);
if (!v9inode->fscache)
return;
P9_DPRINTK(P9_DEBUG_FSC, "inode %p flush cookie %p", inode,
v9inode->fscache);
fscache_relinquish_cookie(v9inode->fscache, 1);
v9inode->fscache = NULL;
}
示例3: p9_client_uwrite
int
p9_client_uwrite(struct p9_fid *fid, const char __user *data, u64 offset,
u32 count)
{
int err, n, rsize, total;
struct p9_fcall *tc, *rc;
struct p9_client *clnt;
P9_DPRINTK(P9_DEBUG_9P, "fid %d offset %llu count %d\n", fid->fid,
(long long unsigned) offset, count);
err = 0;
tc = NULL;
rc = NULL;
clnt = fid->clnt;
total = 0;
rsize = fid->iounit;
if (!rsize || rsize > clnt->msize-P9_IOHDRSZ)
rsize = clnt->msize - P9_IOHDRSZ;
do {
if (count < rsize)
rsize = count;
tc = p9_create_twrite_u(fid->fid, offset, rsize, data);
if (IS_ERR(tc)) {
err = PTR_ERR(tc);
tc = NULL;
goto error;
}
err = p9_conn_rpc(clnt->conn, tc, &rc);
if (err)
goto error;
n = rc->params.rread.count;
count -= n;
data += n;
offset += n;
total += n;
kfree(tc);
tc = NULL;
kfree(rc);
rc = NULL;
} while (count > 0);
return total;
error:
kfree(tc);
kfree(rc);
return err;
}
示例4: p9_client_open
int p9_client_open(struct p9_fid *fid, int mode)
{
int err;
struct p9_client *clnt;
struct p9_req_t *req;
struct p9_qid qid;
int iounit;
P9_DPRINTK(P9_DEBUG_9P, ">>> TOPEN fid %d mode %d\n", fid->fid, mode);
err = 0;
clnt = fid->clnt;
if (fid->mode != -1)
return -EINVAL;
req = p9_client_rpc(clnt, P9_TOPEN, "db", fid->fid, mode);
if (IS_ERR(req)) {
err = PTR_ERR(req);
goto error;
}
err = p9pdu_readf(req->rc, clnt->dotu, "Qd", &qid, &iounit);
if (err) {
p9pdu_dump(1, req->rc);
goto free_and_error;
}
P9_DPRINTK(P9_DEBUG_9P, "<<< ROPEN qid %x.%llx.%x iounit %x\n",
qid.type,
(unsigned long long)qid.path,
qid.version, iounit);
fid->mode = mode;
fid->iounit = iounit;
free_and_error:
p9_free_req(clnt, req);
error:
return err;
}
示例5: p9_client_version
int p9_client_version(struct p9_client *c)
{
int err = 0;
struct p9_req_t *req;
char *version;
int msize;
P9_DPRINTK(P9_DEBUG_9P, ">>> TVERSION msize %d extended %d\n",
c->msize, c->dotu);
req = p9_client_rpc(c, P9_TVERSION, "ds", c->msize,
c->dotu ? "9P2000.u" : "9P2000");
if (IS_ERR(req))
return PTR_ERR(req);
err = p9pdu_readf(req->rc, c->dotu, "ds", &msize, &version);
if (err) {
P9_DPRINTK(P9_DEBUG_9P, "version error %d\n", err);
p9pdu_dump(1, req->rc);
goto error;
}
P9_DPRINTK(P9_DEBUG_9P, "<<< RVERSION msize %d %s\n", msize, version);
if (!memcmp(version, "9P2000.u", 8))
c->dotu = 1;
else if (!memcmp(version, "9P2000", 6))
c->dotu = 0;
else {
err = -EREMOTEIO;
goto error;
}
if (msize < c->msize)
c->msize = msize;
error:
kfree(version);
p9_free_req(c, req);
return err;
}
示例6: v9fs_vfs_setattr_dotl
int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
{
int retval;
struct v9fs_session_info *v9ses;
struct p9_fid *fid;
struct p9_iattr_dotl p9attr;
P9_DPRINTK(P9_DEBUG_VFS, "\n");
retval = inode_change_ok(dentry->d_inode, iattr);
if (retval)
return retval;
p9attr.valid = iattr->ia_valid;
p9attr.mode = iattr->ia_mode;
p9attr.uid = iattr->ia_uid;
p9attr.gid = iattr->ia_gid;
p9attr.size = iattr->ia_size;
p9attr.atime_sec = iattr->ia_atime.tv_sec;
p9attr.atime_nsec = iattr->ia_atime.tv_nsec;
p9attr.mtime_sec = iattr->ia_mtime.tv_sec;
p9attr.mtime_nsec = iattr->ia_mtime.tv_nsec;
retval = -EPERM;
v9ses = v9fs_dentry2v9ses(dentry);
fid = v9fs_fid_lookup(dentry);
if (IS_ERR(fid))
return PTR_ERR(fid);
/* Write all dirty data */
if (S_ISREG(dentry->d_inode->i_mode))
filemap_write_and_wait(dentry->d_inode->i_mapping);
retval = p9_client_setattr(fid, &p9attr);
if (retval < 0)
return retval;
if ((iattr->ia_valid & ATTR_SIZE) &&
iattr->ia_size != i_size_read(dentry->d_inode))
truncate_setsize(dentry->d_inode, iattr->ia_size);
v9fs_invalidate_inode_attr(dentry->d_inode);
setattr_copy(dentry->d_inode, iattr);
mark_inode_dirty(dentry->d_inode);
if (iattr->ia_valid & ATTR_MODE) {
/* We also want to update ACL when we update mode bits */
retval = v9fs_acl_chmod(dentry);
if (retval < 0)
return retval;
}
return 0;
}
示例7: v9fs_dir_release
int v9fs_dir_release(struct inode *inode, struct file *filp)
{
struct p9_fid *fid;
fid = filp->private_data;
P9_DPRINTK(P9_DEBUG_VFS,
"v9fs_dir_release: inode: %p filp: %p fid: %d\n",
inode, filp, fid ? fid->fid : -1);
filemap_write_and_wait(inode->i_mapping);
if (fid)
p9_client_clunk(fid);
return 0;
}
示例8: v9fs_xattr_get
/*
* v9fs_xattr_get()
*
* Copy an extended attribute into the buffer
* provided, or compute the buffer size required.
* Buffer is NULL to compute the size of the buffer required.
*
* Returns a negative error number on failure, or the number of bytes
* used / required on success.
*/
ssize_t v9fs_xattr_get(struct dentry *dentry, const char *name,
void *buffer, size_t buffer_size)
{
struct p9_fid *fid;
P9_DPRINTK(P9_DEBUG_VFS, "%s: name = %s value_len = %zu\n",
__func__, name, buffer_size);
fid = v9fs_fid_lookup(dentry);
if (IS_ERR(fid))
return PTR_ERR(fid);
return v9fs_fid_xattr_get(fid, name, buffer, buffer_size);
}
示例9: p9_fid_destroy
static void p9_fid_destroy(struct p9_fid *fid)
{
struct p9_client *clnt;
unsigned long flags;
P9_DPRINTK(P9_DEBUG_FID, "fid %d\n", fid->fid);
clnt = fid->clnt;
p9_idpool_put(fid->fid, clnt->fidpool);
spin_lock_irqsave(&clnt->lock, flags);
list_del(&fid->flist);
spin_unlock_irqrestore(&clnt->lock, flags);
kfree(fid);
}
示例10: p9_fid_destroy
static void p9_fid_destroy(struct p9_fid *fid)
{
struct p9_client *clnt;
P9_DPRINTK(P9_DEBUG_9P, "fid %d\n", fid->fid);
clnt = fid->clnt;
p9_idpool_put(fid->fid, clnt->fidpool);
spin_lock(&clnt->lock);
list_del(&fid->flist);
spin_unlock(&clnt->lock);
kfree(fid->rdir_fcall);
kfree(fid);
}
示例11: v9fs_file_open
int v9fs_file_open(struct inode *inode, struct file *file)
{
int err;
struct v9fs_session_info *v9ses;
struct p9_fid *fid;
int omode;
P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p \n", inode, file);
v9ses = v9fs_inode2v9ses(inode);
omode = v9fs_uflags2omode(file->f_flags);
fid = file->private_data;
if (!fid) {
fid = v9fs_fid_clone(file->f_path.dentry);
if (IS_ERR(fid))
return PTR_ERR(fid);
err = p9_client_open(fid, omode);
if (err < 0) {
p9_client_clunk(fid);
return err;
}
if (omode & P9_OTRUNC) {
inode->i_size = 0;
inode->i_blocks = 0;
}
}
file->private_data = fid;
if ((fid->qid.version) && (v9ses->cache)) {
P9_DPRINTK(P9_DEBUG_VFS, "cached");
/* enable cached file options */
if(file->f_op == &v9fs_file_operations)
file->f_op = &v9fs_cached_file_operations;
}
return 0;
}
示例12: v9fs_fid_xattr_get
ssize_t v9fs_fid_xattr_get(struct p9_fid *fid, const char *name,
void *buffer, size_t buffer_size)
{
ssize_t retval;
int msize, read_count;
u64 offset = 0, attr_size;
struct p9_fid *attr_fid;
attr_fid = p9_client_xattrwalk(fid, name, &attr_size);
if (IS_ERR(attr_fid)) {
retval = PTR_ERR(attr_fid);
P9_DPRINTK(P9_DEBUG_VFS,
"p9_client_attrwalk failed %zd\n", retval);
attr_fid = NULL;
goto error;
}
if (!buffer_size) {
/* request to get the attr_size */
retval = attr_size;
goto error;
}
if (attr_size > buffer_size) {
retval = -ERANGE;
goto error;
}
msize = attr_fid->clnt->msize;
while (attr_size) {
if (attr_size > (msize - P9_IOHDRSZ))
read_count = msize - P9_IOHDRSZ;
else
read_count = attr_size;
read_count = p9_client_read(attr_fid, ((char *)buffer)+offset,
NULL, offset, read_count);
if (read_count < 0) {
/* error in xattr read */
retval = read_count;
goto error;
}
offset += read_count;
attr_size -= read_count;
}
/* Total read xattr bytes */
retval = offset;
error:
if (attr_fid)
p9_client_clunk(attr_fid);
return retval;
}
示例13: p9_check_errors
static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
{
int8_t type;
int err;
err = p9_parse_header(req->rc, NULL, &type, NULL, 0);
if (err) {
P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse header %d\n", err);
return err;
}
if (type == P9_RERROR) {
int ecode;
char *ename;
err = p9pdu_readf(req->rc, c->dotu, "s?d", &ename, &ecode);
if (err) {
P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n",
err);
return err;
}
if (c->dotu)
err = -ecode;
if (!err || !IS_ERR_VALUE(err))
err = p9_errstr2errno(ename, strlen(ename));
P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", -ecode, ename);
kfree(ename);
} else
err = 0;
return err;
}
示例14: v9fs_file_read
/**
* v9fs_file_read - read from a file
* @filep: file pointer to read
* @data: data buffer to read data into
* @count: size of buffer
* @offset: offset at which to read data
*
*/
static ssize_t
v9fs_file_read(struct file *filp, char __user * data, size_t count,
loff_t * offset)
{
int ret;
struct p9_fid *fid;
P9_DPRINTK(P9_DEBUG_VFS, "\n");
fid = filp->private_data;
ret = p9_client_uread(fid, data, *offset, count);
if (ret > 0)
*offset += ret;
return ret;
}
示例15: p9_free_req
static void p9_free_req(struct p9_client *c, struct p9_req_t *r)
{
int tag = r->tc->tag;
P9_DPRINTK(P9_DEBUG_MUX, "clnt %p req %p tag: %d\n", c, r, tag);
r->status = REQ_STATUS_IDLE;
if (tag != P9_NOTAG && p9_idpool_check(tag, c->tagpool))
p9_idpool_put(tag, c->tagpool);
/* if this was a flush request we have to free response fcall */
if (r->rc->id == P9_RFLUSH) {
kfree(r->tc);
kfree(r->rc);
}
}