efipart.c (6c140a7281ccb127ada56f2eece4dc688e6df437) efipart.c (313724bab940c1844fda3d797cf88cd46780e62a)
1/*-
2 * Copyright (c) 2010 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 992 unchanged lines hidden (view full) ---

1001 * the case.
1002 */
1003static int
1004efipart_readwrite(EFI_BLOCK_IO *blkio, int rw, daddr_t blk, daddr_t nblks,
1005 char *buf)
1006{
1007 EFI_STATUS status;
1008
1/*-
2 * Copyright (c) 2010 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 992 unchanged lines hidden (view full) ---

1001 * the case.
1002 */
1003static int
1004efipart_readwrite(EFI_BLOCK_IO *blkio, int rw, daddr_t blk, daddr_t nblks,
1005 char *buf)
1006{
1007 EFI_STATUS status;
1008
1009 TSENTER();
1010
1009 if (blkio == NULL)
1010 return (ENXIO);
1011 if (blk < 0 || blk > blkio->Media->LastBlock)
1012 return (EIO);
1013 if ((blk + nblks - 1) > blkio->Media->LastBlock)
1014 return (EIO);
1015
1016 switch (rw & F_MASK) {

--- 10 unchanged lines hidden (view full) ---

1027 default:
1028 return (ENOSYS);
1029 }
1030
1031 if (EFI_ERROR(status)) {
1032 printf("%s: rw=%d, blk=%ju size=%ju status=%lu\n", __func__, rw,
1033 blk, nblks, EFI_ERROR_CODE(status));
1034 }
1011 if (blkio == NULL)
1012 return (ENXIO);
1013 if (blk < 0 || blk > blkio->Media->LastBlock)
1014 return (EIO);
1015 if ((blk + nblks - 1) > blkio->Media->LastBlock)
1016 return (EIO);
1017
1018 switch (rw & F_MASK) {

--- 10 unchanged lines hidden (view full) ---

1029 default:
1030 return (ENOSYS);
1031 }
1032
1033 if (EFI_ERROR(status)) {
1034 printf("%s: rw=%d, blk=%ju size=%ju status=%lu\n", __func__, rw,
1035 blk, nblks, EFI_ERROR_CODE(status));
1036 }
1037 TSEXIT();
1035 return (efi_status_to_errno(status));
1036}
1037
1038static int
1039efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size,
1040 char *buf, size_t *rsize)
1041{
1042 struct bcache_devdata bcd;

--- 205 unchanged lines hidden ---
1038 return (efi_status_to_errno(status));
1039}
1040
1041static int
1042efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size,
1043 char *buf, size_t *rsize)
1044{
1045 struct bcache_devdata bcd;

--- 205 unchanged lines hidden ---