projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wrappers for ->i_mutex access
[deliverable/linux.git]
/
net
/
sunrpc
/
rpc_pipe.c
diff --git
a/net/sunrpc/rpc_pipe.c
b/net/sunrpc/rpc_pipe.c
index 14f45bf0410c688b25fafedfb6636cfa025ad06c..31789ef3e614484a4d5c75721d4b9f63fc735f6a 100644
(file)
--- a/
net/sunrpc/rpc_pipe.c
+++ b/
net/sunrpc/rpc_pipe.c
@@
-172,7
+172,7
@@
rpc_close_pipes(struct inode *inode)
int need_release;
LIST_HEAD(free_list);
int need_release;
LIST_HEAD(free_list);
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
spin_lock(&pipe->lock);
need_release = pipe->nreaders != 0 || pipe->nwriters != 0;
pipe->nreaders = 0;
spin_lock(&pipe->lock);
need_release = pipe->nreaders != 0 || pipe->nwriters != 0;
pipe->nreaders = 0;
@@
-188,7
+188,7
@@
rpc_close_pipes(struct inode *inode)
cancel_delayed_work_sync(&pipe->queue_timeout);
rpc_inode_setowner(inode, NULL);
RPC_I(inode)->pipe = NULL;
cancel_delayed_work_sync(&pipe->queue_timeout);
rpc_inode_setowner(inode, NULL);
RPC_I(inode)->pipe = NULL;
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
}
static struct inode *
}
static struct inode *
@@
-221,7
+221,7
@@
rpc_pipe_open(struct inode *inode, struct file *filp)
int first_open;
int res = -ENXIO;
int first_open;
int res = -ENXIO;
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
pipe = RPC_I(inode)->pipe;
if (pipe == NULL)
goto out;
pipe = RPC_I(inode)->pipe;
if (pipe == NULL)
goto out;
@@
-237,7
+237,7
@@
rpc_pipe_open(struct inode *inode, struct file *filp)
pipe->nwriters++;
res = 0;
out:
pipe->nwriters++;
res = 0;
out:
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
return res;
}
return res;
}
@@
-248,7
+248,7
@@
rpc_pipe_release(struct inode *inode, struct file *filp)
struct rpc_pipe_msg *msg;
int last_close;
struct rpc_pipe_msg *msg;
int last_close;
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
pipe = RPC_I(inode)->pipe;
if (pipe == NULL)
goto out;
pipe = RPC_I(inode)->pipe;
if (pipe == NULL)
goto out;
@@
-278,7
+278,7
@@
rpc_pipe_release(struct inode *inode, struct file *filp)
if (last_close && pipe->ops->release_pipe)
pipe->ops->release_pipe(inode);
out:
if (last_close && pipe->ops->release_pipe)
pipe->ops->release_pipe(inode);
out:
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
return 0;
}
return 0;
}
@@
-290,7
+290,7
@@
rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset)
struct rpc_pipe_msg *msg;
int res = 0;
struct rpc_pipe_msg *msg;
int res = 0;
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
pipe = RPC_I(inode)->pipe;
if (pipe == NULL) {
res = -EPIPE;
pipe = RPC_I(inode)->pipe;
if (pipe == NULL) {
res = -EPIPE;
@@
-322,7
+322,7
@@
rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset)
pipe->ops->destroy_msg(msg);
}
out_unlock:
pipe->ops->destroy_msg(msg);
}
out_unlock:
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
return res;
}
return res;
}
@@
-332,11
+332,11
@@
rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *of
struct inode *inode = file_inode(filp);
int res;
struct inode *inode = file_inode(filp);
int res;
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
res = -EPIPE;
if (RPC_I(inode)->pipe != NULL)
res = RPC_I(inode)->pipe->ops->downcall(filp, buf, len);
res = -EPIPE;
if (RPC_I(inode)->pipe != NULL)
res = RPC_I(inode)->pipe->ops->downcall(filp, buf, len);
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
return res;
}
return res;
}
@@
-349,12
+349,12
@@
rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
poll_wait(filp, &rpci->waitq, wait);
poll_wait(filp, &rpci->waitq, wait);
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
if (rpci->pipe == NULL)
mask |= POLLERR | POLLHUP;
else if (filp->private_data || !list_empty(&rpci->pipe->pipe))
mask |= POLLIN | POLLRDNORM;
if (rpci->pipe == NULL)
mask |= POLLERR | POLLHUP;
else if (filp->private_data || !list_empty(&rpci->pipe->pipe))
mask |= POLLIN | POLLRDNORM;
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
return mask;
}
return mask;
}
@@
-367,10
+367,10
@@
rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
switch (cmd) {
case FIONREAD:
switch (cmd) {
case FIONREAD:
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
pipe = RPC_I(inode)->pipe;
if (pipe == NULL) {
pipe = RPC_I(inode)->pipe;
if (pipe == NULL) {
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
return -EPIPE;
}
spin_lock(&pipe->lock);
return -EPIPE;
}
spin_lock(&pipe->lock);
@@
-381,7
+381,7
@@
rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
len += msg->len - msg->copied;
}
spin_unlock(&pipe->lock);
len += msg->len - msg->copied;
}
spin_unlock(&pipe->lock);
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
return put_user(len, (int __user *)arg);
default:
return -EINVAL;
return put_user(len, (int __user *)arg);
default:
return -EINVAL;
@@
-617,9
+617,9
@@
int rpc_rmdir(struct dentry *dentry)
parent = dget_parent(dentry);
dir = d_inode(parent);
parent = dget_parent(dentry);
dir = d_inode(parent);
-
mutex_lock_nested(&dir->i_mutex
, I_MUTEX_PARENT);
+
inode_lock_nested(dir
, I_MUTEX_PARENT);
error = __rpc_rmdir(dir, dentry);
error = __rpc_rmdir(dir, dentry);
-
mutex_unlock(&dir->i_mutex
);
+
inode_unlock(dir
);
dput(parent);
return error;
}
dput(parent);
return error;
}
@@
-701,9
+701,9
@@
static void rpc_depopulate(struct dentry *parent,
{
struct inode *dir = d_inode(parent);
{
struct inode *dir = d_inode(parent);
-
mutex_lock_nested(&dir->i_mutex
, I_MUTEX_CHILD);
+
inode_lock_nested(dir
, I_MUTEX_CHILD);
__rpc_depopulate(parent, files, start, eof);
__rpc_depopulate(parent, files, start, eof);
-
mutex_unlock(&dir->i_mutex
);
+
inode_unlock(dir
);
}
static int rpc_populate(struct dentry *parent,
}
static int rpc_populate(struct dentry *parent,
@@
-715,7
+715,7
@@
static int rpc_populate(struct dentry *parent,
struct dentry *dentry;
int i, err;
struct dentry *dentry;
int i, err;
-
mutex_lock(&dir->i_mutex
);
+
inode_lock(dir
);
for (i = start; i < eof; i++) {
dentry = __rpc_lookup_create_exclusive(parent, files[i].name);
err = PTR_ERR(dentry);
for (i = start; i < eof; i++) {
dentry = __rpc_lookup_create_exclusive(parent, files[i].name);
err = PTR_ERR(dentry);
@@
-739,11
+739,11
@@
static int rpc_populate(struct dentry *parent,
if (err != 0)
goto out_bad;
}
if (err != 0)
goto out_bad;
}
-
mutex_unlock(&dir->i_mutex
);
+
inode_unlock(dir
);
return 0;
out_bad:
__rpc_depopulate(parent, files, start, eof);
return 0;
out_bad:
__rpc_depopulate(parent, files, start, eof);
-
mutex_unlock(&dir->i_mutex
);
+
inode_unlock(dir
);
printk(KERN_WARNING "%s: %s failed to populate directory %pd\n",
__FILE__, __func__, parent);
return err;
printk(KERN_WARNING "%s: %s failed to populate directory %pd\n",
__FILE__, __func__, parent);
return err;
@@
-757,7
+757,7
@@
static struct dentry *rpc_mkdir_populate(struct dentry *parent,
struct inode *dir = d_inode(parent);
int error;
struct inode *dir = d_inode(parent);
int error;
-
mutex_lock_nested(&dir->i_mutex
, I_MUTEX_PARENT);
+
inode_lock_nested(dir
, I_MUTEX_PARENT);
dentry = __rpc_lookup_create_exclusive(parent, name);
if (IS_ERR(dentry))
goto out;
dentry = __rpc_lookup_create_exclusive(parent, name);
if (IS_ERR(dentry))
goto out;
@@
-770,7
+770,7
@@
static struct dentry *rpc_mkdir_populate(struct dentry *parent,
goto err_rmdir;
}
out:
goto err_rmdir;
}
out:
-
mutex_unlock(&dir->i_mutex
);
+
inode_unlock(dir
);
return dentry;
err_rmdir:
__rpc_rmdir(dir, dentry);
return dentry;
err_rmdir:
__rpc_rmdir(dir, dentry);
@@
-788,11
+788,11
@@
static int rpc_rmdir_depopulate(struct dentry *dentry,
parent = dget_parent(dentry);
dir = d_inode(parent);
parent = dget_parent(dentry);
dir = d_inode(parent);
-
mutex_lock_nested(&dir->i_mutex
, I_MUTEX_PARENT);
+
inode_lock_nested(dir
, I_MUTEX_PARENT);
if (depopulate != NULL)
depopulate(dentry);
error = __rpc_rmdir(dir, dentry);
if (depopulate != NULL)
depopulate(dentry);
error = __rpc_rmdir(dir, dentry);
-
mutex_unlock(&dir->i_mutex
);
+
inode_unlock(dir
);
dput(parent);
return error;
}
dput(parent);
return error;
}
@@
-828,7
+828,7
@@
struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name,
if (pipe->ops->downcall == NULL)
umode &= ~S_IWUGO;
if (pipe->ops->downcall == NULL)
umode &= ~S_IWUGO;
-
mutex_lock_nested(&dir->i_mutex
, I_MUTEX_PARENT);
+
inode_lock_nested(dir
, I_MUTEX_PARENT);
dentry = __rpc_lookup_create_exclusive(parent, name);
if (IS_ERR(dentry))
goto out;
dentry = __rpc_lookup_create_exclusive(parent, name);
if (IS_ERR(dentry))
goto out;
@@
-837,7
+837,7
@@
struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name,
if (err)
goto out_err;
out:
if (err)
goto out_err;
out:
-
mutex_unlock(&dir->i_mutex
);
+
inode_unlock(dir
);
return dentry;
out_err:
dentry = ERR_PTR(err);
return dentry;
out_err:
dentry = ERR_PTR(err);
@@
-865,9
+865,9
@@
rpc_unlink(struct dentry *dentry)
parent = dget_parent(dentry);
dir = d_inode(parent);
parent = dget_parent(dentry);
dir = d_inode(parent);
-
mutex_lock_nested(&dir->i_mutex
, I_MUTEX_PARENT);
+
inode_lock_nested(dir
, I_MUTEX_PARENT);
error = __rpc_rmpipe(dir, dentry);
error = __rpc_rmpipe(dir, dentry);
-
mutex_unlock(&dir->i_mutex
);
+
inode_unlock(dir
);
dput(parent);
return error;
}
dput(parent);
return error;
}
This page took
0.075194 seconds
and
5
git commands to generate.