OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/afs/afs_dynroot.h
00001 /*
00002  * Copyright 2000, International Business Machines Corporation and others.
00003  * All Rights Reserved.
00004  *
00005  * This software has been released under the terms of the IBM Public
00006  * License.  For details, see the LICENSE file in the top-level source
00007  * directory or online at http://www.openafs.org/dl/license10.html
00008  */
00009 
00010 /*
00011  * Vnode numbers in dynroot are composed of a type field (upper 8 bits)
00012  * and a type-specific identifier in the lower 24 bits.
00013  */
00014 #define VN_TYPE_CELL            0x01    /* Corresponds to a struct cell */
00015 #define VN_TYPE_ALIAS           0x02    /* Corresponds to a struct cell_alias */
00016 #define VN_TYPE_SYMLINK         0x03    /* User-created symlink in /afs */
00017 #define VN_TYPE_MOUNT           0x04    /* Mount point by volume ID */
00018 
00019 #define VNUM_TO_VNTYPE(vnum)    ((vnum) >> 24)
00020 #define VNUM_TO_VNID(vnum)      ((vnum) & 0x00ffffff)
00021 #define VNUM_FROM_TYPEID(type, id) \
00022                                 ((type) << 24 | (id))
00023 #define VNUM_TO_CIDX(vnum)      (VNUM_TO_VNID(vnum) >> 2)
00024 #define VNUM_TO_RW(vnum)        (VNUM_TO_VNID(vnum) >> 1 & 1)
00025 #define VNUM_FROM_CIDX_RW(cidx, rw) \
00026                                 VNUM_FROM_TYPEID(VN_TYPE_CELL, \
00027                                                  ((cidx) << 2 | (rw) << 1))
00028 #define VNUM_FROM_CAIDX_RW(caidx, rw) \
00029                                 VNUM_FROM_TYPEID(VN_TYPE_ALIAS, \
00030                                                  ((caidx) << 2 | (rw) << 1))
00031 
00032 #define AFS_DYNROOT_MOUNTNAME   ".:mount"
 All Data Structures Files Functions Variables