nfs.c (58e2e17dba49b43f4ac9de19468aeae1c787dcc2) nfs.c (2b148f392b2bfeba76d3e6d9607c3bd072350e8c)
1/*
2 * QEMU Block driver for native access to files on NFS shares
3 *
4 * Copyright (c) 2014-2017 Peter Lieven <pl@kamp.de>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

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

871 }
872
873 visit_free(ov);
874 qdict_flatten(opts);
875 bs->full_open_options = opts;
876}
877
878#ifdef LIBNFS_FEATURE_PAGECACHE
1/*
2 * QEMU Block driver for native access to files on NFS shares
3 *
4 * Copyright (c) 2014-2017 Peter Lieven <pl@kamp.de>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

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

871 }
872
873 visit_free(ov);
874 qdict_flatten(opts);
875 bs->full_open_options = opts;
876}
877
878#ifdef LIBNFS_FEATURE_PAGECACHE
879static void nfs_invalidate_cache(BlockDriverState *bs,
880 Error **errp)
879static void coroutine_fn nfs_co_invalidate_cache(BlockDriverState *bs,
880 Error **errp)
881{
882 NFSClient *client = bs->opaque;
883 nfs_pagecache_invalidate(client->context, client->fh);
884}
885#endif
886
887static BlockDriver bdrv_nfs = {
888 .format_name = "nfs",

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

905 .bdrv_co_pwritev = nfs_co_pwritev,
906 .bdrv_co_flush_to_disk = nfs_co_flush,
907
908 .bdrv_detach_aio_context = nfs_detach_aio_context,
909 .bdrv_attach_aio_context = nfs_attach_aio_context,
910 .bdrv_refresh_filename = nfs_refresh_filename,
911
912#ifdef LIBNFS_FEATURE_PAGECACHE
881{
882 NFSClient *client = bs->opaque;
883 nfs_pagecache_invalidate(client->context, client->fh);
884}
885#endif
886
887static BlockDriver bdrv_nfs = {
888 .format_name = "nfs",

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

905 .bdrv_co_pwritev = nfs_co_pwritev,
906 .bdrv_co_flush_to_disk = nfs_co_flush,
907
908 .bdrv_detach_aio_context = nfs_detach_aio_context,
909 .bdrv_attach_aio_context = nfs_attach_aio_context,
910 .bdrv_refresh_filename = nfs_refresh_filename,
911
912#ifdef LIBNFS_FEATURE_PAGECACHE
913 .bdrv_invalidate_cache = nfs_invalidate_cache,
913 .bdrv_co_invalidate_cache = nfs_co_invalidate_cache,
914#endif
915};
916
917static void nfs_block_init(void)
918{
919 bdrv_register(&bdrv_nfs);
920}
921
922block_init(nfs_block_init);
914#endif
915};
916
917static void nfs_block_init(void)
918{
919 bdrv_register(&bdrv_nfs);
920}
921
922block_init(nfs_block_init);