void inomap_skip( xfs_ino_t ino ) { intgen_t oldstate; oldstate = inomap_get_state( NULL, ino ); if ( oldstate == MAP_NDR_CHANGE) { inomap_set_state( NULL, ino, MAP_NDR_NOCHNG ); } if ( oldstate == MAP_DIR_CHANGE || oldstate == MAP_DIR_SUPPRT ) { inomap_set_state( NULL, ino, MAP_DIR_NOCHNG ); } }
/* ARGSUSED */ static bool_t /* false, used as diriter callback */ supprt_prune( void *arg1, /* ancestors marked as changed? */ jdm_fshandle_t *fshandlep, intgen_t fsfd, xfs_bstat_t *statp, char *name ) { static bool_t cbrval = BOOL_FALSE; intgen_t state; if ( ( statp->bs_mode & S_IFMT ) == S_IFDIR ) { bool_t changed_below = BOOL_FALSE; state = inomap_get_state( cb_inomap_contextp, statp->bs_ino ); if ( state != MAP_DIR_CHANGE && state != MAP_DIR_NOCHNG && state != MAP_DIR_SUPPRT) { /* * if file is now a dir then it has * certainly changed. */ state = MAP_DIR_CHANGE; inomap_set_state( cb_inomap_contextp, statp->bs_ino, state ); } ( void )diriter( fshandlep, fsfd, statp, supprt_prune, (void *)&changed_below, &cbrval, NULL, 0 ); if ( state == MAP_DIR_SUPPRT ) { if ( changed_below == BOOL_FALSE ) { inomap_set_state( cb_inomap_contextp, statp->bs_ino, MAP_DIR_NOCHNG ); cb_dircnt--; /* dump size just changed! */ } else { /* Directory entries back up the hierarchy */ /* to be dumped - as either MAP_DIR_SUPPRT */ /* or as MAP_DIR_CHANGE in inode state map */ *( bool_t * )arg1 = BOOL_TRUE; } } else if ( state == MAP_DIR_CHANGE ) { /* Directory entries back up the hierarchy must get */ /* dumped - as either MAP_DIR_SUPPRT/MAP_DIR_CHANGE */ *( bool_t * )arg1 = BOOL_TRUE; } return cbrval; } if ( *(bool_t *)arg1 == BOOL_TRUE ) { /* shortcut, sibling changed */ return cbrval; } state = inomap_get_state( cb_inomap_contextp, statp->bs_ino ); if ( state != MAP_NDR_CHANGE && state != MAP_NDR_NOCHNG ) { /* * if dir is now a file then it has * certainly changed. */ state = MAP_NDR_CHANGE; inomap_set_state( cb_inomap_contextp, statp->bs_ino, state ); } if ( state == MAP_NDR_CHANGE ) { /* Directory entries back up the hierarchy must get */ /* dumped - as either MAP_DIR_SUPPRT/MAP_DIR_CHANGE */ *( bool_t * )arg1 = BOOL_TRUE; } return cbrval; }
/* called for every ino to be added to the map. */ static void inomap_add( void *contextp, xfs_ino_t ino, gen_t gen, intgen_t state ) { inomap_set_state( contextp, ino, state ); inomap_set_gen( contextp, ino, gen ); }