Whamcloud - gitweb
Add open/close ioctls to obdclass.
authoradilger <adilger>
Fri, 6 Sep 2002 23:47:26 +0000 (23:47 +0000)
committeradilger <adilger>
Fri, 6 Sep 2002 23:47:26 +0000 (23:47 +0000)
lustre/include/linux/lustre_lib.h
lustre/obdclass/class_obd.c

index c6826ea..c56d13e 100644 (file)
@@ -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
index f918c57..d5492fc 100644 (file)
@@ -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: {