[Libsysio-commit] HEAD: libsysio/include inode.h
Brought to you by:
lward
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, |