From: Ming Zhang <mingz@ele.uri.edu>
To: linux-xfs@oss.sgi.com
Subject: how to understand allocsp
Date: Thu, 24 Aug 2006 16:11:50 -0400 [thread overview]
Message-ID: <1156450310.2700.85.camel@localhost.localdomain> (raw)
Hi All
Play with xfs_io and feel confused about this allocsp.
Starting with a empty file.
xfs_io> bmap
/t/x: no extents
I assumed this will allocate space from 0 with 1048576 bytes. but seems
this is wrong.
xfs_io> allocsp 0 1048576
xfs_io> bmap
/t/x: no extents
Do this from a non-zero start, found file filled with 0.
xfs_io> allocsp 1048576 0
xfs_io> bmap
/t/x:
0: [0..2047]: 2147745792..2147747839
XFS_IOC_ALLOCSP64
Alter storage space associated with a section of the ordinary file
specified. The section
~~~~no idea what this "alter" mean here.
is specified by a variable of type xfs_flock64_t, pointed to by the
final argument. The data type xfs_flock64_t contains the following
members: l_whence is 0, 1, or 2 to indicate that the relative offset
l_start will be measured from the start of the file, the current
position, or the end of the file, respectively. l_start is the offset
from the position specified in l_whence. l_len is the size of the
section. An l_len value of zero frees up to the end of the file; in this
case, the end of file (i.e., file size) is set to the beginning of the
section freed. Any data previously written into this section is no
longer accessible. If the section specified is beyond the current end of
file, the file is grown and filled with zeroes. The l_len field is
currently ignored, and should be set to zero.
this "currently ignored" is ONLY when "section is beyond the current end
of file" or for any l_start?
Thanks!
Ming
next reply other threads:[~2006-08-24 20:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-24 20:11 Ming Zhang [this message]
2006-08-24 20:53 ` how to understand allocsp Eric Sandeen
2006-08-24 21:01 ` Ming Zhang
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=1156450310.2700.85.camel@localhost.localdomain \
--to=mingz@ele.uri.edu \
--cc=linux-xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox