9pfs: improve portability to older systems

I guess we can also make sure we don't  call local_ioc_getversion at
all.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
master
Aneesh Kumar K.V 2011-11-23 11:46:27 +05:30 committed by Anthony Liguori
parent 51711aee8c
commit 2507718baf
1 changed files with 6 additions and 1 deletions

View File

@ -717,10 +717,14 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path,
static int local_init(FsContext *ctx) static int local_init(FsContext *ctx)
{ {
int err; int err = 0;
struct statfs stbuf; struct statfs stbuf;
ctx->export_flags |= V9FS_PATHNAME_FSCONTEXT; ctx->export_flags |= V9FS_PATHNAME_FSCONTEXT;
#ifdef FS_IOC_GETVERSION
/*
* use ioc_getversion only if the iocl is definied
*/
err = statfs(ctx->fs_root, &stbuf); err = statfs(ctx->fs_root, &stbuf);
if (!err) { if (!err) {
switch (stbuf.f_type) { switch (stbuf.f_type) {
@ -732,6 +736,7 @@ static int local_init(FsContext *ctx)
break; break;
} }
} }
#endif
return err; return err;
} }