• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Identifying sparse files using getattrlist()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying sparse files using getattrlist()


  • Subject: Re: Identifying sparse files using getattrlist()
  • From: Mike Mackovitch <email@hidden>
  • Date: Wed, 4 Nov 2009 09:58:58 -0800

On Wed, Nov 04, 2009 at 09:45:46AM -0600, Peter O'Gorman wrote:
> On 11/04/2009 04:12 AM, Alastair Houghton wrote:
> >On 4 Nov 2009, at 08:41, rohan a wrote:
> >
> >>However, for a sparse file this continues to return same sizes for
> >>stat size and real size. This is an Apple UFS partition.
> >
> >Anyway, the answer is that (a) stat() won't return the information you
> >want,
> >
>
> Sorry for the stat distraction, I only tried it on this linux system
> before making the suggestion:
> $ stat sparse (output snipped)
>   Size: 3221225472      Blocks: 8
>
> But I see this morning that when I mount the same file system over
> NFS, on my mac:
> $ stat -s sparse (output snipped)
> st_size=3221225472 st_blocks=6291456
>
> Oh well.

Yes, this is a known issue in the VFS layer (5633019),
and Alastair already pointed it out:

On Wed, Nov 04, 2009 at 10:12:42AM +0000, Alastair Houghton wrote:
> All of this also explains why stat(), which uses vn_stat() (in
> vfs_vnops.c), won't work.  stat() asks for va_data_size and
> va_total_alloc.  UFS doesn't return va_total_alloc, so it's computed
> in vnode_getattr() by copying from va_data_size.  Hence you're going
> to get the same data in both places.

Like UFS, NFS also does not return va_total_alloc - only va_data_size
and va_data_alloc.

HTH
--macko
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: Peter O'Gorman <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: Mike Mackovitch <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: Mike Mackovitch <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: Alastair Houghton <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: Peter O'Gorman <email@hidden>)

  • Prev by Date: Re: Identifying sparse files using getattrlist()
  • Next by Date: Interprocess Locking?
  • Previous by thread: Re: Identifying sparse files using getattrlist()
  • Next by thread: IPFW forwarding on SnowLeopard
  • Index(es):
    • Date
    • Thread