Example #1
0
afs_int32
FSYNC_VolOp(VolumeId volume, char * partition,
            int command, int reason,
            SYNC_response * res)
{
    FSSYNC_VolOp_hdr vcom;

    memset(&vcom, 0, sizeof(vcom));

    vcom.volume = volume;
    if (partition)
        strlcpy(vcom.partName, partition, sizeof(vcom.partName));

    return FSYNC_GenericOp(&vcom, sizeof(vcom), command, reason, res);
}
Example #2
0
/**
 * perform an update operation on the VGC.
 *
 * @param[in] parent    rw volume
 * @param[in] child     volume id to add
 * @param[in] partition name of vice partition on which this VG resides
 * @param[in] opcode    FSSYNC VG cache opcode
 * @param[in] reason    FSSYNC reason code
 * @param[out] res      SYNC response message
 *
 * @return operation status
 *    @retval SYNC_OK success
 *
 * @internal
 */
static afs_int32
_FSYNC_VGCUpdate(char * partition,
                 VolumeId parent,
                 VolumeId child,
                 int opcode,
                 int reason,
                 SYNC_response *res)
{
    FSSYNC_VGUpdate_command_t vcom;

    memset(&vcom, 0, sizeof(vcom));

    vcom.parent = parent;
    vcom.child = child;
    if (partition)
        strlcpy(vcom.partName, partition, sizeof(vcom.partName));

    return FSYNC_GenericOp(&vcom, sizeof(vcom), opcode, reason, res);
}
Example #3
0
static int
do_vnqry(struct state * state, SYNC_response * res)
{
    afs_int32 code;
    int command = FSYNC_VOL_QUERY_VNODE;
    FSSYNC_VnQry_hdr qry;

    qry.volume = state->vop->volume;
    qry.vnode = state->vop->vnode;
    qry.unique = state->vop->unique;
    qry.spare = 0;
    strlcpy(qry.partName, state->vop->partName, sizeof(qry.partName));

    fprintf(stderr, "calling FSYNC_GenericOp with command code %d (%s)\n", 
	    command, command_code_to_string(command));

    code = FSYNC_GenericOp(&qry, sizeof(qry), command, FSYNC_OPERATOR, res);

    switch (code) {
    case SYNC_OK:
    case SYNC_DENIED:
	break;
    default:
	fprintf(stderr, "possible sync protocol error. return code was %d\n", code);
    }

    fprintf(stderr, "FSYNC_GenericOp returned %d (%s)\n", code, response_code_to_string(code));
    fprintf(stderr, "protocol response code was %d (%s)\n", 
	    res->hdr.response, response_code_to_string(res->hdr.response));
    fprintf(stderr, "protocol reason code was %d (%s)\n", 
	    res->hdr.reason, reason_code_to_string(res->hdr.reason));

    VDisconnectFS();

    return 0;
}
Example #4
0
static int
do_vnqry(struct fssync_state * state, SYNC_response * res)
{
    afs_int32 code;
    int command = FSYNC_VOL_QUERY_VNODE;
    FSSYNC_VnQry_hdr qry;

    qry.volume = state->vop->volume;
    qry.vnode = state->vop->vnode;
    qry.unique = state->vop->unique;
    qry.spare = 0;
    strlcpy(qry.partName, state->vop->partName, sizeof(qry.partName));

    fprintf(stderr, "calling FSYNC_GenericOp with command code %d (%s)\n",
	    command, FSYNC_com2string(command));

    code = FSYNC_GenericOp(&qry, sizeof(qry), command, FSYNC_OPERATOR, res);

    debug_response(code, res);

    VDisconnectFS();

    return 0;
}
Example #5
0
afs_int32
FSYNC_StatsOp(FSSYNC_StatsOp_hdr * scom, int command, int reason,
              SYNC_response * res)
{
    return FSYNC_GenericOp(scom, sizeof(*scom), command, reason, res);
}