PERFORCE change 120125 for review
Sonja Milicic
smilicic at FreeBSD.org
Sun May 20 21:43:48 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=120125
Change 120125 by smilicic at 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;
}
More information about the p4-projects
mailing list