Thread: [Libsysio-commit] HEAD: libsysio/include inode.h
Brought to you by:
lward
From: Ruth K. <rk...@us...> - 2003-07-26 05:21:22
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv25000/include Modified Files: inode.h Log Message: Add capability of checking inode generation numbers, if a field for it exists in the stat struct. Bug fix for unlink/creat failure: Changes allow re-use of an inode which is no longer in use, but still exists in the inode cache. If the stat info for the new use matches cached info, the inode is re-used. If not, the old inode is marked 'zombie' and removed from the inode cache to make way for the new inode. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- inode.h 23 Apr 2003 19:45:51 -0000 1.6 +++ inode.h 25 Jul 2003 14:45:34 -0000 1.7 @@ -129,6 +129,7 @@ struct inode_ops { struct inode { LIST_ENTRY(inode) i_link; /* FS i-nodes link */ unsigned i_immune : 1; /* immune from GC */ + unsigned i_zombie : 1; /* stale inode */ unsigned i_ref; /* soft ref counter */ ino_t i_num; /* i-num (deprecate!) */ mode_t i_mode; /* mode (see stat.h) */ @@ -146,6 +147,7 @@ struct inode { #define I_INIT(ino, fs, inum, mode, rdev, ops, fid, immunity, private) \ do { \ (ino)->i_immune = (immunity) ? 1 : 0; \ + (ino)->i_zombie = 0; \ (ino)->i_ref = 0; \ (ino)->i_num = (inum); \ (ino)->i_mode = (mode); \ @@ -407,6 +409,7 @@ extern struct inode *_sysio_i_find(struc ino_t ino, struct file_identifier *fid); extern void _sysio_i_gone(struct inode *ino); +extern void _sysio_i_undead(struct inode *ino); extern int _sysio_p_find_alias(struct pnode *parent, struct qstr *name, struct pnode **pnop); |
From: Lee W. <lw...@us...> - 2003-08-22 02:16:28
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv4562 Modified Files: inode.h Log Message: Don't need multiple bit fields to represent two 1-bit flags. Coalesced them into one. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- inode.h 25 Jul 2003 14:45:34 -0000 1.7 +++ inode.h 21 Aug 2003 19:48:37 -0000 1.8 @@ -128,8 +128,9 @@ struct inode_ops { */ struct inode { LIST_ENTRY(inode) i_link; /* FS i-nodes link */ - unsigned i_immune : 1; /* immune from GC */ - unsigned i_zombie : 1; /* stale inode */ + unsigned + i_immune : 1, /* immune from GC */ + i_zombie : 1; /* stale inode */ unsigned i_ref; /* soft ref counter */ ino_t i_num; /* i-num (deprecate!) */ mode_t i_mode; /* mode (see stat.h) */ |
From: Lee W. <lw...@us...> - 2003-10-15 18:01:01
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv9577/include Modified Files: inode.h Log Message: Eliminated the i-node number field from the inode structure. We already carry the file identifier so it was redundant. Problematic too, in that it can be 32 or 64 bits in size. This forced _sysio_i_new() and _sysio_i_find() to change -- They no longer take the i-node number as an argument. Updated the driver calls to reflect the new usage. The i-node cache is now indexed by hashing the file identifier as opposed to just using the, no longer maintained, i-node number. This caused _sysio_i_find to become 2+ percent more expensive to use. Acceptable for me. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- inode.h 13 Oct 2003 01:04:35 -0000 1.11 +++ inode.h 15 Oct 2003 18:00:56 -0000 1.12 @@ -134,7 +134,6 @@ struct inode { i_immune : 1, /* immune from GC */ i_zombie : 1; /* stale inode */ unsigned i_ref; /* soft ref counter */ - ino_t i_num; /* i-num (deprecate!) */ mode_t i_mode; /* mode (see stat.h) */ dev_t i_rdev; /* dev (if device) */ struct inode_ops i_ops; /* operations */ @@ -147,12 +146,11 @@ struct inode { /* * Init an i-node record. */ -#define I_INIT(ino, fs, inum, mode, rdev, ops, fid, immunity, private) \ +#define I_INIT(ino, fs, mode, rdev, ops, fid, immunity, private) \ do { \ (ino)->i_immune = (immunity) ? 1 : 0; \ (ino)->i_zombie = 0; \ (ino)->i_ref = 0; \ - (ino)->i_num = (inum); \ (ino)->i_mode = (mode); \ (ino)->i_rdev = (rdev); \ (ino)->i_ops = *(ops); \ @@ -403,7 +401,6 @@ extern TAILQ_HEAD(pnodes_head, pnode) _s extern int _sysio_i_init(void); extern struct inode *_sysio_i_new(struct filesys *fs, - ino_t ino, struct file_identifier *fid, mode_t type, dev_t rdev, @@ -411,7 +408,6 @@ extern struct inode *_sysio_i_new(struct struct inode_ops *ops, void *private); extern struct inode *_sysio_i_find(struct filesys *fs, - ino_t ino, struct file_identifier *fid); extern void _sysio_i_gone(struct inode *ino); extern void _sysio_i_undead(struct inode *ino); |
From: Lee W. <lw...@us...> - 2003-10-17 21:30:33
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv10931/include Modified Files: inode.h Log Message: Added a done bit to the IO context record to *positively* signal completion. Also, added a driver private pointer to the dsame record for handy use. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- inode.h 15 Oct 2003 18:00:56 -0000 1.12 +++ inode.h 17 Oct 2003 21:30:29 -0000 1.13 @@ -356,7 +356,8 @@ struct ioctx_callback { struct ioctx { LIST_ENTRY(ioctx) ioctx_link; /* AIO list link */ unsigned - ioctx_fast : 1; /* from stack space */ + ioctx_fast : 1, /* from stack space */ + ioctx_done : 1; /* transfer complete */ ioid_t ioctx_id; /* unique ident */ struct inode *ioctx_ino; /* i-node */ const struct iovec *ioctx_iovec; /* scatter/gather vec */ @@ -364,7 +365,8 @@ struct ioctx { _SYSIO_OFF_T ioctx_offset; /* file offset */ ssize_t ioctx_cc; /* rtn char count */ int ioctx_errno; /* error number */ - TAILQ_HEAD(, ioctx_callback) ioctx_cbq; /* error number */ + TAILQ_HEAD(, ioctx_callback) ioctx_cbq; /* callback queue */ + void *ioctx_private; /* driver data */ }; /* @@ -373,6 +375,7 @@ struct ioctx { #define IOCTX_INIT(ioctx, fast, id, ino, iov, iovlen, off) \ do { \ (ioctx)->ioctx_fast = (fast); \ + (ioctx)->ioctx_done = 0; \ (ioctx)->ioctx_id = (id); \ (ioctx)->ioctx_ino = (ino); \ (ioctx)->ioctx_iovec = (iov); \ @@ -381,7 +384,9 @@ struct ioctx { (ioctx)->ioctx_cc = 0; \ (ioctx)->ioctx_errno = 0; \ TAILQ_INIT(&(ioctx)->ioctx_cbq); \ + (ioctx)->ioctx_private = NULL; \ } while (0) + /* * Return whether a pnode/inode is on a read-only mount or file system. */ |
From: Lee W. <lw...@us...> - 2004-05-28 12:48:37
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12502/include Modified Files: inode.h Log Message: Accounting mods required for Red Storm require us to track the requested IO operation through the life of that operation. Most importantly, the ioctx record has a new field, ioctx_write. If set, the operation is/was a write. Otherwise a read. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- inode.h 28 Apr 2004 12:23:19 -0000 1.17 +++ inode.h 28 May 2004 12:48:26 -0000 1.18 @@ -368,7 +368,8 @@ struct ioctx { LIST_ENTRY(ioctx) ioctx_link; /* AIO list link */ unsigned ioctx_fast : 1, /* from stack space */ - ioctx_done : 1; /* transfer complete */ + ioctx_done : 1, /* transfer complete */ + ioctx_write : 1; /* op is a write */ ioid_t ioctx_id; /* unique ident */ struct inode *ioctx_ino; /* i-node */ const struct iovec *ioctx_iov; /* scatter/gather vec */ @@ -384,10 +385,11 @@ struct ioctx { /* * Init IO context record. */ -#define IOCTX_INIT(ioctx, fast, id, ino, iov, iovlen, xtv, xtvlen) \ +#define IOCTX_INIT(ioctx, fast, id, wr, ino, iov, iovlen, xtv, xtvlen) \ do { \ (ioctx)->ioctx_fast = (fast); \ (ioctx)->ioctx_done = 0; \ + (ioctx)->ioctx_write = (wr) ? 1 : 0; \ (ioctx)->ioctx_id = (id); \ (ioctx)->ioctx_ino = (ino); \ (ioctx)->ioctx_iov = (iov); \ @@ -474,6 +476,7 @@ extern int _sysio_p_chdir(struct pnode * extern int _sysio_ioctx_init(void); extern void _sysio_ioctx_enter(struct ioctx *ioctx); extern struct ioctx *_sysio_ioctx_new(struct inode *ino, + int wr, const struct iovec *iov, size_t iovlen, const struct intnl_xtvec *xtv, |
From: Lee W. <lw...@us...> - 2004-07-27 15:01:36
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10818/include Modified Files: inode.h Log Message: The public include xtio.h was mostly unneeded, except for the definition of ioid_t. For the internals, we are converted to using the address of the IO context record as the identifier. Removed, finally, xtio.h from everything not involving the data path. Externally, of course, everything is the same. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- inode.h 26 Jul 2004 16:38:01 -0000 1.20 +++ inode.h 27 Jul 2004 15:00:41 -0000 1.21 @@ -370,7 +370,6 @@ struct ioctx { ioctx_fast : 1, /* from stack space */ ioctx_done : 1, /* transfer complete */ ioctx_write : 1; /* op is a write */ - ioid_t ioctx_id; /* unique ident */ struct inode *ioctx_ino; /* i-node */ const struct iovec *ioctx_iov; /* scatter/gather vec */ size_t ioctx_iovlen; /* iovec length */ @@ -385,12 +384,11 @@ struct ioctx { /* * Init IO context record. */ -#define IOCTX_INIT(ioctx, fast, id, wr, ino, iov, iovlen, xtv, xtvlen) \ +#define IOCTX_INIT(ioctx, fast, wr, ino, iov, iovlen, xtv, xtvlen) \ do { \ (ioctx)->ioctx_fast = (fast); \ (ioctx)->ioctx_done = 0; \ (ioctx)->ioctx_write = (wr) ? 1 : 0; \ - (ioctx)->ioctx_id = (id); \ (ioctx)->ioctx_ino = (ino); \ (ioctx)->ioctx_iov = (iov); \ (ioctx)->ioctx_iovlen = (iovlen); \ @@ -486,7 +484,7 @@ extern int _sysio_ioctx_cb(struct ioctx void (*f)(struct ioctx *, void *), void *data); extern void _sysio_ioctx_cb_free(struct ioctx_callback *cb); -extern struct ioctx *_sysio_ioctx_find(ioid_t id); +extern struct ioctx *_sysio_ioctx_find(void *id); extern ssize_t _sysio_ioctx_wait(struct ioctx *ioctx); extern void _sysio_ioctx_complete(struct ioctx *ioctx); extern ssize_t _sysio_validx(const struct intnl_xtvec *xtv, size_t xtvlen, |
From: Lee W. <lw...@us...> - 2004-09-21 16:18:40
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25715/include Modified Files: inode.h Log Message: From Henry Pierce at Cray; A chdir() to a directory without `x' permission should not succeed but does. This required that inodes now carry the full attributes -- Not just the mode bits. That's a bug change. Driver writers; 1) _sysio_i_new is altered. It needs the full intnl_stat structure now. 2) Your lookup function should refresh the inode attributes. 3) We don't keep an inode dirty bit. Hopefully, you've been pushing changes at the time of the operation instead of waiting until the inode was flushed or somesuch. Maybe you keep an internal dirty bit? Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- inode.h 27 Jul 2004 15:00:41 -0000 1.21 +++ inode.h 21 Sep 2004 16:18:30 -0000 1.22 @@ -135,9 +135,8 @@ struct inode { i_immune : 1, /* immune from GC */ i_zombie : 1; /* stale inode */ unsigned i_ref; /* soft ref counter */ - mode_t i_mode; /* mode (see stat.h) */ - dev_t i_rdev; /* dev (if device) */ struct inode_ops i_ops; /* operations */ + struct intnl_stat i_stbuf; /* attrs */ struct filesys *i_fs; /* file system ptr */ struct file_identifier *i_fid; /* file ident */ void *i_private; /* driver data */ @@ -147,14 +146,13 @@ struct inode { /* * Init an i-node record. */ -#define I_INIT(ino, fs, mode, rdev, ops, fid, immunity, private) \ +#define I_INIT(ino, fs, stat, ops, fid, immunity, private) \ do { \ (ino)->i_immune = (immunity) ? 1 : 0; \ (ino)->i_zombie = 0; \ (ino)->i_ref = 0; \ - (ino)->i_mode = (mode); \ - (ino)->i_rdev = (rdev); \ (ino)->i_ops = *(ops); \ + (ino)->i_stbuf = *(stat); \ (ino)->i_fs = (fs); \ (ino)->i_fid = (fid); \ (ino)->i_private = (private); \ @@ -423,8 +421,7 @@ extern void _sysio_i_shutdown(void); #endif extern struct inode *_sysio_i_new(struct filesys *fs, struct file_identifier *fid, - mode_t type, - dev_t rdev, + struct intnl_stat *stat, unsigned immunity, struct inode_ops *ops, void *private); @@ -466,6 +463,7 @@ extern int _sysio_path_walk(struct pnode #ifdef AUTOMOUNT_FILE_NAME extern void _sysio_next_component(const char *path, struct qstr *name); #endif +extern int _sysio_permitted(struct inode *ino, int amode); extern int _sysio_namei(struct pnode *pno, const char *path, unsigned flags, |
From: Lee W. <lw...@us...> - 2005-02-25 00:01:31
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7456/include Modified Files: inode.h Log Message: Cleaned up some duplicated code in the iodone path. As well, there is no a global _sysio_iodone for use by all internal components. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- inode.h 25 Oct 2004 14:29:16 -0000 1.23 +++ inode.h 25 Feb 2005 00:01:06 -0000 1.24 @@ -483,6 +483,7 @@ extern int _sysio_ioctx_cb(struct ioctx void *data); extern void _sysio_ioctx_cb_free(struct ioctx_callback *cb); extern struct ioctx *_sysio_ioctx_find(void *id); +extern int _sysio_ioctx_done(struct ioctx *ioctx); extern ssize_t _sysio_ioctx_wait(struct ioctx *ioctx); extern void _sysio_ioctx_complete(struct ioctx *ioctx); extern int _sysio_open(struct pnode *pno, int flags, mode_t mode); |
From: Lee W. <lw...@us...> - 2007-05-14 15:47:34
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16125/include Modified Files: inode.h Log Message: Not yet ready for the ioctx_pno member in the ioctx record. This can't return until we are ready to force some sort of interface change. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -w -b -B -p -r1.31 -r1.32 --- inode.h 9 May 2007 23:16:20 -0000 1.31 +++ inode.h 14 May 2007 15:47:30 -0000 1.32 @@ -441,7 +441,9 @@ struct ioctx { ioctx_fast : 1, /* from stack space */ ioctx_done : 1, /* transfer complete */ ioctx_write : 1; /* op is a write */ +#ifdef not_yet struct pnode *ioctx_pno; /* p-node */ +#endif struct inode *ioctx_ino; /* i-node (deprecate) */ const struct iovec *ioctx_iov; /* scatter/gather vec */ size_t ioctx_iovlen; /* iovec length */ @@ -461,7 +463,6 @@ struct ioctx { (ioctx)->ioctx_fast = (fast); \ (ioctx)->ioctx_done = 0; \ (ioctx)->ioctx_write = (wr) ? 1 : 0; \ - (ioctx)->ioctx_pno = (pno); \ (ioctx)->ioctx_ino = (pno)->p_base->pb_ino; \ (ioctx)->ioctx_iov = (iov); \ (ioctx)->ioctx_iovlen = (iovlen); \ |
From: Lee W. <lw...@us...> - 2007-09-21 19:41:40
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv759/include Modified Files: inode.h Log Message: The pnode base name cache is now maintained as a hashed table of trees, instead of lists. The pnode base record was re-organized. The qstr name record and parent were grouped under a pnodE_base_key sub-record and the new field named pb_key. As well, the LIST_ENTRY for pb_names was removed and a struct tree record added, reflecting the conversion to trees from lists in the hash table slots. + Fixed an issue in inode.c where the pnode base nodes were being reclaimed wholesale, instead of partially, on every call to the garbage collector. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -w -b -B -p -r1.32 -r1.33 --- inode.h 14 May 2007 15:47:30 -0000 1.32 +++ inode.h 21 Sep 2007 19:41:37 -0000 1.33 @@ -41,6 +41,8 @@ * le...@sa... */ +#include "tree.h" + #if defined(AUTOMOUNT_FILE_NAME) && !defined(MAX_MOUNT_DEPTH) /* * Maximum number of automounts to attempt in path traversal. @@ -205,13 +207,15 @@ struct qstr { * common information. */ struct pnode_base { - struct qstr pb_name; /* entry name */ + struct tree_node pb_tentry; /* cache node entry */ + struct pnode_base_key { + struct qstr pbk_name; /* entry name */ + struct pnode_base *pbk_parent; /* parent */ + } pb_key; struct inode *pb_ino; /* inode */ LIST_HEAD(, pnode_base) pb_children; /* children if a dir */ LIST_ENTRY(pnode_base) pb_sibs; /* links to siblings */ - LIST_ENTRY(pnode_base) pb_names; /* near names links */ LIST_HEAD(, pnode) pb_aliases; /* aliases */ - struct pnode_base *pb_parent; /* parent */ }; /* |
From: Lee W. <lw...@us...> - 2007-09-21 20:12:58
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14759/include Modified Files: inode.h Log Message: - No longer maintain a list of all pnodes in the system. + Introduce a list of idle pnodes for use by the garbage collector. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -w -b -B -p -r1.33 -r1.34 --- inode.h 21 Sep 2007 19:41:37 -0000 1.33 +++ inode.h 21 Sep 2007 20:12:55 -0000 1.34 @@ -259,7 +259,7 @@ struct pnode { struct mount *p_mount; /* mount info */ struct pnode *p_cover; /* covering pnode */ LIST_ENTRY(pnode) p_links; /* other aliases */ - TAILQ_ENTRY(pnode) p_nodes; /* all nodes links */ + TAILQ_ENTRY(pnode) p_idle; /* idle list links */ }; /* @@ -267,9 +267,8 @@ struct pnode { */ #define P_REF(pno) \ do { \ - TAILQ_REMOVE(&_sysio_pnodes, (pno), p_nodes); \ - TAILQ_INSERT_TAIL(&_sysio_pnodes, (pno), p_nodes); \ - (pno)->p_ref++; \ + if (!(pno)->p_ref++) \ + TAILQ_REMOVE(&_sysio_idle_pnodes, (pno), p_idle); \ assert((pno)->p_ref); \ } while (0) @@ -279,7 +278,8 @@ struct pnode { #define P_RELE(pno) \ do { \ assert((pno)->p_ref); \ - --(pno)->p_ref; \ + if (!--(pno)->p_ref) \ + TAILQ_INSERT_TAIL(&_sysio_idle_pnodes, (pno), p_idle); \ } while (0) /* @@ -487,7 +487,7 @@ struct ioctx { extern struct pnode *_sysio_root; extern TAILQ_HEAD(inodes_head, inode) _sysio_inodes; -extern TAILQ_HEAD(pnodes_head, pnode) _sysio_pnodes; +extern TAILQ_HEAD(pnodes_head, pnode) _sysio_idle_pnodes; extern int _sysio_i_init(void); #ifdef ZERO_SUM_MEMORY |
From: Lee W. <lw...@us...> - 2007-11-20 17:49:29
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31929/include Modified Files: inode.h Log Message: Added _sysio_p_link and modified library entry-point to use it. Also, added IS_RDONLY checks to many pnode manipulation routines in inode.c Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -w -b -B -p -r1.34 -r1.35 --- inode.h 21 Sep 2007 20:12:55 -0000 1.34 +++ inode.h 20 Nov 2007 17:49:26 -0000 1.35 @@ -526,6 +526,7 @@ extern char *_sysio_pb_path(struct pnode extern int _sysio_p_setattr(struct pnode *pno, unsigned mask, struct intnl_stat *stbuf); +extern int _sysio_p_link(struct pnode *old, struct pnode *new); extern int _sysio_p_unlink(struct pnode *pno); extern int _sysio_p_rmdir(struct pnode *pno); extern int _sysio_p_rename(struct pnode *old, struct pnode *new); |
From: Lee W. <lw...@us...> - 2007-11-20 18:01:57
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4690/include Modified Files: inode.h Log Message: Crafted new _sysio_p_symlink routine and modified the symlink library entry-point to use it. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -b -B -p -r1.35 -r1.36 --- inode.h 20 Nov 2007 17:49:26 -0000 1.35 +++ inode.h 20 Nov 2007 18:01:42 -0000 1.36 @@ -528,6 +528,7 @@ extern int _sysio_p_setattr(struct pnode struct intnl_stat *stbuf); extern int _sysio_p_link(struct pnode *old, struct pnode *new); extern int _sysio_p_unlink(struct pnode *pno); +extern int _sysio_p_symlink(const char *oldpath, struct pnode *new); extern int _sysio_p_rmdir(struct pnode *pno); extern int _sysio_p_rename(struct pnode *old, struct pnode *new); extern void _sysio_do_noop(void); |
From: Lee W. <lw...@us...> - 2008-04-14 23:22:03
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32184 Modified Files: inode.h Log Message: Two changes: 1) Made _sysio_p_path public. 2) Added _sysio_p_show for diagnostics. It is conditionally defined if P_DEBUG is defined. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -w -b -B -p -r1.36 -r1.37 --- inode.h 20 Nov 2007 18:01:42 -0000 1.36 +++ inode.h 14 Apr 2008 23:21:58 -0000 1.37 @@ -507,6 +507,10 @@ extern struct pnode_base *_sysio_pb_new( struct pnode_base *parent, struct inode *ino); extern void _sysio_pb_gone(struct pnode_base *pb); +extern int _sysio_p_path(struct pnode *pno, char **bufp, size_t size); +#ifdef P_DEBUG +extern void _sysio_p_show(const char *pre, struct pnode *pno); +#endif extern int _sysio_p_find_alias(struct pnode *parent, struct qstr *name, struct pnode **pnop); |
From: Lee W. <lw...@us...> - 2008-04-23 16:46:45
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27174/include Modified Files: inode.h Log Message: If P_RECLAIM_DEBUG is definded then at each reclaim a count of the number of pnode_base nodes present in the system is printed along with the number of those that are leaves and the number of interior nodes without aliases (orphpans). Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -w -b -B -p -r1.37 -r1.38 --- inode.h 14 Apr 2008 23:21:58 -0000 1.37 +++ inode.h 23 Apr 2008 16:46:40 -0000 1.38 @@ -216,6 +216,9 @@ struct pnode_base { LIST_HEAD(, pnode_base) pb_children; /* children if a dir */ LIST_ENTRY(pnode_base) pb_sibs; /* links to siblings */ LIST_HEAD(, pnode) pb_aliases; /* aliases */ +#ifdef P_RECLAIM_DEBUG + LIST_ENTRY(pnode_base) pb_links; /* all pbnodes links */ +#endif }; /* |
From: Lee W. <lw...@us...> - 2008-07-11 16:48:06
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8234/include Modified Files: inode.h Log Message: Added per-directory name cache, replacing the global names cache. This involved: 1) Adding a root node for the binary tree to the path_base record. 2) Removing the global names cache from inode.c 3) Altering the implementation of ncache_{insert,delete} to use the parent node's names root as root. 4) Altering ncache_lookup to take the parent node and use it's root to find the key. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -w -b -B -p -r1.39 -r1.40 --- inode.h 17 Jun 2008 17:18:57 -0000 1.39 +++ inode.h 11 Jul 2008 16:48:01 -0000 1.40 @@ -272,6 +272,7 @@ struct qstr { struct pnode_base { mutex_t pb_mutex; /* record mutex */ unsigned pb_lckcnt; /* # recursive locks */ + struct tree_node *pb_ncache; /* names cache */ struct tree_node pb_tentry; /* cache node entry */ struct pnode_base_key { struct qstr pbk_name; /* entry name */ @@ -293,6 +294,7 @@ struct pnode_base { do { \ mutex_init(&(_pb)->pb_mutex, MUTEX_RECURSIVE); \ (_pb)->pb_lckcnt = 0; \ + (_pb)->pb_ncache = NULL; \ (_pb)->pb_tentry.tn_key = &(_pb)->pb_key; \ (_pb)->pb_tentry.tn_left = (_pb)->pb_tentry.tn_right = NULL; \ (_pb)->pb_key.pbk_name = *(_name); \ |
From: Lee W. <lw...@us...> - 2008-07-14 19:14:10
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12946/include Modified Files: inode.h Log Message: Updated copyright date. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -w -b -B -p -r1.41 -r1.42 --- inode.h 11 Jul 2008 18:23:57 -0000 1.41 +++ inode.h 14 Jul 2008 19:14:07 -0000 1.42 @@ -9,7 +9,7 @@ * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * - * Cplant(TM) Copyright 1998-2007 Sandia Corporation. + * Cplant(TM) Copyright 1998-2008 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States |
From: Lee W. <lw...@us...> - 2008-12-05 20:25:12
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27935 Modified Files: inode.h Log Message: The I_GONE macro was really just doing only creating a zombie inode. With this change, it's really gone now. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -w -b -B -p -r1.43 -r1.44 --- inode.h 26 Jul 2008 01:33:14 -0000 1.43 +++ inode.h 5 Dec 2008 20:25:06 -0000 1.44 @@ -246,8 +246,7 @@ struct inode { #define I_GONE(_ino) \ do { \ _I_CHECK_LOCK((_ino), 1); \ - _sysio_i_undead(_ino); \ - I_PUT(_ino); \ + _sysio_i_gone(_ino); \ } while (0) /* |
From: Lee W. <lw...@us...> - 2008-12-06 18:47:22
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11611 Modified Files: inode.h Log Message: Fixed INT_READLINK. It was mapping to some sort of half-create plus a setattr. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -w -b -B -p -r1.44 -r1.45 --- inode.h 5 Dec 2008 20:25:06 -0000 1.44 +++ inode.h 6 Dec 2008 18:47:14 -0000 1.45 @@ -569,8 +569,8 @@ struct intent { #define INT_SETATTR 0x02 /* set attrs */ #define INT_UPDPARENT 0x04 /* insert/delete */ #define INT_OPEN 0x08 /* open */ -#define INT_CREAT (INT_UPDPARENT|0x10) /* insert */ -#define INT_READLINK 0x12 /* readlink */ +#define INT_CREAT (0x10|INT_UPDPARENT) /* creat obj */ +#define INT_READLINK 0x20 /* readlink */ #define INTENT_INIT(intnt, mask, arg1, arg2) \ do { \ |
From: Lee W. <lw...@us...> - 2008-12-15 18:32:53
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15635/include Modified Files: inode.h Log Message: Remove move-to-front policy maintenance for inodes. Since we no longer reclaim them, separately, this was work to no end. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -w -b -B -p -r1.45 -r1.46 --- inode.h 6 Dec 2008 18:47:14 -0000 1.45 +++ inode.h 15 Dec 2008 18:32:40 -0000 1.46 @@ -190,8 +190,6 @@ struct inode { #define _I_REF_NO_LOCK(_ino) \ do { \ _I_CHECK_LOCK((_ino), 1); \ - TAILQ_REMOVE(&_sysio_inodes, (_ino), i_nodes); \ - TAILQ_INSERT_TAIL(&_sysio_inodes, (_ino), i_nodes); \ (_ino)->i_ref++; \ assert((_ino)->i_ref); \ } while (0) |
From: Lee W. <lw...@us...> - 2008-12-15 19:56:02
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20145/include Modified Files: inode.h Log Message: The all-pbnodes list is changed to be maintained as a tailq, instead of a simple linked list. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.46 retrieving revision 1.47 diff -u -w -b -B -p -r1.46 -r1.47 --- inode.h 15 Dec 2008 18:32:40 -0000 1.46 +++ inode.h 15 Dec 2008 19:55:54 -0000 1.47 @@ -277,7 +277,7 @@ struct pnode_base { LIST_ENTRY(pnode_base) pb_sibs; /* links to siblings */ LIST_HEAD(, pnode) pb_aliases; /* aliases */ #ifdef P_RECLAIM_DEBUG - LIST_ENTRY(pnode_base) pb_links; /* all pbnodes links */ + TAILQ_ENTRY(pnode_base) pb_links; /* all pbnodes links */ #endif }; |
From: Lee W. <lw...@us...> - 2009-01-05 19:19:42
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10773/include Modified Files: inode.h Log Message: We no longer reclaim i_nodes directly. Instead, as path-base nodes are released by the path node reclamation, the i-node is dismissed directly. It served no useful purpose to retain these beyond the life of the set of associated path-base nodes. As well, if PB_DEBUG is defined then a list of leaf path-base nodes is kept and reported when we are dbugging reclamation. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.47 retrieving revision 1.48 diff -u -w -b -B -p -r1.47 -r1.48 --- inode.h 15 Dec 2008 19:55:54 -0000 1.47 +++ inode.h 5 Jan 2009 19:19:29 -0000 1.48 @@ -276,8 +276,8 @@ struct pnode_base { LIST_HEAD(, pnode_base) pb_children; /* children if a dir */ LIST_ENTRY(pnode_base) pb_sibs; /* links to siblings */ LIST_HEAD(, pnode) pb_aliases; /* aliases */ -#ifdef P_RECLAIM_DEBUG - TAILQ_ENTRY(pnode_base) pb_links; /* all pbnodes links */ +#ifdef PB_DEBUG + TAILQ_ENTRY(pnode_base) pb_links; /* leaf pbnodes links */ #endif }; |
From: Lee W. <lw...@us...> - 2009-01-22 19:07:55
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15278/include Modified Files: inode.h Log Message: With I_ASSOCIATIONS defined, inodes keep a list of all path-base nodes that are currently associated. Always, association of a path-base node with an i-node is now done via the macro PB_SET_ASSOC(). This, new, macro will not allow an already associated path-base node to gain a new association; This to enforce the emerging policy of "once set, immutable" for these nodes. You can set the association of an unassociated path-base node or clear it, only. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -w -b -B -p -r1.48 -r1.49 --- inode.h 5 Jan 2009 19:19:29 -0000 1.48 +++ inode.h 22 Jan 2009 19:07:42 -0000 1.49 @@ -139,10 +139,22 @@ struct inode { struct inode_ops i_ops; /* operations */ struct intnl_stat i_stbuf; /* attrs */ struct filesys *i_fs; /* file system ptr */ +#ifdef I_ASSOCIATIONS + LIST_HEAD(, pnode_base) i_assoc; /* assoc'd pbnodes */ +#endif void *i_private; /* driver data */ TAILQ_ENTRY(inode) i_nodes; /* all i-nodes link */ }; +#ifdef I_ASSOCIATIONS +#define _I_INIT_MORE(_ino) \ + do { \ + LIST_INIT(&(_ino)->i_assoc); \ + } while (0) +#else +#define _I_INIT_MORE(_ino) +#endif + /* * Init an i-node record. */ @@ -160,6 +172,7 @@ struct inode { (ino)->i_stbuf = *(stat); \ (ino)->i_fs = (fs); \ (ino)->i_private = (private); \ + _I_INIT_MORE(ino); \ } while (0) #ifdef LOCK_DEBUG @@ -248,6 +261,20 @@ struct inode { } while (0) /* + * Check association; Logical true if so, otherwise false. + * + * NB: The given i-node should be locked or otherwise protected from + * manipulation by others. + */ +#ifdef I_ASSOCIATIONS +#define I_ISASSOC(_ino) \ + ((_ino)->i_assoc.lh_first) +#else +#define I_ISASSOC(_ino) \ + (0) +#endif + +/* * The "quick string" record (inspired by the structure of the same name * from Linux) is used to pass a string without delimiters as well as useful * information about the string. @@ -276,6 +303,9 @@ struct pnode_base { LIST_HEAD(, pnode_base) pb_children; /* children if a dir */ LIST_ENTRY(pnode_base) pb_sibs; /* links to siblings */ LIST_HEAD(, pnode) pb_aliases; /* aliases */ +#ifdef I_ASSOCIATIONS + LIST_ENTRY(pnode_base) pb_alinks; /* names to same ino */ +#endif #ifdef PB_DEBUG TAILQ_ENTRY(pnode_base) pb_links; /* leaf pbnodes links */ #endif @@ -284,7 +314,7 @@ struct pnode_base { /* * Init a path-base record. */ -#define PB_INIT(_pb, _name, _parent, _ino) \ +#define PB_INIT(_pb, _name, _parent) \ do { \ mutex_init(&(_pb)->pb_mutex, MUTEX_RECURSIVE); \ (_pb)->pb_lckcnt = 0; \ @@ -293,7 +323,7 @@ struct pnode_base { (_pb)->pb_tentry.tn_left = (_pb)->pb_tentry.tn_right = NULL; \ (_pb)->pb_key.pbk_name = *(_name); \ (_pb)->pb_key.pbk_parent = (_parent); \ - (_pb)->pb_ino = (_ino); \ + (_pb)->pb_ino = NULL; \ LIST_INIT(&(_pb)->pb_children); \ LIST_INIT(&(_pb)->pb_aliases); \ } while (0) @@ -342,6 +372,42 @@ struct pnode_base { } while (0) /* + * Set path-base node association. + * + * NB: All of the path-base node, any i-node it currently points at, and + * the new i-node must be locked. If the path-base node is associated, + * the association will be removed before making the new but it will not be + * released, unlocked, or dereferenced. + * + * NB(2): We no longer support re-association. Now, an association can be + * set, anew, or cleared (only when destroying the path-base node. + */ +#ifdef I_ASSOCIATIONS +#define PB_SET_ASSOC(_pb, _ino) \ + do { \ + _PB_CHECK_LOCK((_pb), 1); \ + if ((_pb)->pb_ino) { \ + assert(!(_ino)); \ + _I_CHECK_LOCK((_pb)->pb_ino, 1); \ + LIST_REMOVE((_pb), pb_alinks); \ + } \ + (_pb)->pb_ino = (_ino); \ + if ((_pb)->pb_ino) { \ + _I_CHECK_LOCK((_pb)->pb_ino, 1); \ + LIST_INSERT_HEAD(&(_pb)->pb_ino->i_assoc, \ + (_pb), \ + pb_alinks); \ + } \ + } while (0) +#else +#define PB_SET_ASSOC(_pb, _ino) \ + do { \ + assert(!((_pb)->pb_ino && (_ino))); \ + (_pb)->pb_ino = (_ino); \ + } while (0) +#endif + +/* * Since a file system may be multiply mounted, in different parts of the local * tree, a file system object may appear in different places. We handle that * with aliases. There is one pnode for every alias the system is tracking. |
From: Lee W. <lw...@us...> - 2009-01-22 19:12:27
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16097/include Modified Files: inode.h Log Message: Updated copyright. Sorry, should have done this with last check-in. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.49 retrieving revision 1.50 diff -u -w -b -B -p -r1.49 -r1.50 --- inode.h 22 Jan 2009 19:07:42 -0000 1.49 +++ inode.h 22 Jan 2009 19:12:19 -0000 1.50 @@ -9,7 +9,7 @@ * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * - * Cplant(TM) Copyright 1998-2008 Sandia Corporation. + * Cplant(TM) Copyright 1998-2009 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States |
From: Lee W. <lw...@us...> - 2009-01-28 16:13:26
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31818/include Modified Files: inode.h Log Message: Big code refactor to pave the way folr the handles-based API. No, real, functional change. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.50 retrieving revision 1.51 diff -u -w -b -B -p -r1.50 -r1.51 --- inode.h 22 Jan 2009 19:12:19 -0000 1.50 +++ inode.h 28 Jan 2009 16:13:19 -0000 1.51 @@ -766,6 +766,7 @@ extern struct pnode_base *_sysio_pb_new( struct pnode_base *parent, struct inode *ino); extern void _sysio_pb_gone(struct pnode_base *pb); +extern void _sysio_pb_disconnect(struct pnode_base *pb); extern int _sysio_p_path(struct pnode *pno, char **bufp, size_t size); #ifdef P_DEBUG extern void _sysio_p_show(const char *pre, struct pnode *pno); @@ -786,6 +787,10 @@ extern int _sysio_pb_pathof(struct pnode char separator, char **pathp); extern char *_sysio_pb_path(struct pnode_base *pb, char separator); +extern ssize_t _sysio_p_filldirentries(struct pnode *pno, + char *buf, + size_t nbytes, + _SYSIO_OFF_T *__restrict basep); extern int _sysio_p_setattr(struct pnode *pno, unsigned mask, struct intnl_stat *stbuf); @@ -793,7 +798,18 @@ extern int _sysio_p_link(struct pnode *o extern int _sysio_p_unlink(struct pnode *pno); extern int _sysio_p_symlink(const char *oldpath, struct pnode *new); extern int _sysio_p_rmdir(struct pnode *pno); +extern ssize_t _sysio_p_readlink(struct pnode *pno, char *buf, size_t bufsiz); extern int _sysio_p_rename(struct pnode *old, struct pnode *new); +extern int _sysio_p_iiox(int (*f)(struct ioctx *), + struct pnode *pno, + _SYSIO_OFF_T limit, + const struct iovec *iov, size_t iov_count, + void (*release_iov)(struct ioctx *, void *), + const struct intnl_xtvec *xtv, size_t xtv_count, + void (*release_xtv)(struct ioctx *, void *), + void (*completio)(struct ioctx *, void *), + void *data, + struct ioctx **ioctxp); extern void _sysio_do_noop(void); extern void _sysio_do_illop(void); extern int _sysio_do_ebadf(void); |