"Fossies" - the Fresh Open Source Software Archive

Member "quotactl-1.00/quotause/quota.h" (28 Aug 2005, 768 Bytes) of package /linux/privat/old/quotactl-1.00.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "quota.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef QUOTA_H_INCLUDED
    2 #define QUOTA_H_INCLUDED
    3 
    4 typedef u_int32_t qid_t;    /* Type of an id in memory */
    5 typedef u_int64_t qsize_t;  /* Type of a size limitationx */
    6 
    7 #define MAXQUOTAS 2
    8 
    9 enum quotaType {USRQUOTA=0, GRPQUOTA=1};
   10 
   11 /* Conversion routines from and to quota blocks */
   12 
   13 /* Size of blocks in which are counted size limits in generic utility parts */
   14 #define QUOTABLOCK_BITS 10
   15 #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
   16 
   17 static inline unsigned int
   18 qb2kb(unsigned int const arg) {
   19     return arg << (QUOTABLOCK_BITS-10);
   20 }
   21 
   22 static inline unsigned int
   23 kb2qb(unsigned int const arg) {
   24     return arg >> (QUOTABLOCK_BITS-10);
   25 }
   26 
   27 static inline unsigned int
   28 toqb(unsigned int const arg) {
   29     return (arg + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS;
   30 }
   31 
   32 #endif
   33