From: Bart Van Assche Date: Tue, 5 Aug 2014 12:01:26 +0000 (+0000) Subject: Linux: Add support for Lustre FID2PATH ioctl (#331829) X-Git-Tag: svn/VALGRIND_3_10_0~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7777bc86717d933ad003ad206a2223a7e3a7e3f;p=thirdparty%2Fvalgrind.git Linux: Add support for Lustre FID2PATH ioctl (#331829) This is a modified version of a patch provided by Frank Zago (fzago@cray.com). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14233 --- diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 20b6d0e1ce..619a096104 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -7069,6 +7069,12 @@ PRE(sys_ioctl) } #endif + /* To do: figure out which software layer extends the sign of 'request' */ + case VKI_OBD_IOC_FID2PATH: + PRE_MEM_READ("VKI_OBD_IOC_FID2PATH(args)", ARG3, + sizeof(struct vki_getinfo_fid2path)); + break; + default: /* EVIOC* are variable length and return size written on success */ switch (ARG2 & ~(_VKI_IOC_SIZEMASK << _VKI_IOC_SIZESHIFT)) { @@ -8358,6 +8364,13 @@ POST(sys_ioctl) break; #endif + /* To do: figure out which software layer extends the sign of 'request' */ + case VKI_OBD_IOC_FID2PATH: { + struct vki_getinfo_fid2path *args = (void *)(ARG3); + POST_MEM_WRITE((Addr)args->gf_path, args->gf_pathlen); + } + break; + default: /* EVIOC* are variable length and return size written on success */ switch (ARG2 & ~(_VKI_IOC_SIZEMASK << _VKI_IOC_SIZESHIFT)) { diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index 6043842f86..f4e8669980 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -3420,6 +3420,40 @@ struct vki_ethtool_ts_info { #define VKI_ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */ #define VKI_ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ +//---------------------------------------------------------------------- +// From drivers/staging/lustre/lustre/include/lustre/lustre_user.h +//---------------------------------------------------------------------- + +struct vki_lu_fid { + __vki_u64 f_seq; + __vki_u32 f_oid; + __vki_u32 f_ver; +}; + +//---------------------------------------------------------------------- +// From drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +//---------------------------------------------------------------------- + +struct vki_getinfo_fid2path { + struct vki_lu_fid gf_fid; + __vki_u64 gf_recno; + __vki_u32 gf_linkno; + __vki_u32 gf_pathlen; + char gf_path[0]; +} __attribute__((packed)); + +//---------------------------------------------------------------------- +// From drivers/staging/lustre/lustre/include/linux/lustre_lib.h +//---------------------------------------------------------------------- + +#define OBD_IOC_DATA_TYPE long + +//---------------------------------------------------------------------- +// From drivers/staging/lustre/lustre/include/lustre_lib.h +//---------------------------------------------------------------------- + +#define VKI_OBD_IOC_FID2PATH _VKI_IOWR ('f', 150, OBD_IOC_DATA_TYPE) + #endif // __VKI_LINUX_H /*--------------------------------------------------------------------*/