Revision ffd66876
b/hw/9pfs/virtio-9p.c | ||
---|---|---|
117 | 117 |
return s->ops->chmod(&s->ctx, path->data, &cred); |
118 | 118 |
} |
119 | 119 |
|
120 |
static int v9fs_do_link(V9fsState *s, V9fsString *oldpath, V9fsString *newpath) |
|
121 |
{ |
|
122 |
return s->ops->link(&s->ctx, oldpath->data, newpath->data); |
|
123 |
} |
|
124 |
|
|
125 | 120 |
static int v9fs_do_truncate(V9fsState *s, V9fsString *path, off_t size) |
126 | 121 |
{ |
127 | 122 |
return s->ops->truncate(&s->ctx, path->data, size); |
... | ... | |
2029 | 2024 |
err = -EINVAL; |
2030 | 2025 |
goto out; |
2031 | 2026 |
} |
2032 |
err = v9fs_do_link(pdu->s, &nfidp->path, &fullname);
|
|
2027 |
err = v9fs_co_link(pdu->s, &nfidp->path, &fullname);
|
|
2033 | 2028 |
if (err < 0) { |
2034 |
err = -errno; |
|
2035 | 2029 |
goto out; |
2036 | 2030 |
} |
2037 | 2031 |
} else if (perm & P9_STAT_MODE_DEVICE) { |
... | ... | |
2169 | 2163 |
|
2170 | 2164 |
dfidp = lookup_fid(s, dfid); |
2171 | 2165 |
if (dfidp == NULL) { |
2172 |
err = -errno;
|
|
2166 |
err = -ENOENT;
|
|
2173 | 2167 |
goto out; |
2174 | 2168 |
} |
2175 | 2169 |
|
2176 | 2170 |
oldfidp = lookup_fid(s, oldfid); |
2177 | 2171 |
if (oldfidp == NULL) { |
2178 |
err = -errno;
|
|
2172 |
err = -ENOENT;
|
|
2179 | 2173 |
goto out; |
2180 | 2174 |
} |
2181 | 2175 |
|
2182 | 2176 |
v9fs_string_sprintf(&fullname, "%s/%s", dfidp->path.data, name.data); |
2183 |
err = offset; |
|
2184 |
err = v9fs_do_link(s, &oldfidp->path, &fullname); |
|
2185 |
if (err) { |
|
2186 |
err = -errno; |
|
2177 |
err = v9fs_co_link(s, &oldfidp->path, &fullname); |
|
2178 |
if (!err) { |
|
2179 |
err = offset; |
|
2187 | 2180 |
} |
2188 | 2181 |
v9fs_string_free(&fullname); |
2189 | 2182 |
|
Also available in: Unified diff