Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jun 2009 09:48:08 GMT
From:      Zhao Shuai <zhaoshuai@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 165033 for review
Message-ID:  <200906240948.n5O9m8j6072406@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=165033

Change 165033 by zhaoshuai@zhaoshuai on 2009/06/24 09:47:21

	rename pipe_foo() to pipe_foo_f(), and generic_pipe_foo() to pipe_foo()

Affected files ...

.. //depot/projects/soc2009/fifo/sys/fs/fifofs/fifo_vnops.c#16 edit
.. //depot/projects/soc2009/fifo/sys/kern/subr_pipe.c#7 edit
.. //depot/projects/soc2009/fifo/sys/kern/sys_pipe.c#13 edit
.. //depot/projects/soc2009/fifo/sys/sys/pipe.h#8 edit

Differences ...

==== //depot/projects/soc2009/fifo/sys/fs/fifofs/fifo_vnops.c#16 (text+ko) ====

@@ -162,7 +162,7 @@
 		return (EINVAL);
 	if ((fip = vp->v_fifoinfo) == NULL) {
 		fip = malloc(sizeof(*fip), M_VNODE, M_WAITOK);
-		error = generic_pipe_create(td, &rpipe, &wpipe);
+		error = pipepair_create(td, &rpipe, &wpipe);
 		if (error) {
 			free(fip, M_VNODE);
 			return (error);
@@ -209,9 +209,9 @@
 			if (error) {
 				fip->fi_readers--;
 				if (fip->fi_readers == 0) {
-					generic_pipe_close(fip->fi_rpipe);
+					pipe_close(fip->fi_rpipe);
 					if (fip->fi_writers == 0) {
-					 	generic_pipe_close(fip->fi_wpipe);
+					 	pipe_close(fip->fi_wpipe);
 						vp->v_fifoinfo = NULL;
 					 	free(fip, M_VNODE);
 					}
@@ -233,9 +233,9 @@
 			if (error) {
 				fip->fi_writers--;
 				if (fip->fi_writers == 0) {
-					generic_pipe_close(fip->fi_wpipe);
+					pipe_close(fip->fi_wpipe);
 					if (fip->fi_readers == 0) {
-						generic_pipe_close(fip->fi_rpipe);
+						pipe_close(fip->fi_rpipe);
 						vp->v_fifoinfo = NULL;
 						free(fip, M_VNODE);
 					}
@@ -277,12 +277,12 @@
 	if (ap->a_fflag & FREAD) {
 		fip->fi_readers--;
 		if (fip->fi_readers == 0) 
-			generic_pipe_close(fip->fi_rpipe);
+			pipe_close(fip->fi_rpipe);
 	}
 	if (ap->a_fflag & FWRITE) {
 		fip->fi_writers--;
 		if (fip->fi_writers == 0) 
-			generic_pipe_close(fip->fi_wpipe);
+			pipe_close(fip->fi_wpipe);
 	}
 	if (fip->fi_readers == 0 && fip->fi_writers == 0) {
 		vp->v_fifoinfo = NULL;
@@ -410,8 +410,8 @@
 
 	struct fifoinfo *fip = fp->f_data;
 
-	/* The 4th argument of generic_pipe_read is file flag */
-	return (generic_pipe_read(fip->fi_rpipe, uio, cred, fp->f_flag, td));
+	/* The 4th argument of pipe_read is file flag */
+	return (pipe_read(fip->fi_rpipe, uio, cred, fp->f_flag, td));
 }
 
 static int
@@ -420,8 +420,8 @@
 
 	struct fifoinfo *fip = fp->f_data;
 
-	/* The 4th argument of generic_pipe_write is file flag */
-	return (generic_pipe_write(fip->fi_wpipe, uio, cred, fp->f_flag, td));
+	/* The 4th argument of pipe_write is file flag */
+	return (pipe_write(fip->fi_wpipe, uio, cred, fp->f_flag, td));
 }
 
 static int
@@ -430,7 +430,7 @@
 	struct fifoinfo *fip = fp->f_data;
 	int error;
 
-	error = generic_pipe_stat(fip->fi_rpipe, sb, cred, td);
+	error = pipe_stat(fip->fi_rpipe, sb, cred, td);
 	if (error)
 		return (error);
 	sb->st_uid = fp->f_cred->cr_uid;
@@ -475,12 +475,12 @@
 	case FIOSETOWN:
 	case FIOGETOWN:
 		if (fp->f_flag & FREAD) {
-			error = generic_pipe_ioctl(fip->fi_rpipe, com, data, cred, td);
+			error = pipe_ioctl(fip->fi_rpipe, com, data, cred, td);
 			if (error)
 				return (error);
 		}
 		if (fp->f_flag & FWRITE) 
-			error = generic_pipe_ioctl(fip->fi_wpipe, com, data, cred, td);
+			error = pipe_ioctl(fip->fi_wpipe, com, data, cred, td);
 		return (error);
 
 	case FIONREAD:
@@ -493,7 +493,7 @@
 			*(int *)data = 0;
 			return (0);
 		}
-		return (generic_pipe_ioctl(fip->fi_rpipe, com, data, cred, td));
+		return (pipe_ioctl(fip->fi_rpipe, com, data, cred, td));
 
 	default:
 		return (ENOTTY);		    
@@ -629,10 +629,10 @@
 
 	levents = events & (POLLIN | POLLRDNORM);
 	if ((fp->f_flag & FREAD) && levents) 
-		revents |= generic_pipe_poll(fip->fi_rpipe, levents, cred, td);
+		revents |= pipe_poll(fip->fi_rpipe, levents, cred, td);
 	levents = events & (POLLOUT | POLLWRNORM);
 	if ((fp->f_flag & FWRITE) && levents)
-		revents |= generic_pipe_poll(fip->fi_wpipe, levents, cred, td);
+		revents |= pipe_poll(fip->fi_wpipe, levents, cred, td);
 	return (revents);
 }
 

==== //depot/projects/soc2009/fifo/sys/kern/subr_pipe.c#7 (text+ko) ====

@@ -446,7 +446,7 @@
 }
 
 int
-generic_pipe_read(struct pipe *pipe, struct uio *uio, struct ucred *active_cred, 
+pipe_read(struct pipe *pipe, struct uio *uio, struct ucred *active_cred, 
 	int f_flags, struct thread *td)
 {
 	struct pipe *rpipe = pipe;
@@ -844,7 +844,7 @@
 #endif
 
 int
-generic_pipe_write(struct pipe *pipe, struct uio *uio, struct ucred *active_cred,
+pipe_write(struct pipe *pipe, struct uio *uio, struct ucred *active_cred,
 	int f_flags, struct thread *td)
 {
 	int error = 0;
@@ -1122,7 +1122,7 @@
 }
 
 int
-generic_pipe_truncate(struct pipe *pipe, off_t length, struct ucred *active_cred, 
+pipe_truncate(struct pipe *pipe, off_t length, struct ucred *active_cred, 
 	struct thread *td)
 {
 
@@ -1133,7 +1133,7 @@
  * we implement a very minimal set of ioctls for compatibility with sockets.
  */
 int
-generic_pipe_ioctl(struct pipe *pipe, u_long cmd, void *data, struct ucred *active_cred,
+pipe_ioctl(struct pipe *pipe, u_long cmd, void *data, struct ucred *active_cred,
 	struct thread *td)
 {
 	struct pipe *mpipe = pipe;
@@ -1200,7 +1200,7 @@
 }
 
 int
-generic_pipe_poll(struct pipe *pipe, int events, struct ucred *active_cred, 
+pipe_poll(struct pipe *pipe, int events, struct ucred *active_cred, 
 	struct thread *td)
 {
 	struct pipe *rpipe = pipe;
@@ -1261,7 +1261,7 @@
  * be a natural race.
  */
 int
-generic_pipe_stat(struct pipe *pipe, struct stat *ub, struct ucred *active_cred, 
+pipe_stat(struct pipe *pipe, struct stat *ub, struct ucred *active_cred, 
 	struct thread *td)
 {
 #ifdef MAC
@@ -1319,12 +1319,12 @@
  * shutdown the pipe
  */
 void
-generic_pipe_close(struct pipe *cpipe)
+pipe_close(struct pipe *cpipe)
 {
 	struct pipepair *pp;
 	struct pipe *ppipe;
 
-	KASSERT(cpipe != NULL, ("generic_pipe_close: cpipe == NULL"));
+	KASSERT(cpipe != NULL, ("pipe_close: cpipe == NULL"));
 
 	PIPE_LOCK(cpipe);
 	pipelock(cpipe, 0);
@@ -1396,7 +1396,7 @@
 }
 
 int
-generic_pipe_kqfilter(struct pipe *cpipe, struct knote *kn)
+pipe_kqfilter(struct pipe *cpipe, struct knote *kn)
 {
 
 	PIPE_LOCK(cpipe);
@@ -1484,7 +1484,7 @@
 }
 
 int
-generic_pipe_create(struct thread *td, struct pipe **p_rpipe, struct pipe **p_wpipe)
+pipepair_create(struct thread *td, struct pipe **p_rpipe, struct pipe **p_wpipe)
 {
 	struct pipepair *pp;
 	struct pipe *rpipe, *wpipe;
@@ -1503,8 +1503,8 @@
 
 	if ((error = pipe_create(rpipe, 1)) != 0 ||
 		(error = pipe_create(wpipe, 0)) != 0) {
-		generic_pipe_close(rpipe);
-		generic_pipe_close(wpipe);
+		pipe_close(rpipe);
+		pipe_close(wpipe);
 		return (error);
 	}
 

==== //depot/projects/soc2009/fifo/sys/kern/sys_pipe.c#13 (text+ko) ====

@@ -44,30 +44,30 @@
 /*
  * interfaces to the outside world
  */
-static fo_rdwr_t	pipe_read;
-static fo_rdwr_t	pipe_write;
-static fo_truncate_t	pipe_truncate;
-static fo_ioctl_t	pipe_ioctl;
-static fo_poll_t	pipe_poll;
-static fo_kqfilter_t	pipe_kqfilter;
-static fo_stat_t	pipe_stat;
-static fo_close_t	pipe_close;
+static fo_rdwr_t	pipe_read_f;
+static fo_rdwr_t	pipe_write_f;
+static fo_truncate_t	pipe_truncate_f;
+static fo_ioctl_t	pipe_ioctl_f;
+static fo_poll_t	pipe_poll_f;
+static fo_kqfilter_t	pipe_kqfilter_f;
+static fo_stat_t	pipe_stat_f;
+static fo_close_t	pipe_close_f;
 
 static struct fileops pipeops = {
-	.fo_read =	pipe_read,
-	.fo_write =	pipe_write,
-	.fo_truncate =	pipe_truncate,
-	.fo_ioctl =	pipe_ioctl,
-	.fo_poll =	pipe_poll,
-	.fo_kqfilter =	pipe_kqfilter,
-	.fo_stat =	pipe_stat,
-	.fo_close =	pipe_close,
+	.fo_read =	pipe_read_f,
+	.fo_write =	pipe_write_f,
+	.fo_truncate =	pipe_truncate_f,
+	.fo_ioctl =	pipe_ioctl_f,
+	.fo_poll =	pipe_poll_f,
+	.fo_kqfilter =	pipe_kqfilter_f,
+	.fo_stat =	pipe_stat_f,
+	.fo_close =	pipe_close_f,
 	.fo_flags =	DFLAG_PASSABLE
 };
 
 /*
  * The pipe system call for the DTYPE_PIPE type of pipes.  If we fail, let
- * the zone pick up the pieces via generic_pipe_close().
+ * the zone pick up the pieces via pipe_close().
  */
 int
 kern_pipe(struct thread *td, int fildes[2])
@@ -77,14 +77,14 @@
 	struct pipe *rpipe, *wpipe;
 	int fd, error;
 
-	error = generic_pipe_create(td, &rpipe, &wpipe);
+	error = pipepair_create(td, &rpipe, &wpipe);
 	if (error)
 		return (error);
 
 	error = falloc(td, &rf, &fd);
 	if (error) {
-		generic_pipe_close(rpipe);
-		generic_pipe_close(wpipe);
+		pipe_close(rpipe);
+		pipe_close(wpipe);
 		return (error);
 	}
 	/* An extra reference on `rf' has been held for us by falloc(). */
@@ -102,7 +102,7 @@
 		fdclose(fdp, rf, fildes[0], td);
 		fdrop(rf, td);
 		/* rpipe has been closed by fdrop(). */
-		generic_pipe_close(wpipe);
+		pipe_close(wpipe);
 		return (error);
 	}
 	/* An extra reference on `wf' has been held for us by falloc(). */
@@ -132,63 +132,63 @@
 }
 
 int
-pipe_read(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, 
+pipe_read_f(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, 
 	struct thread *td)
 {
 
 	struct pipe *pipe = fp->f_data;
 
-	/* The 4th arguments of generic_pipe_read is file flag */
-  	return generic_pipe_read(pipe, uio, active_cred, fp->f_flag, td);
+	/* The 4th arguments of pipe_read is file flag */
+  	return pipe_read(pipe, uio, active_cred, fp->f_flag, td);
 }
 
 int
-pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, 
+pipe_write_f(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, 
 	struct thread *td)
 {
 
 	struct pipe *pipe = fp->f_data;
 
-	/* The 4th arguments of generic_pipe_write is file flag */
-	return generic_pipe_write(pipe, uio, active_cred, fp->f_flag, td);
+	/* The 4th arguments of pipe_write is file flag */
+	return pipe_write(pipe, uio, active_cred, fp->f_flag, td);
 }
 
 static int
-pipe_truncate(struct file *fp, off_t length, struct ucred *active_cred,	struct thread *td)
+pipe_truncate_f(struct file *fp, off_t length, struct ucred *active_cred,	struct thread *td)
 {
 
 	struct pipe *pipe = fp->f_data;
 
-	return generic_pipe_truncate(pipe, length, active_cred, td);
+	return pipe_truncate(pipe, length, active_cred, td);
 }
 
 static int
-pipe_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, 
+pipe_ioctl_f(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, 
 	struct thread *td)
 {
     
 	struct pipe *pipe = fp->f_data;
 
-	return generic_pipe_ioctl(pipe, cmd, data, active_cred, td);
+	return pipe_ioctl(pipe, cmd, data, active_cred, td);
 }
 
 static int
-pipe_poll(struct file *fp, int events, struct ucred *active_cred, struct thread *td)
+pipe_poll_f(struct file *fp, int events, struct ucred *active_cred, struct thread *td)
 {
 
 	struct pipe *pipe = fp->f_data;
 
-	return generic_pipe_poll(pipe, events, active_cred, td);
+	return pipe_poll(pipe, events, active_cred, td);
 }
 
 static int
-pipe_stat(struct file *fp, struct stat *ub, struct ucred *active_cred, struct thread *td)
+pipe_stat_f(struct file *fp, struct stat *ub, struct ucred *active_cred, struct thread *td)
 {
     
 	struct pipe *pipe = fp->f_data;
 	int error;
 
-	error = generic_pipe_stat(pipe, ub, active_cred, td);
+	error = pipe_stat(pipe, ub, active_cred, td);
 	if (error)
 		return (error);
 	ub->st_uid = fp->f_cred->cr_uid;
@@ -198,20 +198,20 @@
 }
 
 static int
-pipe_close(struct file *fp, struct thread *td)
+pipe_close_f(struct file *fp, struct thread *td)
 {
 	struct pipe *pipe = fp->f_data;
 
 	fp->f_ops = &badfileops;
 	fp->f_data = NULL;
-	generic_pipe_close(pipe);
+	pipe_close(pipe);
 	return (0);
 }
 
 static int
-pipe_kqfilter(struct file *fp, struct knote *kn)
+pipe_kqfilter_f(struct file *fp, struct knote *kn)
 {
 	struct pipe *pipe = kn->kn_fp->f_data;
 
-	return generic_pipe_kqfilter(pipe, kn);
+	return pipe_kqfilter(pipe, kn);
 }

==== //depot/projects/soc2009/fifo/sys/sys/pipe.h#8 (text+ko) ====

@@ -139,20 +139,20 @@
 #define PIPE_UNLOCK(pipe)	mtx_unlock(PIPE_MTX(pipe))
 #define PIPE_LOCK_ASSERT(pipe, type)  mtx_assert(PIPE_MTX(pipe), (type))
 
-int generic_pipe_read(struct pipe *pipe, struct uio *uio, struct ucred *active_cred, 
+int pipe_read(struct pipe *pipe, struct uio *uio, struct ucred *active_cred, 
 	int f_flags, struct thread *td);
-int generic_pipe_write(struct pipe *pipe, struct uio *uio, struct ucred *active_cred,
+int pipe_write(struct pipe *pipe, struct uio *uio, struct ucred *active_cred,
 	int f_flags, struct thread *td);
-int generic_pipe_truncate(struct pipe *pipe, off_t length, struct ucred *active_cred,
+int pipe_truncate(struct pipe *pipe, off_t length, struct ucred *active_cred,
 	struct thread *td);
-int generic_pipe_ioctl(struct pipe *pipe, u_long cmd, void *data, struct ucred *active_cred,
+int pipe_ioctl(struct pipe *pipe, u_long cmd, void *data, struct ucred *active_cred,
 	struct thread *td);
-int generic_pipe_poll(struct pipe *pipe, int events, struct ucred *active_cred, 
+int pipe_poll(struct pipe *pipe, int events, struct ucred *active_cred, 
 	struct thread *td);
-int generic_pipe_stat(struct pipe *pipe, struct stat *ub, struct ucred *active_cred, 
+int pipe_stat(struct pipe *pipe, struct stat *ub, struct ucred *active_cred, 
 	struct thread *td);
-int generic_pipe_kqfilter(struct pipe *pipe, struct knote *kn);
-int generic_pipe_create(struct thread *td, struct pipe **p_rpipe, struct pipe **p_wpipe);
-void generic_pipe_close(struct pipe *pipe);
+int pipe_kqfilter(struct pipe *pipe, struct knote *kn);
+void pipe_close(struct pipe *pipe);
+int pipepair_create(struct thread *td, struct pipe **p_rpipe, struct pipe **p_wpipe);
 
 #endif /* !_SYS_PIPE_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906240948.n5O9m8j6072406>