From 91209b2acf3f999ae5ffd33523427290868bf9f2 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 6 Sep 2002 23:47:26 +0000 Subject: [PATCH] Add open/close ioctls to obdclass. --- lustre/include/linux/lustre_lib.h | 3 +++ lustre/obdclass/class_obd.c | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lustre/include/linux/lustre_lib.h b/lustre/include/linux/lustre_lib.h index c6826ea..c56d13e 100644 --- a/lustre/include/linux/lustre_lib.h +++ b/lustre/include/linux/lustre_lib.h @@ -414,6 +414,9 @@ static inline int obd_ioctl_getdata(char **buf, int *len, void *arg) #define OBD_IOC_DEC_FS_USE_COUNT _IO ('f', 133 ) +#define OBD_IOC_OPEN _IOWR('f', 134, long) +#define OBD_IOC_CLOSE _IOWR('f', 135, long) + /* * l_wait_event is a flexible sleeping function, permitting simple caller * configuration of interrupt and timeout sensitivity along with actions to diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index f918c57..d5492fc 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -758,7 +758,6 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, struct lov_stripe_md *ea = NULL; obd_data2conn(&conn, data); - err = obd_create(&conn, &data->ioc_obdo1, &ea); if (err) GOTO(out, err); @@ -800,6 +799,23 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, GOTO(out, err); } + case OBD_IOC_OPEN: { + struct lov_stripe_md *md; // XXX fill in md from create + + obd_data2conn(&conn, data); + err = obd_open(&conn, &data->ioc_obdo1, NULL); + GOTO(out, err); + } + + case OBD_IOC_CLOSE: { + struct lov_stripe_md *md; // XXX fill in md from create + + obd_data2conn(&conn, data); + obd_data2conn(&conn, data); + err = obd_close(&conn, &data->ioc_obdo1, NULL); + GOTO(out, err); + } + case OBD_IOC_BRW_WRITE: rw = OBD_BRW_WRITE; case OBD_IOC_BRW_READ: { -- 1.8.3.1