9p.c (0c4356ba7dafc8ecb5877a42fc0d68d45ccf5951) 9p.c (d2c5cf7ca15490b4737a5393e51abf0301b98971)
1/*
2 * Virtio 9p backend
3 *
4 * Copyright IBM, Corp. 2010
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 300 unchanged lines hidden (view full) ---

309 /*
310 * Mark the fid as referenced so that the LRU
311 * reclaim won't close the file descriptor
312 */
313 f->flags |= FID_REFERENCED;
314 f->next = s->fid_list;
315 s->fid_list = f;
316
1/*
2 * Virtio 9p backend
3 *
4 * Copyright IBM, Corp. 2010
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 300 unchanged lines hidden (view full) ---

309 /*
310 * Mark the fid as referenced so that the LRU
311 * reclaim won't close the file descriptor
312 */
313 f->flags |= FID_REFERENCED;
314 f->next = s->fid_list;
315 s->fid_list = f;
316
317 v9fs_readdir_init(&f->fs.dir);
318 v9fs_readdir_init(&f->fs_reclaim.dir);
317 v9fs_readdir_init(s->proto_version, &f->fs.dir);
318 v9fs_readdir_init(s->proto_version, &f->fs_reclaim.dir);
319
320 return f;
321}
322
323static int coroutine_fn v9fs_xattr_fid_clunk(V9fsPDU *pdu, V9fsFidState *fidp)
324{
325 int retval = 0;
326

--- 1896 unchanged lines hidden (view full) ---

2223 trace_v9fs_read(pdu->tag, pdu->id, fid, off, max_count);
2224
2225 fidp = get_fid(pdu, fid);
2226 if (fidp == NULL) {
2227 err = -EINVAL;
2228 goto out_nofid;
2229 }
2230 if (fidp->fid_type == P9_FID_DIR) {
319
320 return f;
321}
322
323static int coroutine_fn v9fs_xattr_fid_clunk(V9fsPDU *pdu, V9fsFidState *fidp)
324{
325 int retval = 0;
326

--- 1896 unchanged lines hidden (view full) ---

2223 trace_v9fs_read(pdu->tag, pdu->id, fid, off, max_count);
2224
2225 fidp = get_fid(pdu, fid);
2226 if (fidp == NULL) {
2227 err = -EINVAL;
2228 goto out_nofid;
2229 }
2230 if (fidp->fid_type == P9_FID_DIR) {
2231
2231 if (s->proto_version != V9FS_PROTO_2000U) {
2232 warn_report_once(
2233 "9p: bad client: T_read request on directory only expected "
2234 "with 9P2000.u protocol version"
2235 );
2236 err = -EOPNOTSUPP;
2237 goto out;
2238 }
2232 if (off == 0) {
2233 v9fs_co_rewinddir(pdu, fidp);
2234 }
2235 count = v9fs_do_readdir_with_stat(pdu, fidp, max_count);
2236 if (count < 0) {
2237 err = count;
2238 goto out;
2239 }

--- 201 unchanged lines hidden (view full) ---

2441 if (fidp == NULL) {
2442 retval = -EINVAL;
2443 goto out_nofid;
2444 }
2445 if (!fidp->fs.dir.stream) {
2446 retval = -EINVAL;
2447 goto out;
2448 }
2239 if (off == 0) {
2240 v9fs_co_rewinddir(pdu, fidp);
2241 }
2242 count = v9fs_do_readdir_with_stat(pdu, fidp, max_count);
2243 if (count < 0) {
2244 err = count;
2245 goto out;
2246 }

--- 201 unchanged lines hidden (view full) ---

2448 if (fidp == NULL) {
2449 retval = -EINVAL;
2450 goto out_nofid;
2451 }
2452 if (!fidp->fs.dir.stream) {
2453 retval = -EINVAL;
2454 goto out;
2455 }
2456 if (s->proto_version != V9FS_PROTO_2000L) {
2457 warn_report_once(
2458 "9p: bad client: T_readdir request only expected with 9P2000.L "
2459 "protocol version"
2460 );
2461 retval = -EOPNOTSUPP;
2462 goto out;
2463 }
2449 count = v9fs_do_readdir(pdu, fidp, (off_t) initial_offset, max_count);
2450 if (count < 0) {
2451 retval = count;
2452 goto out;
2453 }
2454 retval = pdu_marshal(pdu, offset, "d", count);
2455 if (retval < 0) {
2456 goto out;

--- 1710 unchanged lines hidden ---
2464 count = v9fs_do_readdir(pdu, fidp, (off_t) initial_offset, max_count);
2465 if (count < 0) {
2466 retval = count;
2467 goto out;
2468 }
2469 retval = pdu_marshal(pdu, offset, "d", count);
2470 if (retval < 0) {
2471 goto out;

--- 1710 unchanged lines hidden ---