summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2006-05-01 21:08:45 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2006-05-01 21:08:45 +0000
commit50a6c9e7b9e92d2ec426061c3c0a401b497ad66d (patch)
tree541dd058787f03027918fa0db460b2506a66f8c0
parent7c689a386d89a39c1110114d82f4b15947d7fdfa (diff)
Rename functions and move prototypes around
-rw-r--r--sys/kern/vfs_getcwd.c24
-rw-r--r--sys/sys/vnode.h11
2 files changed, 18 insertions, 17 deletions
diff --git a/sys/kern/vfs_getcwd.c b/sys/kern/vfs_getcwd.c
index 64a51b20764..3b7195788c3 100644
--- a/sys/kern/vfs_getcwd.c
+++ b/sys/kern/vfs_getcwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_getcwd.c,v 1.6 2006/05/01 20:03:06 pedro Exp $ */
+/* $OpenBSD: vfs_getcwd.c,v 1.7 2006/05/01 21:08:44 pedro Exp $ */
/* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */
/*
@@ -54,19 +54,11 @@
#include <sys/syscallargs.h>
-int getcwd_scandir(struct vnode **, struct vnode **, char **, char *,
- struct proc *);
-int getcwd_common(struct vnode *, struct vnode *, char **, char *, int, int,
- struct proc *);
-
-int getcwd_getcache(struct vnode **, struct vnode **, char **, char *);
-int vn_isunder(struct vnode *, struct vnode *, struct proc *);
-
#define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN + 1) + 4)
/* Find parent vnode of *lvpp, return in *uvpp */
int
-getcwd_scandir(struct vnode **lvpp, struct vnode **uvpp, char **bpp,
+vfs_getcwd_scandir(struct vnode **lvpp, struct vnode **uvpp, char **bpp,
char *bufp, struct proc *p)
{
int eofflag, tries, dirbuflen, len, reclen, error = 0;
@@ -216,7 +208,7 @@ out:
/* Do a lookup in the vnode-to-name reverse */
int
-getcwd_getcache(struct vnode **lvpp, struct vnode **uvpp, char **bpp,
+vfs_getcwd_getcache(struct vnode **lvpp, struct vnode **uvpp, char **bpp,
char *bufp)
{
struct vnode *lvp, *uvp = NULL;
@@ -276,7 +268,7 @@ getcwd_getcache(struct vnode **lvpp, struct vnode **uvpp, char **bpp,
/* Common routine shared by sys___getcwd() and vn_isunder() */
int
-getcwd_common(struct vnode *lvp, struct vnode *rvp, char **bpp, char *bufp,
+vfs_getcwd_common(struct vnode *lvp, struct vnode *rvp, char **bpp, char *bufp,
int limit, int flags, struct proc *p)
{
struct filedesc *fdp = p->p_fd;
@@ -355,11 +347,11 @@ getcwd_common(struct vnode *lvp, struct vnode *rvp, char **bpp, char *bufp,
}
/* Look in the name cache */
- error = getcwd_getcache(&lvp, &uvp, &bp, bufp);
+ error = vfs_getcwd_getcache(&lvp, &uvp, &bp, bufp);
if (error == -1) {
/* If that fails, look in the directory */
- error = getcwd_scandir(&lvp, &uvp, &bp, bufp, p);
+ error = vfs_getcwd_scandir(&lvp, &uvp, &bp, bufp, p);
}
if (error)
@@ -404,7 +396,7 @@ vn_isunder(struct vnode *lvp, struct vnode *rvp, struct proc *p)
{
int error;
- error = getcwd_common(lvp, rvp, NULL, NULL, MAXPATHLEN/2, 0, p);
+ error = vfs_getcwd_common(lvp, rvp, NULL, NULL, MAXPATHLEN/2, 0, p);
if (!error)
return (1);
@@ -452,7 +444,7 @@ sys___getcwd(struct proc *p, void *v, register_t *retval)
* Since each entry takes up at least 2 bytes in the output
* buffer, limit it to N/2 vnodes for an N byte buffer.
*/
- error = getcwd_common(p->p_fd->fd_cdir, NULL, &bp, path, len/2,
+ error = vfs_getcwd_common(p->p_fd->fd_cdir, NULL, &bp, path, len/2,
GETCWD_CHECK_ACCESS, p);
if (error)
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index abd8e0345e5..cd4c0da97d8 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnode.h,v 1.67 2006/04/08 11:30:16 pedro Exp $ */
+/* $OpenBSD: vnode.h,v 1.68 2006/05/01 21:08:44 pedro Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@@ -436,6 +436,14 @@ int vinvalbuf(struct vnode *vp, int save, struct ucred *cred,
#ifdef DIAGNOSTIC
void vprint(char *, struct vnode *);
#endif
+
+/* vfs_getcwd.c */
+int vfs_getcwd_scandir(struct vnode **, struct vnode **, char **, char *,
+ struct proc *);
+int vfs_getcwd_common(struct vnode *, struct vnode *, char **, char *, int,
+ int, struct proc *);
+int vfs_getcwd_getcache(struct vnode **, struct vnode **, char **, char *);
+
int vop_generic_bwrite(void *ap);
int vn_access(struct vnode *, int);
void vn_update(void);
@@ -448,6 +456,7 @@ int vn_rdwr(enum uio_rw rw, struct vnode *vp, caddr_t base,
int len, off_t offset, enum uio_seg segflg, int ioflg,
struct ucred *cred, size_t *aresid, struct proc *p);
int vn_lock(struct vnode *vp, int flags, struct proc *p);
+int vn_isunder(struct vnode *, struct vnode *, struct proc *);
int vop_generic_abortop(void *);
int vop_generic_islocked(void *);