commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 27/64: boot: support ds_device_get_status with flavor DEV_GET_REC


From: Samuel Thibault
Subject: [hurd] 27/64: boot: support ds_device_get_status with flavor DEV_GET_RECORDS
Date: Wed, 10 Dec 2014 15:17:05 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit e4429ebed2924fd75b23248719a6e0ef4f8b53c3
Author: Justus Winter <address@hidden>
Date:   Fri Nov 7 09:56:29 2014 +0100

    boot: support ds_device_get_status with flavor DEV_GET_RECORDS
    
    * boot/boot.c (ds_device_get_status): Support flavor DEV_GET_RECORDS.
---
 boot/boot.c | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/boot/boot.c b/boot/boot.c
index a655107..d35ce50 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -1150,18 +1150,27 @@ ds_device_get_status (device_t device,
   if (device == pseudo_console)
     return D_INVALID_OPERATION;
   else if (device == pseudo_root)
-    if (flavor == DEV_GET_SIZE)
-      if (*statuslen < DEV_GET_SIZE_COUNT)
-       return D_INVALID_SIZE;
-      else
-       {
-         status[DEV_GET_SIZE_DEVICE_SIZE] = root_store->size;
-         status[DEV_GET_SIZE_RECORD_SIZE] = root_store->block_size;
-         *statuslen = DEV_GET_SIZE_COUNT;
-         return D_SUCCESS;
-       }
-    else
-      return D_INVALID_OPERATION;
+    switch (flavor)
+      {
+      case DEV_GET_SIZE:
+        if (*statuslen < DEV_GET_SIZE_COUNT)
+          return D_INVALID_SIZE;
+        status[DEV_GET_SIZE_DEVICE_SIZE] = root_store->size;
+        status[DEV_GET_SIZE_RECORD_SIZE] = root_store->block_size;
+        *statuslen = DEV_GET_SIZE_COUNT;
+        return D_SUCCESS;
+
+      case DEV_GET_RECORDS:
+        if (*statuslen < DEV_GET_RECORDS_COUNT)
+          return D_INVALID_SIZE;
+        status[DEV_GET_RECORDS_DEVICE_RECORDS] = root_store->blocks;
+        status[DEV_GET_RECORDS_RECORD_SIZE] = root_store->block_size;
+        *statuslen = DEV_GET_RECORDS_COUNT;
+        return D_SUCCESS;
+
+      default:
+        return D_INVALID_OPERATION;
+      }
   else
     return D_NO_SUCH_DEVICE;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]