diff options
Diffstat (limited to 'net/sunrpc/rpc_pipe.c')
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 3b62cf288031..21fde99e5c56 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -71,7 +71,9 @@ static void rpc_purge_list(wait_queue_head_t *waitq, struct list_head *head, | |||
71 | msg->errno = err; | 71 | msg->errno = err; |
72 | destroy_msg(msg); | 72 | destroy_msg(msg); |
73 | } while (!list_empty(head)); | 73 | } while (!list_empty(head)); |
74 | wake_up(waitq); | 74 | |
75 | if (waitq) | ||
76 | wake_up(waitq); | ||
75 | } | 77 | } |
76 | 78 | ||
77 | static void | 79 | static void |
@@ -91,11 +93,9 @@ rpc_timeout_upcall_queue(struct work_struct *work) | |||
91 | } | 93 | } |
92 | dentry = dget(pipe->dentry); | 94 | dentry = dget(pipe->dentry); |
93 | spin_unlock(&pipe->lock); | 95 | spin_unlock(&pipe->lock); |
94 | if (dentry) { | 96 | rpc_purge_list(dentry ? &RPC_I(dentry->d_inode)->waitq : NULL, |
95 | rpc_purge_list(&RPC_I(dentry->d_inode)->waitq, | 97 | &free_list, destroy_msg, -ETIMEDOUT); |
96 | &free_list, destroy_msg, -ETIMEDOUT); | 98 | dput(dentry); |
97 | dput(dentry); | ||
98 | } | ||
99 | } | 99 | } |
100 | 100 | ||
101 | ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg, | 101 | ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg, |
@@ -120,7 +120,7 @@ EXPORT_SYMBOL_GPL(rpc_pipe_generic_upcall); | |||
120 | 120 | ||
121 | /** | 121 | /** |
122 | * rpc_queue_upcall - queue an upcall message to userspace | 122 | * rpc_queue_upcall - queue an upcall message to userspace |
123 | * @inode: inode of upcall pipe on which to queue given message | 123 | * @pipe: upcall pipe on which to queue given message |
124 | * @msg: message to queue | 124 | * @msg: message to queue |
125 | * | 125 | * |
126 | * Call with an @inode created by rpc_mkpipe() to queue an upcall. | 126 | * Call with an @inode created by rpc_mkpipe() to queue an upcall. |
@@ -819,9 +819,7 @@ static int rpc_rmdir_depopulate(struct dentry *dentry, | |||
819 | * @parent: dentry of directory to create new "pipe" in | 819 | * @parent: dentry of directory to create new "pipe" in |
820 | * @name: name of pipe | 820 | * @name: name of pipe |
821 | * @private: private data to associate with the pipe, for the caller's use | 821 | * @private: private data to associate with the pipe, for the caller's use |
822 | * @ops: operations defining the behavior of the pipe: upcall, downcall, | 822 | * @pipe: &rpc_pipe containing input parameters |
823 | * release_pipe, open_pipe, and destroy_msg. | ||
824 | * @flags: rpc_pipe flags | ||
825 | * | 823 | * |
826 | * Data is made available for userspace to read by calls to | 824 | * Data is made available for userspace to read by calls to |
827 | * rpc_queue_upcall(). The actual reads will result in calls to | 825 | * rpc_queue_upcall(). The actual reads will result in calls to |
@@ -943,7 +941,7 @@ struct dentry *rpc_create_client_dir(struct dentry *dentry, | |||
943 | 941 | ||
944 | /** | 942 | /** |
945 | * rpc_remove_client_dir - Remove a directory created with rpc_create_client_dir() | 943 | * rpc_remove_client_dir - Remove a directory created with rpc_create_client_dir() |
946 | * @clnt: rpc client | 944 | * @dentry: dentry for the pipe |
947 | */ | 945 | */ |
948 | int rpc_remove_client_dir(struct dentry *dentry) | 946 | int rpc_remove_client_dir(struct dentry *dentry) |
949 | { | 947 | { |
@@ -1059,12 +1057,9 @@ static const struct rpc_filelist files[] = { | |||
1059 | struct dentry *rpc_d_lookup_sb(const struct super_block *sb, | 1057 | struct dentry *rpc_d_lookup_sb(const struct super_block *sb, |
1060 | const unsigned char *dir_name) | 1058 | const unsigned char *dir_name) |
1061 | { | 1059 | { |
1062 | struct qstr dir = { | 1060 | struct qstr dir = QSTR_INIT(dir_name, strlen(dir_name)); |
1063 | .name = dir_name, | ||
1064 | .len = strlen(dir_name), | ||
1065 | .hash = full_name_hash(dir_name, strlen(dir_name)), | ||
1066 | }; | ||
1067 | 1061 | ||
1062 | dir.hash = full_name_hash(dir.name, dir.len); | ||
1068 | return d_lookup(sb->s_root, &dir); | 1063 | return d_lookup(sb->s_root, &dir); |
1069 | } | 1064 | } |
1070 | EXPORT_SYMBOL_GPL(rpc_d_lookup_sb); | 1065 | EXPORT_SYMBOL_GPL(rpc_d_lookup_sb); |
@@ -1118,7 +1113,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) | |||
1118 | sb->s_op = &s_ops; | 1113 | sb->s_op = &s_ops; |
1119 | sb->s_time_gran = 1; | 1114 | sb->s_time_gran = 1; |
1120 | 1115 | ||
1121 | inode = rpc_get_inode(sb, S_IFDIR | 0755); | 1116 | inode = rpc_get_inode(sb, S_IFDIR | S_IRUGO | S_IXUGO); |
1122 | sb->s_root = root = d_make_root(inode); | 1117 | sb->s_root = root = d_make_root(inode); |
1123 | if (!root) | 1118 | if (!root) |
1124 | return -ENOMEM; | 1119 | return -ENOMEM; |