* terms of the GNU Lesser General Public License
* (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
*
- * Cplant(TM) Copyright 1998-2003 Sandia Corporation.
+ * Cplant(TM) Copyright 1998-2006 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
struct inode *ino,
unsigned mask,
struct intnl_stat *stbuf);
- ssize_t (*inop_getdirentries)(struct inode *ino,
- char *buf,
- size_t nbytes,
- _SYSIO_OFF_T *basep);
+ ssize_t (*inop_filldirentries)(struct inode *ino,
+ _SYSIO_OFF_T *posp,
+ char *buf,
+ size_t nbytes);
int (*inop_mkdir)(struct pnode *pno, mode_t mode);
int (*inop_rmdir)(struct pnode *pno);
int (*inop_symlink)(struct pnode *pno, const char *data);
int (*inop_write)(struct inode *ino, struct ioctx *ioctx);
_SYSIO_OFF_T (*inop_pos)(struct inode *ino, _SYSIO_OFF_T off);
int (*inop_iodone)(struct ioctx *iocp);
- int (*inop_fcntl)(struct inode *ino, int cmd, va_list ap);
+ int (*inop_fcntl)(struct inode *ino, int cmd, va_list ap, int *rtn);
int (*inop_sync)(struct inode *ino);
int (*inop_datasync)(struct inode *ino);
int (*inop_ioctl)(struct inode *ino, unsigned long int request, va_list ap);
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 */
/*
* 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); \
/*
* Values for nameidata flags field.
*/
-#define ND_NOFOLLOW 0x01 /* no follow symlinks */
-#define ND_NEGOK 0x02 /* last missing is ok */
+#define ND_NOFOLLOW 0x01 /* no follow symlinks */
+#define ND_NEGOK 0x02 /* last missing is ok */
+#define ND_NOPERMCHECK 0x04 /* don't check perms */
#ifdef AUTOMOUNT_FILE_NAME
#define _ND_INIT_AUTOMOUNT(nd) ((nd)->nd_amcnt = 0)
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 */
/*
* 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); \
} while (0)
/*
- * Return whether a pnode/inode is on a read-only mount or file system.
+ * Return whether access to a pnode is read-only.
*/
-#define IS_RDONLY(pno, ino) \
- ((((struct pnode *)(pno)) && \
- ((((struct pnode *)(pno))->p_mount->mnt_flags & MOUNT_F_RO) || \
- (((struct pnode *)(pno))->p_base->pb_ino && \
- (((struct pnode *)(pno))->p_base->pb_ino->i_fs->fs_flags & \
- FS_F_RO)))) || \
- (((struct inode *)(ino)) && \
- (((struct inode *)(ino))->i_fs->fs_flags & FS_F_RO)))
+#define IS_RDONLY(pno) \
+ ((pno)->p_mount->mnt_flags & MOUNT_F_RO)
extern struct pnode *_sysio_root;
extern TAILQ_HEAD(pnodes_head, pnode) _sysio_pnodes;
extern int _sysio_i_init(void);
-#if ZERO_SUM_MEMORY
+#ifdef ZERO_SUM_MEMORY
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);
extern int _sysio_do_ebadf(void);
extern int _sysio_do_einval(void);
extern int _sysio_do_enoent(void);
+extern int _sysio_do_enodev(void);
extern int _sysio_do_espipe(void);
extern int _sysio_do_eisdir(void);
extern int _sysio_do_enosys(void);
#ifdef AUTOMOUNT_FILE_NAME
extern void _sysio_next_component(const char *path, struct qstr *name);
#endif
+extern int _sysio_permitted(struct pnode *pno, int amode);
extern int _sysio_namei(struct pnode *pno,
const char *path,
unsigned flags,
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 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 ssize_t _sysio_validx(const struct intnl_xtvec *xtv, size_t xtvlen,
- const struct iovec *iov, size_t iovlen,
- _SYSIO_OFF_T limit);
-extern ssize_t _sysio_enumerate_extents(const struct intnl_xtvec *xtv,
- size_t xtvlen,
- const struct iovec *iov,
- size_t iovlen,
- ssize_t (*f)(const struct iovec *,
- int,
- _SYSIO_OFF_T,
- ssize_t,
- void *),
- void *arg);
-extern ssize_t _sysio_enumerate_iovec(const struct iovec *iov,
- size_t count,
- _SYSIO_OFF_T off,
- ssize_t limit,
- ssize_t (*f)(void *,
- size_t,
- _SYSIO_OFF_T,
- void *),
- void *arg);
-extern ssize_t _sysio_doio(const struct intnl_xtvec *xtv, size_t xtvlen,
- const struct iovec *iov, size_t iovlen,
- ssize_t (*f)(void *, size_t, _SYSIO_OFF_T, void *),
- void *arg);
extern int _sysio_open(struct pnode *pno, int flags, mode_t mode);
+extern int _sysio_mkdir(struct pnode *where, mode_t mode);
+extern int _sysio_mknod(struct pnode *where, mode_t mode, dev_t dev);