Revision b41e95d3

b/hw/virtio-9p-debug.c
535 535
    case P9_RCLUNK:
536 536
        fprintf(llogfile, "RCLUNK: (");
537 537
        break;
538
    case P9_TFSYNC:
539
        fprintf(llogfile, "TFSYNC: (");
540
        pprint_int32(pdu, 0, &offset, "fid");
541
        break;
542
    case P9_RFSYNC:
543
        fprintf(llogfile, "RFSYNC: (");
544
        break;
538 545
    case P9_TLINK:
539 546
        fprintf(llogfile, "TLINK: (");
540 547
        pprint_int32(pdu, 0, &offset, "fid");
b/hw/virtio-9p.c
1837 1837
    qemu_free(vs);
1838 1838
}
1839 1839

  
1840
static void v9fs_post_do_fsync(V9fsState *s, V9fsPDU *pdu, int err)
1841
{
1842
    if (err == -1) {
1843
        err = -errno;
1844
    }
1845
    complete_pdu(s, pdu, err);
1846
}
1847

  
1848
static void v9fs_fsync(V9fsState *s, V9fsPDU *pdu)
1849
{
1850
    int32_t fid;
1851
    size_t offset = 7;
1852
    V9fsFidState *fidp;
1853
    int err;
1854

  
1855
    pdu_unmarshal(pdu, offset, "d", &fid);
1856
    fidp = lookup_fid(s, fid);
1857
    if (fidp == NULL) {
1858
        err = -ENOENT;
1859
        v9fs_post_do_fsync(s, pdu, err);
1860
        return;
1861
    }
1862
    err = v9fs_do_fsync(s, fidp->fs.fd);
1863
    v9fs_post_do_fsync(s, pdu, err);
1864
}
1865

  
1840 1866
static void v9fs_clunk(V9fsState *s, V9fsPDU *pdu)
1841 1867
{
1842 1868
    int32_t fid;
......
3514 3540
    [P9_TSTAT] = v9fs_stat,
3515 3541
    [P9_TWALK] = v9fs_walk,
3516 3542
    [P9_TCLUNK] = v9fs_clunk,
3543
    [P9_TFSYNC] = v9fs_fsync,
3517 3544
    [P9_TOPEN] = v9fs_open,
3518 3545
    [P9_TREAD] = v9fs_read,
3519 3546
#if 0
b/hw/virtio-9p.h
37 37
    P9_RXATTRCREATE,
38 38
    P9_TREADDIR = 40,
39 39
    P9_RREADDIR,
40
    P9_TFSYNC = 50,
41
    P9_RFSYNC,
40 42
    P9_TLOCK = 52,
41 43
    P9_RLOCK,
42 44
    P9_TGETLOCK = 54,

Also available in: Unified diff