Re: FIGETBSZ and FIBMAP for directorys

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

 



On Wed, Jun 15, 2005 at 09:58:07AM +0200, Sebastian Cla?en wrote:
> Hi list...
> 
> I'm using this little program to find out which blocks are use by a
> particular file:
> ...
>                 if (ioctl(fd, FIBMAP, &block)) {
> ...
> 
> This works fine for regular files, but not for directorys. Both ioctl's,
> FIGETBSZ and FIBMAP, are implemented for regular files only. 
> 
> Is there a patch to make this FIGETBSZ and FIBMAP work on directorys
> too?

I doubt it, these ioctls are generally frowned on and noone touches
them these days - eg. from fs.h...
#define BMAP_IOCTL 1            /* obsolete - kept for compatibility */
#define FIBMAP     _IO(0x00,1)  /* bmap access */
#define FIGETBSZ   _IO(0x00,2)  /* get the block size used for bmap */

> Or alternativly, is there a way to find out which blocks are used by a
> directory?

There's an XFS-specific way if youre using XFS, and other filesystems
may have their own custom way of providing that information, I'm not
sure.  For XFS, the xfs_bmap(8) command uses XFS_IOC_GETBMAP to get
an inode's extent layout, and that works for all file types.

cheers.

-- 
Nathan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux