Coda File System

Too many reserved bits in (struct VolFlags)

From: LEE, Yui-wah <clement_at_cse.cuhk.edu.hk>
Date: Mon, 4 Oct 1999 16:31:30 +0800 (CST)
Hi,

We probably have wasted 4 bytes per volume, since we may have allocated
more than necessary reserved bits.

The following is taken from venusvol.h (version 5.3.1).  There are 19
meaningful bits, and 14 reserved bits.  The sum is thus 33 bits.

/* We save some space by packing booleans into a bit-vector. */
struct VolFlags {
    /*T*/unsigned transition_pending : 1;
    /*T*/unsigned demotion_pending : 1;
    /*T*/unsigned valid : 1;			/* not used yet */
    /*T*/unsigned online : 1;			/* not used yet */
    /*T*/unsigned usecallback : 1;		/* should be deprecated? */
    unsigned logv : 1;				/* log mutations, allow fetches */
    unsigned allow_asrinvocation : 1;		/* asr's allowed in this volume */
    unsigned has_local_subtree : 1;		/* indicating whehter this volume contains local subtrees */
    /*T*/unsigned reintegratepending : 1;	/* are we waiting for tokens? */
    /*T*/unsigned reintegrating : 1;		/* are we reintegrating now? */
    /*T*/unsigned repair_mode : 1;		/* 0 --> normal, 1 --> repair */
    /*T*/unsigned resolve_me: 1;		/* resolve reintegrated objects */
    /*T*/unsigned weaklyconnected : 1;		/* are we weakly connected? */ 
    /*T*/unsigned writebacking : 1;             /* writeback mode */
    /*T*/unsigned writebackreint :1;            /* is reint due to permit revoke? */
    /*T*/unsigned sync_reintegrate :1;          /* perform reintegration synchronously*/
    /*T*/unsigned sync_reintegrate_done :1;     /* synchronous reintegration done */
    /*T*/unsigned autowriteback :1;             /* auto try to get wb permit */
    /*T*/unsigned staylogging : 1;              /* keep logging after |cml| == 0*/
    unsigned reserved : 14;
};


Of course, we may clean this up later, together with other changes.
(struct VolFlags) is used in (class volent), which is persistent in 
the client side.

-- Clement

======================================================================
Yui-wah LEE (Clement)                         |    Tel: (852)-26098412
Department of Computer Science & Engineering, | Mobile: (852)-98421024 
The Chinese University of Hong Kong   | Real-time Msg.: 41792200 (ICQ)
WWW: www.cse.cuhk.edu.hk/~clement     | Email: clement_at_cse.cuhk.edu.hk
======================================================================
Received on 1999-10-04 04:34:35