Poul-Henning Kamp
e65ab0f83f
Use g_slice_spoiled() rather than g_std_spoiled().
...
Remember to free the buffer we got from g_read_data().
2003-05-02 06:36:14 +00:00
Poul-Henning Kamp
4f806d2428
Use g_slice_spoiled() not g_std_spoiled()
2003-05-02 06:34:51 +00:00
Poul-Henning Kamp
28ce9efcef
Use g_slice_spoiled() rather than g_std_spoiled()
2003-05-02 06:33:59 +00:00
Poul-Henning Kamp
afec8eb8ad
Use g_slice_spoiled() rather than g_std_spoiled().
2003-05-02 06:33:26 +00:00
Poul-Henning Kamp
15649213a6
Use a more tailored spoil routine for slices, and take advantage of
...
g_wither_geom() to do most of the work for us.
2003-05-02 06:29:33 +00:00
Poul-Henning Kamp
3ddef7422c
Style improvement.
2003-05-02 06:22:48 +00:00
Poul-Henning Kamp
03af3a23dd
Use g_wither_geom() for cleanup.
2003-05-02 06:22:32 +00:00
Poul-Henning Kamp
d6227ae71f
Rework the "withering" mechanism:
...
Introduce g_wither_geom() to do the work in one single place.
2003-05-02 06:15:27 +00:00
Poul-Henning Kamp
82b53b8dc8
Rename g_slice_init() to the more appropriate g_slice_alloc() and give
...
it a g_slice_free() partner function.
2003-05-02 05:33:27 +00:00
Poul-Henning Kamp
516b02faf7
style improvement.
2003-05-02 05:26:47 +00:00
Poul-Henning Kamp
9dfffbc959
Get rid of trivial function g_destroy_event().
2003-05-02 05:26:19 +00:00
Poul-Henning Kamp
6a543b1031
Plug some memory-leaks.
2003-05-01 21:07:08 +00:00
Poul-Henning Kamp
606402511a
Remove the now obsolete geomidorname hack.
2003-05-01 20:32:24 +00:00
Poul-Henning Kamp
c8589ad169
Add a new flag, EV_CANCELED, and use it to make g_waitfor_event() return
...
EAGAIN if an event got canceled.
2003-05-01 19:43:52 +00:00
Poul-Henning Kamp
2ab31b05ba
When events on a reference is cancelled, check our doorstep first,
...
it might be an orphan.
2003-05-01 19:24:00 +00:00
Poul-Henning Kamp
e931331eaa
Remove now unneeded special case for "geom.ctl".
2003-05-01 18:18:14 +00:00
Yoshihiro Takahashi
4b4582a84c
Remove DIOCGPC98 ioctl.
2003-05-01 14:40:16 +00:00
Yoshihiro Takahashi
50cf98ed97
- Move decoding pc98_partition function into geom_pc98_enc.c.
...
- Add encoding pc98_partition function.
2003-05-01 13:44:24 +00:00
Marcel Moolenaar
b52e9eb6b6
Don't emulate a MBR by handling the MBR::type attribute. It is
...
not needed at all. The BSD class will attach to a GPT class without
it.
2003-05-01 01:51:28 +00:00
Mark Murray
51da11a27a
Fix some easy, global, lint warnings. In most cases, this means
...
making some local variables static. In a couple of cases, this means
removing an unused variable.
2003-04-30 12:57:40 +00:00
Poul-Henning Kamp
c7f3baedf3
Fix an obscure fencepost error in GBDE's sector mapping code:
...
For certain combinations of sectorsize, mediasize and random numbers
(used to define the mapping), a multisector read or write would ignore
some subset of the sectors past the first sector in the request because
those sectors would be mapped past the end of the parent device, and
normal "end of media" truncation would zap that part of the request.
Rev 1.19+1.20 of g_bde_work.c added the check which should have alerted
me to this happening. This commit maps the request correctly and
adds KASSERTS to make sure things stay inside the parent device.
This does not change the on-disk layout of GBDE, there is no need to
backup/restore.
2003-04-29 19:46:42 +00:00
Poul-Henning Kamp
a17da2aa74
Typo in last commit: Do not press xZZ to leave vi(1).
2003-04-29 19:38:55 +00:00
Poul-Henning Kamp
ca8f372bbc
When a bio comes back from below with a zero error code, check that
...
it wrote the full length. The only case where this should be able
to happen is if we try to read/write past the end and the request
is truncated. We obviously should never try to do that, so this
code should never activate.
2003-04-29 19:37:36 +00:00
Alexander Kabaev
104a9b7e3e
Deprecate machine/limits.h in favor of new sys/limits.h.
...
Change all in-tree consumers to include <sys/limits.h>
Discussed on: standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-04-29 13:36:06 +00:00
Poul-Henning Kamp
90336bb4d8
I accidentally leaked this debugging tool in with my last commit.
...
Disable it with a direct warning.
2003-04-28 17:57:12 +00:00
Poul-Henning Kamp
306babd20c
Rename g_bde_get_sector() to g_bde_get_keysector() and pick up the
...
offset from the work packet.
2003-04-28 06:38:31 +00:00
Poul-Henning Kamp
11ca41a9bb
Only attempt total cache-purge once in case of failure.
2003-04-28 06:19:41 +00:00
Poul-Henning Kamp
035694b29a
Better criteria for skipping disk reading BIO_READ work packets.
2003-04-28 06:15:39 +00:00
Poul-Henning Kamp
d8e7c92c9e
Explicitly set the sector state to JUNK if we encounter a read-error.
2003-04-28 06:10:35 +00:00
Poul-Henning Kamp
c08c56e02a
Bail as soon as the first write request has failed, there is no point
...
in trying the second write if the first one went nowhere.
2003-04-26 21:40:26 +00:00
Poul-Henning Kamp
54d2011343
Appearantly UFS no longer issues BIO_DELETE requests correctly, and
...
consequently trashes data. Disable BIO_DELETE handling in gbde for now.
2003-04-26 21:39:33 +00:00
Poul-Henning Kamp
9b99e39d61
Do an explicit retry after we have dumped the cache, rather than a
...
(potential) tail recursion.
2003-04-25 21:43:11 +00:00
Poul-Henning Kamp
e8e0742ef4
If on a BIO_READ request, we failed to allocate the bio for reading
...
our key-sector, we would end up returning the read without an error,
despite the fact that the data was not correctly decrypted.
This would result in data corruption on read, but intact data still
on the media.
2003-04-25 21:28:28 +00:00
Poul-Henning Kamp
37f5e4a6c2
Fix a problem and slightly improve the ENOMEM handling:
...
Give up the entire bio as soon as we detect a problem.
When we detect a problem, give up the bio by contributing the
remainder with ENOMEM, rather than kicking the bio back right
away.
If we failed on a non-first iteration we previously could end up
modifying fields in the bio after we delivered it. This could
account for memory corruption (none directly reported) on machines
with GBDE.
2003-04-25 21:20:57 +00:00
Poul-Henning Kamp
af6b9f17f9
Don't count a sector in the cache unless we manage to create it.
2003-04-25 20:56:27 +00:00
Poul-Henning Kamp
f2314b445d
Rename g_bde_release_sector() to g_bde_release_keysector() and pick up
...
the sector from the work item.
2003-04-25 20:35:34 +00:00
Poul-Henning Kamp
195d573278
Rename g_bde_read_sector() to g_bde_read_keysector() pick up the offset
...
in the work structure.
2003-04-25 20:16:59 +00:00
Poul-Henning Kamp
0a9c130c06
Introduce a g_waitfor_event() function which posts an event and waits for
...
it to be run (or cancelled) and use this instead of home-rolled versions.
2003-04-23 21:28:27 +00:00
Poul-Henning Kamp
a974614b05
More of the event stuff can now be private to geom_event.c
2003-04-23 20:54:42 +00:00
Poul-Henning Kamp
8cd1535a24
Rename g_call_me() to g_post_event(), and give it a flag
...
argument to determine if we can M_WAITOK in malloc.
2003-04-23 20:46:12 +00:00
Poul-Henning Kamp
d98777f8db
Remove the now unused hardcoded g_post_event() event support.
2003-04-23 20:25:33 +00:00
Poul-Henning Kamp
9ab3ea7841
Turn EV_NEW_PROVIDER into a g_call_me() event.
2003-04-23 20:16:13 +00:00
Poul-Henning Kamp
f2e9a09494
Convert EV_SPOILED event to use g_call_me().
2003-04-23 20:06:38 +00:00
Poul-Henning Kamp
9972896c00
Turn the hardwired NEW_CLASS event into a g_call_me() event.
2003-04-23 19:34:38 +00:00
Poul-Henning Kamp
b5cba4167f
Move the shutdown eventhandler stuff to a more logical place.
2003-04-23 19:15:27 +00:00
Poul-Henning Kamp
bf9ab27afb
Implement CONFIG_GEOM verbs "write label" and "write bootcode".
2003-04-23 08:23:01 +00:00
Poul-Henning Kamp
ca3d750e73
Introduce gctl_get_paraml() which gets a parameter only if it has the
...
right length.
2003-04-23 08:03:47 +00:00
Poul-Henning Kamp
fb9483af54
Make gctl_error() take printfline varargs.
2003-04-23 07:50:01 +00:00
Poul-Henning Kamp
668ae29c71
Remove unused event pointers in object structures.
...
Remove KASSERTS which checked that they were unused.
2003-04-23 06:54:44 +00:00
Poul-Henning Kamp
b874183561
Change the locking so that the _modify function is called with topology
...
held.
The only place where we want to not hold topology is when we read
(or write) the label to disk: in the case of a disk error with a
long recovery time, holding topology would prevent open/close of
any disk device.
2003-04-22 21:29:58 +00:00