[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: [LI] getdents() endgames



Vimal can you tell how getdents() is fooling you? What exactly it is
doing/showing.

Ajit 

> -----Original Message-----
> From:	Vimal Mathew [SMTP:vml@xxxxxxxxxxxxx]
> Sent:	Friday, January 14, 2000 11:53 AM
> To:	linux-india@xxxxxxxxxxxxxxxxxxxxx
> Subject:	[LI] getdents() endgames
> 
> Hi,
> 	I was fooling around with the getdents() system call and came across
> the following:
>    The d_off value in the dirent structure for the last entry in the
> directory list is a large constant. For ext2 filesystems, this value
> equals the block size of my filesytem (e2dump -s /dev/hdaxx), ie. 1024 in
> an RH5.2 install, and 4096 in an RH6.1 install. How do I access this value
> in a program I write (do I necessarily have to access my superblock, or is
> there a simpler way)? I tried going through /usr/src/linux/fs/ext2/dir.c
> for the readdir() function but I could'nt make head or tail of it.
>    For an MSDOS formatted floppy (mounted either vfat or msdos), the last
> "dirent" entry has 7168 (14*512) as the d_off value. What is its
> significance?
>    In a Minix floppy, there did not seem to be anything special to the
> d_off of the last entry.
>    I need to be able to obtain this value(d_off) in a program without too
> many complications, and before scanning through any directory structures.
> The program is running as a kernel module (kern 2.2.13).
> 
> Thanks in advance,
> --vml,
> Model Engg. College, Cochin
> --------------------------------------------------------------------
> The Linux India Mailing List Archives are now available.  Please search
> the archive at http://lists.linux-india.org/ before posting your question
> to avoid repetition and save bandwidth.
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.