Changeset 31eb568 in mainline


Ignore:
Timestamp:
2025-05-06T22:27:00Z (5 weeks ago)
Author:
Miroslav Cimerman <mc@…>
Children:
ac4b70b
Parents:
13c2365
Message:

hr: comment hr.c a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/hr.c

    r13c2365 r31eb568  
    3131 */
    3232/**
    33  * @file
     33 * @file hr.c
     34 * @brief HelenRAID server methods.
    3435 */
    3536
     
    4041#include <hr.h>
    4142#include <io/log.h>
    42 #include <inttypes.h>
    4343#include <ipc/hr.h>
    4444#include <ipc/services.h>
    4545#include <loc.h>
    4646#include <task.h>
    47 #include <stdatomic.h>
    4847#include <stdio.h>
    4948#include <stdlib.h>
     
    5251#include <block.h>
    5352
    54 #include "fge.h"
    55 #include "io.h"
    56 #include "superblock.h"
    5753#include "util.h"
    5854#include "var.h"
     
    6460static void hr_add_hotspare_srv(ipc_call_t *);
    6561static void hr_print_status_srv(ipc_call_t *);
    66 static void hr_ctl_conn(ipc_call_t *, void *);
     62static void hr_ctl_conn(ipc_call_t *);
    6763static void hr_client_conn(ipc_call_t *, void *);
    6864
     
    7369static service_id_t ctl_sid;
    7470
     71/** Volume creation (server).
     72 *
     73 * Creates HelenRAID volume from parameters and
     74 * devices specified in hr_config_t.
     75 *
     76 * @param icall hr_config_t
     77 */
    7578static void hr_create_srv(ipc_call_t *icall)
    7679{
     
    175178}
    176179
     180/** Manual volume assembly (server).
     181 *
     182 * Tries to assemble a volume from devices in hr_config_t and
     183 * sends the number of successful volumes assembled back to the
     184 * client.
     185 *
     186 * @param icall hr_config_t
     187 */
    177188static void hr_assemble_srv(ipc_call_t *icall)
    178189{
     
    234245}
    235246
     247/** Automatic volume assembly (server).
     248 *
     249 * Tries to assemble a volume from devices in disk location
     250 * category and sends the number of successful volumes assembled
     251 * back to client.
     252 */
    236253static void hr_auto_assemble_srv(ipc_call_t *icall)
    237254{
     
    269286}
    270287
     288/** Volume deactivation (server).
     289 *
     290 * Deactivates/detaches specified volume.
     291 */
    271292static void hr_stop_srv(ipc_call_t *icall)
    272293{
     
    290311}
    291312
     313/** Automatic volume deactivation (server).
     314 *
     315 * Tries to deactivate/detach all volumes.
     316 */
    292317static void hr_stop_all_srv(ipc_call_t *icall)
    293318{
     
    316341}
    317342
     343/** Simulate volume extent failure (server).
     344 *
     345 * Changes the specified extent's state to FAULTY.
     346 * Other extents' metadata are marked as dirty, therefore
     347 * it effectively invalides the specified extent as well
     348 * for further uses.
     349 */
    318350static void hr_fail_extent_srv(ipc_call_t *icall)
    319351{
     
    347379}
    348380
     381/** Add hotspare to volume (server).
     382 *
     383 * Adds hotspare to a volume.
     384 */
    349385static void hr_add_hotspare_srv(ipc_call_t *icall)
    350386{
     
    378414}
    379415
     416/** Volume state printing (server).
     417 *
     418 * Prints info about all active volumes.
     419 */
    380420static void hr_print_status_srv(ipc_call_t *icall)
    381421{
     
    447487}
    448488
    449 static void hr_ctl_conn(ipc_call_t *icall, void *arg)
     489/**  HelenRAID server control IPC methods crossroad.
     490 */
     491static void hr_ctl_conn(ipc_call_t *icall)
    450492{
    451493        HR_DEBUG("%s()", __func__);
     
    494536}
    495537
     538/**  HelenRAID server IPC method crossroad.
     539 *
     540 * Distinguishes between control IPC and block device
     541 * IPC calls.
     542 */
    496543static void hr_client_conn(ipc_call_t *icall, void *arg)
    497544{
     
    503550
    504551        if (svc_id == ctl_sid) {
    505                 hr_ctl_conn(icall, arg);
     552                hr_ctl_conn(icall);
    506553        } else {
    507                 HR_DEBUG("bd_conn()\n");
    508554                vol = hr_get_volume(svc_id);
    509555                if (vol == NULL)
Note: See TracChangeset for help on using the changeset viewer.