X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=linux_module%2Fiface-file.c;h=6f69c3d7766dac38a32a29e89edd48a1b58646b1;hp=67a4e738b1d2ea79bc83a3566dbd158f6385be06;hb=a8686374c6aa74d805b32e7675f42f7ab9a0b348;hpb=42b80fddfbfea5c5603b71d80d3e2ba2a53a2074 diff --git a/linux_module/iface-file.c b/linux_module/iface-file.c index 67a4e73..6f69c3d 100644 --- a/linux_module/iface-file.c +++ b/linux_module/iface-file.c @@ -20,6 +20,12 @@ static struct list_head global_files; #define isprint(a) ((a >= ' ') && (a <= '~')) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#define PAL_VFS_GETATTR(path, kstat) vfs_getattr(path.mnt, path.dentry, kstat) +#else +#define PAL_VFS_GETATTR(path, kstat) vfs_getattr(path, kstat) +#endif + struct palacios_file { struct file * filp; @@ -276,7 +282,7 @@ static unsigned long long palacios_file_size(void * file_ptr) { struct kstat s; int ret; - ret = vfs_getattr(filp->f_path.mnt, filp->f_path.dentry, &s); + ret = PAL_VFS_GETATTR(filp->f_path, &s); if (ret != 0) { ERROR("Failed to fstat file\n");