[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2004-01-21 14:44:57
|
Update of /cvsroot/libsysio/libsysio/drivers/native
In directory sc8-pr-cvs1:/tmp/cvs-serv23555/drivers/native
Modified Files:
fs_native.c
Log Message:
A roll-up patch from CFS (Eric Mei <er...@cl...>)
- intent.diff
small changes on intent related behavior. I simply follow the lustre
kernel code here.
- open() need to pass down param 'flags'.
- 'setattr' related syscalls, like chown/chmod/utime/..., don't need
intent during path resolution.
- sockets.diff
your socket driver.
- nativefs.diff
only add fcntl code into native driver. not sure whether it's
complete, but ok for current testing.
- trace.diff
this patch add SYSIO_ENTER/SYSIO_LEAVE macros.
Index: fs_native.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -b -B -p -r1.26 -r1.27
--- fs_native.c 12 Jan 2004 18:07:16 -0000 1.26
+++ fs_native.c 21 Jan 2004 14:44:53 -0000 1.27
@@ -1337,15 +1337,34 @@ native_inop_iodone(struct ioctx *ioctxp
}
static int
-native_inop_fcntl(struct inode *ino __IS_UNUSED,
- int cmd __IS_UNUSED,
- va_list ap __IS_UNUSED)
+native_inop_fcntl(struct inode *ino,
+ int cmd,
+ va_list ap)
{
+ struct native_inode *nino = I2NI(ino);
+ long arg;
- /*
- * I'm lazy. Maybe implemented later.
- */
- errno = ENOTTY;
+ if (nino->ni_fd < 0)
+ abort();
+
+ switch (cmd) {
+ case F_GETFD:
+ case F_GETFL:
+ case F_GETOWN:
+ return syscall(SYS_fcntl, nino->ni_fd, cmd);
+ case F_DUPFD:
+ case F_SETFD:
+ case F_SETFL:
+ case F_GETLK:
+ case F_SETLK:
+ case F_SETLKW:
+ case F_SETOWN:
+ arg = va_arg(ap, long);
+ return syscall(SYS_fcntl, nino->ni_fd, cmd, arg);
+ default:
+ printf("uncatched cmd %d\n", cmd);
+ abort();
+ }
return -1;
}
|