Re: [SLOF] [PATCH v3] slof/fs/packages/disk-label.fs: improve checking for DOS boot partitions

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

 



Hi!

On 2024-03-27 08:43:25, Segher Boessenkool wrote:
> Hi!
> 
> On Wed, Mar 27, 2024 at 01:41:27AM -0400, Kautuk Consul wrote:
> > -\ read sector to array "block"
> > -: read-sector ( sector-number -- )
> > +\ read sector to array "block" and return actual bytes read
> > +: read-sector-ret ( sector-number -- actual-bytes )
> 
> What does "-ret" mean?  The name could be clearer.
> 
> Why factor it like this, anyway?  Shouldn't "read" always read exactly
> the number of bytes it is asked to?  So, "read-sector" should always
> read exactly one sector, never more, never less.
Okay I just thought to return the bytes actually read from that 1 sector
so that I could do some checking in the subroutines calling read-sector.

> 
> If an exception happens you can (should!) throw an exception.  Which
> you can then catch at a pretty high level.
Ah, correct. Thanks for the suggestion! I think I will now try to throw
an exception from read-sector if all the code-paths imply that a "catch"
is in progress. I will try to make some change like this and send out a
v4 whenever I have time.
> 
> 
> Segher




[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux