public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* why CURRENT->sector is zero??
@ 2005-03-17  9:12 mohanlal jangir
  2005-03-17 10:29 ` Alessandro Rubini
  0 siblings, 1 reply; 2+ messages in thread
From: mohanlal jangir @ 2005-03-17  9:12 UTC (permalink / raw)
  To: Linux Kernel, Linux Newbies; +Cc: rubini, rubini, rubini, rubini, rubini


I downloaded sbull.c (for LDD 2nd Edition) from 
http://examples.oreilly.com/linuxdrive/. After compiling and inserting 
(registering as block device), I tried to mount different file systems 
(Although there is no valid file system there; my goal is to observe value 
of req->sector in sbull_transfer function). The observations are as follows:
File System  req->sector
msdos          0
vfat              0
ext2             2
ext3             2
iso9000       72

I don't know about other file systems, but I believe the value of 
req->sector for msdos/vfat is wrong. Because when I mount a CF card having 
FAT file system on my Linux box (using USB mass storage driver), the first 
read request contains sector 0x20.
Does someone have any clue, why sbull gets this value as 0 rather then 0x20? 
Basically this means why CURRENT->sector is 0?
I am working on 2.4.18; a little old :(

Regards
Mohanlal 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: why CURRENT->sector is zero??
  2005-03-17  9:12 why CURRENT->sector is zero?? mohanlal jangir
@ 2005-03-17 10:29 ` Alessandro Rubini
  0 siblings, 0 replies; 2+ messages in thread
From: Alessandro Rubini @ 2005-03-17 10:29 UTC (permalink / raw)
  To: mohanlal, linux-kernel, kernelnewbies


Hello.

> I downloaded sbull.c (for LDD 2nd Edition) from 

Please note that sbull is a block device not hosting partitions.

> of req->sector in sbull_transfer function). The observations are as follows:
> File System  req->sector
> msdos          0
> vfat              0
> ext2             2
> ext3             2
> iso9000       72

If there is no filesystem in the device, you just get the probe
transfers. Not very interesting, indeed. Some filesystems have their
magic number in the first sector, and some have it later in the device.

> I don't know about other file systems, but I believe the value of 
> req->sector for msdos/vfat is wrong. Because when I mount a CF card having 
> FAT file system on my Linux box (using USB mass storage driver), the first 
> read request contains sector 0x20.

Before you state it's wrong you should see some effect. In your case
there is no effect at all. If you make a filesystem on the device you'll
see it works. So if this concerns you, you should look for an explanation
rather than saying it is wrong.

> Does someone have any clue, why sbull gets this value as 0 rather then 0x20? 

I suspect because the device is not partitioned, while the other one is,
so every transfer just is done inside the partition (while the low-level
access uses absolute sector number of the device).

/alessandro

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-17 11:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-17  9:12 why CURRENT->sector is zero?? mohanlal jangir
2005-03-17 10:29 ` Alessandro Rubini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox