2014-12-04 00:12:07 +03:00
# include "defs.h"
2015-06-16 03:31:45 +03:00
# define MS_MGC_VAL 0xc0ed0000 /* old magic mount flag number */
# define MS_MGC_MSK 0xffff0000 /* old magic mount flag mask */
2014-12-04 00:12:07 +03:00
# include "xlat/mount_flags.h"
2015-04-07 04:36:50 +03:00
SYS_FUNC ( mount )
2014-12-04 00:12:07 +03:00
{
if ( entering ( tcp ) ) {
2015-06-16 04:28:34 +03:00
bool ignore_type = false ;
bool ignore_data = false ;
bool old_magic = false ;
2014-12-04 00:12:07 +03:00
unsigned long flags = tcp - > u_arg [ 3 ] ;
/* Discard magic */
2015-06-16 04:28:34 +03:00
if ( ( flags & MS_MGC_MSK ) = = MS_MGC_VAL ) {
2014-12-04 00:12:07 +03:00
flags & = ~ MS_MGC_MSK ;
2015-06-16 04:28:34 +03:00
old_magic = true ;
}
2014-12-04 00:12:07 +03:00
if ( flags & MS_REMOUNT )
2015-06-16 04:28:34 +03:00
ignore_type = true ;
2015-06-16 13:53:25 +03:00
else if ( flags & ( MS_BIND | MS_MOVE | MS_SHARED
| MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE ) )
2015-06-16 04:28:34 +03:00
ignore_type = ignore_data = true ;
2014-12-04 00:12:07 +03:00
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
tprints ( " , " ) ;
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
tprints ( " , " ) ;
2015-07-20 01:58:19 +03:00
if ( ignore_type )
printaddr ( tcp - > u_arg [ 2 ] ) ;
2014-12-04 00:12:07 +03:00
else
printstr ( tcp , tcp - > u_arg [ 2 ] , - 1 ) ;
tprints ( " , " ) ;
2015-06-16 04:28:34 +03:00
if ( old_magic ) {
tprints ( " MS_MGC_VAL " ) ;
if ( flags )
tprints ( " | " ) ;
}
if ( flags | | ! old_magic )
printflags ( mount_flags , flags , " MS_??? " ) ;
2014-12-04 00:12:07 +03:00
tprints ( " , " ) ;
2015-07-20 01:58:19 +03:00
if ( ignore_data )
printaddr ( tcp - > u_arg [ 4 ] ) ;
2014-12-04 00:12:07 +03:00
else
printstr ( tcp , tcp - > u_arg [ 4 ] , - 1 ) ;
}
return 0 ;
}