Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151628919
D44016.id134844.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44016.id134844.diff
View Options
diff --git a/stand/kboot/kboot/hostdisk.c b/stand/kboot/kboot/hostdisk.c
--- a/stand/kboot/kboot/hostdisk.c
+++ b/stand/kboot/kboot/hostdisk.c
@@ -305,7 +305,6 @@
struct devdesc *desc = devdata;
daddr_t pos;
int n;
- int64_t off;
uint64_t res;
uint32_t posl, posh;
@@ -313,12 +312,14 @@
posl = pos & 0xffffffffu;
posh = (pos >> 32) & 0xffffffffu;
- if ((off = host_llseek(desc->d_unit, posh, posl, &res, 0)) < 0) {
- printf("Seek error on fd %d to %ju (dblk %ju) returns %jd\n",
- desc->d_unit, (uintmax_t)pos, (uintmax_t)dblk, (intmax_t)off);
+ if (host_llseek(desc->d_unit, posh, posl, &res, 0) < 0)
return (EIO);
- }
- n = host_read(desc->d_unit, buf, size);
+ if (flag & F_READ)
+ n = host_read(desc->d_unit, buf, size);
+ else if (flag & F_WRITE)
+ n = host_write(desc->d_unit, buf, size);
+ else
+ return (EINVAL);
if (n < 0)
return (EIO);
@@ -339,7 +340,7 @@
va_end(vl);
fn = dev2hd(desc)->hd_dev;
- desc->d_unit = host_open(fn, O_RDONLY, 0);
+ desc->d_unit = host_open(fn, O_RDWR, 0);
if (desc->d_unit <= 0) {
printf("hostdisk_open: couldn't open %s: %d\n", fn, errno);
return (ENOENT);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 3:09 PM (4 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31212141
Default Alt Text
D44016.id134844.diff (1 KB)
Attached To
Mode
D44016: kboot: Implement write support for hostdisk
Attached
Detach File
Event Timeline
Log In to Comment