Changeset 8b51009 in mainline for uspace/srv/bd/hr/var.h


Ignore:
Timestamp:
2025-03-28T23:37:16Z (3 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
0437dd5
Parents:
7bfe468
git-author:
Miroslav Cimerman <mc@…> (2025-03-28 23:25:57)
git-committer:
Miroslav Cimerman <mc@…> (2025-03-28 23:37:16)
Message:

hr: auto assembly, refactor

Added automatic assembly (with hrctl -A). All disks or their partitions
are scanned for HelenRAID metadata and assembly is attempted.

Main volume list is now locked with RW lock. The volume list
manipulation functions are moved into util.c.

hr_{create,destroy}_vol_struct() are implemented for better reusability
and modularity.

Volume destroy/stop (hrctl -D) now returns EBUSY if someone has still
the volume open()-ed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/var.h

    r7bfe468 r8b51009  
    4242#include <fibril_synch.h>
    4343#include <hr.h>
     44#include <stdatomic.h>
    4445
    4546#include "fge.h"
     47#include "superblock.h"
    4648
    4749#define NAME            "hr"
     
    5052struct hr_volume;
    5153typedef struct hr_volume hr_volume_t;
     54typedef struct hr_metadata hr_metadata_t;
    5255
    5356typedef struct hr_ops {
     
    6972        hr_fpool_t      *fge;                   /* fibril pool */
    7073
     74        uint32_t         metadata_version; /* XXX: yet unused */
     75
     76        hr_metadata_t   *in_mem_md; /* TODO: implement */
     77
    7178        /* invariants */
    7279        size_t           extent_no;             /* number of extents */
    7380        size_t           bsize;                 /* block size */
    7481        uint64_t         nblocks;               /* no. of all usable blocks */
     82        uint64_t         truncated_blkno;       /* blkno per extent */
    7583        uint64_t         data_blkno;            /* no. of user usable blocks */
    7684        uint64_t         data_offset;           /* user data offset in blocks */
     
    9199        _Atomic bool     state_dirty;           /* dirty state */
    92100
    93         /*
    94          * XXX: unportable for 32-bit?
    95          *
    96          * Add macros for locking or atomic increment depending
    97          * on the platform?
    98          */
     101        /* XXX: atomic_uint_least64_t? */
    99102        _Atomic uint64_t rebuild_blk;           /* rebuild position */
     103        _Atomic int      open_cnt;              /* open/close() counter */
    100104        uint64_t         counter;               /* TODO: metadata syncing */
    101105        hr_vol_status_t  status;                /* volume status */
Note: See TracChangeset for help on using the changeset viewer.