diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-01-27 17:59:25 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-01-27 17:59:25 +0000 |
commit | c46b8cacee226020bc8e34c05be5dce9b277c17b (patch) | |
tree | 67bcaa36885f59faab1f06aa45b9b6a8f1a83c5b /libdiskfs/priv.h | |
parent | 3baa23a24d5ef89352c1eca37289c26807476d30 (diff) |
Formerly priv.h.~2~
Diffstat (limited to 'libdiskfs/priv.h')
-rw-r--r-- | libdiskfs/priv.h | 105 |
1 files changed, 1 insertions, 104 deletions
diff --git a/libdiskfs/priv.h b/libdiskfs/priv.h index 7a810f0c..b87bc961 100644 --- a/libdiskfs/priv.h +++ b/libdiskfs/priv.h @@ -15,108 +15,5 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Fetch and return node datum IND for disknode DN. */ -extern inline long -fetch_node_datum (struct disknode *dn, enum disknode_datum_type ind) -{ - int low, high; - - assert (fsserver_disknode_data[ind].type != UNIMP); - - switch (fsserver_disknode_data[ind].type) - { - case OFFSET_32: - return *(long *)((char *)dn - + fsserver_disknode_data[ind].loc.offsets[0]); - - case OFFSETS_16: - - high = *(short *)((char *)dn - + fsserver_disknode_data[ind].loc.offsets[0]); - low = *(short *)((char *)dn - + fsserver_disknode_data[ind].loc.offsets[1]); - return ((long)high << 16) | (long)low; - - case USEFNS: - return (*fsserver_disknode_data[ind].loc.fns.calcfn)(dn); - } -} - -/* Set node datum IND for disknode DN to VAL. */ -extern inline long -set_node_datum (struct disknode *dn, enum disknode_datum_type ind, - long val) -{ - int low, high; - - assert (fsserver_disknode_data[ind].type != UNIMP); - - switch (fsserver_disknode_data[ind].type) - { - case OFFSET_32: - *(long *)((char *)dn + fsserver_disknode_data[ind].loc.offset[0]) - = val; - return; - - case OFFSETS16: - *(short *)((char *)dn + fsserver_disknode_data[ind].loc.offset[0]) - = (val & 0xffff0000) >> 16; - *(short *)((char *)dn + fsserver_disknode_data[ind].loc.offset[1]) - = (val & 0xffff); - return; - - case SETFN; - (*fsserver_disknode_data[ind].loc.fns.setfn)(dn, val); - return; - } -} - -/* Define a function called `node_FNNAME', of type FNTYPE, which - fetches the node field named FIELDNAME of its (struct node *) - argument. */ -#define DEFINE_FETCH_FUNCTION (fntype, fnname, typename) \ -extern inline fntype \ -node_ ## fnname (struct node *np) \ -{ \ - return fetch_node_datum (np->dp, fieldname); \ -} - -DEFINE_FETCH_FUNCTION (int, mode, MODE) -DEFINE_FETCH_FUNCTION (int, nlinks, NLINKS) -DEFINE_FETCH_FUNCTION (uid_t, uid, UID) -DEFINE_FETCH_FUNCTION (uid_t, gid, GID) -DEFINE_FETCH_FUNCTION (uid_t, author, AUTHOR) -DEFINE_FETCH_FUNCTION (off_t, size, SIZE_LOW) -DEFINE_FETCH_FUNCTION (long, atime, ATIME_SEC) -DEFINE_FETCH_FUNCTION (long, mtime, MTIME_SEC) -DEFINE_FETCH_FUNCTION (long, ctime, CTIME_SEC) -DEFINE_FETCH_FUNCTION (int, flags, FLAGS) -DEFINE_FETCH_FUNCTION (int blocks, BLOCKS) - -#undef DEFINE_FETCH_FUNCTION - -/* Define a void function called `set_node_FNNAME' of two arguments - (struct node *np, long val) which sets FIELDNAME of node NP - to VAL. */ -#define DEFINE_SET_FUNCTION (fnname, fieldname) -extern inline void -set_node_ ## fnname (struct node *np, long val) -{ - set_node_datum (np->dp, fieldname, val); -} - -DEFINE_SET_FUNCTION (mode, MODE) -DEFINE_SET_FUNCTION (nlinks, NLINKS) -DEFINE_SET_FUNCTION (uid, UID) -DEFINE_SET_FUNCTION (gid, GID) -DEFINE_SET_FUNCTION (author, AUTHOR) -DEFINE_SET_FUNCTION (size, SIZE_LOW) -DEFINE_SET_FUNCTION (atime, ATIME_SEC) -DEFINE_SET_FUNCTION (mtime, MTIME_SEC) -DEFINE_SET_FUNCTION (ctime, CTIME_SEC) -DEFINE_SET_FUNCTION (flags, FLAGS) -DEFINE_SET_FUNCTION (blocks, BLOCKS) - -#under DEFINE_SET_FUNCTION +mach_port_t fs_control_port; /* receive right */ |