Whamcloud - gitweb
de-serialised getattr, brw test ioctls
authoreeb <eeb>
Tue, 20 Aug 2002 19:41:35 +0000 (19:41 +0000)
committereeb <eeb>
Tue, 20 Aug 2002 19:41:35 +0000 (19:41 +0000)
lustre/obdclass/class_obd.c

index 0bac970..7c31246 100644 (file)
@@ -104,10 +104,21 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
         struct lustre_handle conn;
         int rw = OBD_BRW_READ;
         int err = 0;
+        int serialised = 0;
         ENTRY;
 
-        down(&obd_conf_sem);
-
+        switch (cmd)
+        {
+        case OBD_IOC_BRW_WRITE:
+        case OBD_IOC_BRW_READ:
+        case OBD_IOC_GETATTR:
+                break;
+        default:
+                down(&obd_conf_sem);
+                serialised = 1;
+                break;
+        }
+        
         if (!obd && cmd != OBD_IOC_DEVICE && cmd != TCGETS &&
             cmd != OBD_IOC_LIST &&
             cmd != OBD_IOC_NAME2DEV && cmd != OBD_IOC_NEWDEV) {
@@ -558,7 +569,8 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
  out:
         if (buf)
                 OBD_FREE(buf, len);
-        up(&obd_conf_sem);
+        if (serialised)
+                up(&obd_conf_sem);
         RETURN(err);
 } /* obd_class_ioctl */