Changeset f97f5cc2 in mainline for uspace/srv/bd


Ignore:
Timestamp:
2015-11-17T23:23:08Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4627314
Parents:
363a504
Message:

Enable partition support with all disk drivers.

Location:
uspace/srv/bd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/file_bd/file_bd.c

    r363a504 rf97f5cc2  
    9090        char *image_name;
    9191        char *device_name;
     92        category_id_t disk_cat;
    9293
    9394        printf(NAME ": File-backed block device driver\n");
     
    138139                return rc;
    139140        }
    140        
     141
     142        rc = loc_category_get_id("disk", &disk_cat, IPC_FLAG_BLOCKING);
     143        if (rc != EOK) {
     144                printf("%s: Failed resolving category 'disk'.\n", NAME);
     145                return rc;
     146        }
     147
     148        rc = loc_service_add_to_cat(service_id, disk_cat);
     149        if (rc != EOK) {
     150                printf("%s: Failed adding %s to category.",
     151                    NAME, device_name);
     152                return rc;
     153        }
     154
    141155        printf("%s: Accepting connections\n", NAME);
    142156        task_retval(0);
  • uspace/srv/bd/sata_bd/sata_bd.c

    r363a504 rf97f5cc2  
    246246{
    247247        int rc;
     248        category_id_t disk_cat;
    248249       
    249250        async_set_fallback_port_handler(sata_bd_connection, NULL);
     
    259260        }
    260261
    261         for(int i=0; i < disk_count; i++) {
     262        rc = loc_category_get_id("disk", &disk_cat, IPC_FLAG_BLOCKING);
     263        if (rc != EOK) {
     264                printf("%s: Failed resolving category 'disk'.\n", NAME);
     265                return rc;
     266        }
     267
     268        for(int i = 0; i < disk_count; i++) {
    262269                char name[1024];
    263270                snprintf(name, 1024, "%s/%s", NAMESPACE, disk[i].dev_name);
     
    267274                        return rc;
    268275                }
    269         }
    270                
     276
     277                rc = loc_service_add_to_cat(disk[i].service_id, disk_cat);
     278                if (rc != EOK) {
     279                        printf("%s: Failed adding %s to category.",
     280                            NAME, disk[i].dev_name);
     281                        return rc;
     282                }
     283        }
     284
    271285        printf(NAME ": Accepting connections\n");
    272286        task_retval(0);
Note: See TracChangeset for help on using the changeset viewer.