Date: Sun, 20 May 2007 21:43:47 GMT From: Sonja Milicic <smilicic@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 120125 for review Message-ID: <200705202143.l4KLhlW9001276@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=120125 Change 120125 by smilicic@tanarri_marilith on 2007/05/20 21:43:04 Style changes Affected files ... .. //depot/projects/soc2007/smilicic_glog/sys/geom/log/g_log_fileops.c#2 edit Differences ... ==== //depot/projects/soc2007/smilicic_glog/sys/geom/log/g_log_fileops.c#2 (text+ko) ==== @@ -8,10 +8,10 @@ #include <sys/proc.h> #include <sys/types.h> -static int +int glog_open_file(struct vnode *vn, char *filename, int uiflags) { - /*opens a file for reading or writing (specified in uiflags variable*/ + /*opens a file for reading or writing (specified in uiflags)*/ struct thread *td; struct nameidata *nd; int err; @@ -24,10 +24,11 @@ VOP_UNLOCK(nd->ni_vp, 0, td); vn = nd->ni_vp; + return err; } -static int +int glog_close_file(struct vnode *vn, int uiflags) { /*closes a file*/ @@ -36,11 +37,12 @@ td = curthread; err = vn_close(vn, uiflags, td->td_ucred, td); + return err; } -static int -glog_write_file(struct vnode *vp, struct uio *data) +int +glog_write_file(struct vnode *vn, struct uio *data) { /*appends data to a file*/ struct thread *td; @@ -49,26 +51,27 @@ td = curthread; data->uio_rw = UIO_WRITE; - vn_lock(vp, LK_EXCLUSIVE|LK_RETRY,td); - err = VOP_WRITE(vp, data, IO_APPEND|IO_SYNC, td->td_ucred); - VOP_UNLOCK(vp,0,td); + vn_lock(vn, LK_EXCLUSIVE|LK_RETRY,td); + err = VOP_WRITE(vn, data, IO_APPEND|IO_SYNC, td->td_ucred); + VOP_UNLOCK(vn, 0, td); return err; } -static int -glog_read_data(struct vnode *vp, struct uio *data) +int +glog_read_data(struct vnode *vn, struct uio *data) { /*reads data from a file*/ struct thread *td; int err; + td = curthread; bzero(data,sizeof(data)); data->uio_rw = UIO_READ; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); - err = VOP_READ(vp, data, IO_UNIT | IO_SYNC, td->td_ucred); - VOP_UNLOCK(vp, 0, td); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY, td); + err = VOP_READ(vn, data, IO_UNIT | IO_SYNC, td->td_ucred); + VOP_UNLOCK(vn, 0, td); return err; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705202143.l4KLhlW9001276>