diff options
author | Eric Van Hensbergen <ericvh@gmail.com> | 2008-10-13 21:36:16 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2008-10-17 12:04:43 -0400 |
commit | fbedadc16e5c888e4df9df3b1757de4993508d35 (patch) | |
tree | c477daf52f7a8aa2c2a0c9902b1711b6c2d32833 /net/9p/client.c | |
parent | 0fc9655ec67ec5d4dfd08e469e0e9f0a494bf5bc (diff) |
9p: move readn meta-function from client to fs layer
There are a couple of methods in the client code which aren't actually
wire operations. To keep things organized cleaner, these operations are
being moved to the fs layer.
This patch moves the readn meta-function (which executes multiple wire
reads until a buffer is full) to the fs layer.
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/client.c')
-rw-r--r-- | net/9p/client.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 5fc3aa1eb39b..d5ea042eabb0 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1150,32 +1150,6 @@ error: | |||
1150 | } | 1150 | } |
1151 | EXPORT_SYMBOL(p9_client_write); | 1151 | EXPORT_SYMBOL(p9_client_write); |
1152 | 1152 | ||
1153 | int p9_client_readn(struct p9_fid *fid, char *data, u64 offset, u32 count) | ||
1154 | { | ||
1155 | int n, total; | ||
1156 | |||
1157 | P9_DPRINTK(P9_DEBUG_9P, "fid %d offset %llu count %d\n", fid->fid, | ||
1158 | (long long unsigned) offset, count); | ||
1159 | n = 0; | ||
1160 | total = 0; | ||
1161 | while (count) { | ||
1162 | n = p9_client_read(fid, data, NULL, offset, count); | ||
1163 | if (n <= 0) | ||
1164 | break; | ||
1165 | |||
1166 | data += n; | ||
1167 | offset += n; | ||
1168 | count -= n; | ||
1169 | total += n; | ||
1170 | } | ||
1171 | |||
1172 | if (n < 0) | ||
1173 | total = n; | ||
1174 | |||
1175 | return total; | ||
1176 | } | ||
1177 | EXPORT_SYMBOL(p9_client_readn); | ||
1178 | |||
1179 | static struct p9_stat *p9_clone_stat(struct p9_stat *st, int dotu) | 1153 | static struct p9_stat *p9_clone_stat(struct p9_stat *st, int dotu) |
1180 | { | 1154 | { |
1181 | int n; | 1155 | int n; |