All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Scott <nathans@sgi.com>
To: "Sebastian Claßen" <Sebastian.Classen@freenet-ag.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: FIGETBSZ and FIBMAP for directorys
Date: Thu, 16 Jun 2005 08:46:47 +1000	[thread overview]
Message-ID: <20050615224647.GB772@frodo> (raw)
In-Reply-To: <1118822287.28239.10.camel@basti79.freenet-ag.de>

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

  reply	other threads:[~2005-06-15 22:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-15  7:58 FIGETBSZ and FIBMAP for directorys Sebastian Claßen
2005-06-15 22:46 ` Nathan Scott [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-06-15 23:15 Nikita Danilov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050615224647.GB772@frodo \
    --to=nathans@sgi.com \
    --cc=Sebastian.Classen@freenet-ag.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.