public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Hsu <nagual.hsu@gmail.com>
To: xfs@oss.sgi.com
Subject: Re: about XFS_IOC_RESVSP
Date: Sun, 24 May 2009 15:08:37 +0800	[thread overview]
Message-ID: <7fe205990905240008u6a534d21pcdcfffdc19472b6@mail.gmail.com> (raw)
In-Reply-To: <7fe205990905220716v7d06b9bch40fe6136af17e345@mail.gmail.com>

      After days of testing(I only ftruncate to 0 and re-preallocate
files if needed),
fragmentation become much more serious, sigh

2009/5/22 Joe Hsu <nagual.hsu@gmail.com>:
>        I pre-allocate blocks for a file. Then I use "open" and "write" system
> calls to generate the content for that file. After the file is really
> written to the disk,
> I want to set all the extent(s) of that file unwritten. Then I will
> write new content to
> the same file. Is that possible? That means:
> I want to dis-care the content just written and use the same allocated blocks.
> In another words, I want to restore the state of the file to the state
> when it was
> first pre-allocated.
>
>        Why am I doing this? Why not just over-write it? When doing
> partial over-writing,
> some blocks may be read for partial update before they are written
> out. This hurts
> some IO performance and If I can, I would prefer to dis-care old
> content of the file and
> use same (pre)allocated blocks. (In my case, I am doing intensive IO.)
>
>        Any one can give me some hints? Thanks.
>
> --
> The sun is shinny but the ice is slippery.
>



-- 
The sun is shinny but the ice is slippery.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      parent reply	other threads:[~2009-05-24  7:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-22 14:16 about XFS_IOC_RESVSP Joe Hsu
2009-05-22 15:49 ` Eric Sandeen
2009-05-22 17:36   ` Joe Hsu
2009-05-24 13:29     ` Eric Sandeen
2009-05-24  7:08 ` Joe Hsu [this message]

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=7fe205990905240008u6a534d21pcdcfffdc19472b6@mail.gmail.com \
    --to=nagual.hsu@gmail.com \
    --cc=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