public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Chris Ball <cjb@laptop.org>
Cc: mp3geek <mp3geek@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: [REVIEW] Btrfs: Introduce ioctl for compressed size of file
Date: Thu, 23 Apr 2009 15:20:06 -0400	[thread overview]
Message-ID: <1240514406.28015.18.camel@think.oraclecorp.com> (raw)
In-Reply-To: <m37i1h47qc.fsf_-_@pullcord.laptop.org>

On Sat, 2009-04-18 at 23:56 -0400, Chris Ball wrote:
> Hi,
> 
>    > We need to add an ioctl that reports on the actual size of the
>    > compressed file.
> 
> Here's an attempt at that ioctl, please review.  The search code is
> based on the clone ioctl.  Some specific questions:
> 

Thanks for doing this.

> * Is the first while() loop necessary?

Not really, you could just do:

btrfs_wait_ordered_range(inode, 0, (u64)-1);

> * Are the semantics of returning -EINVAL when called on an FS with
>   compression disabled desirable?
> 

Instead of calling it the compressed size, I'd call it the size used on
disk.  For a compressed file, this will be smaller than the size in ram,
otherwise it'll be the same.

But, the ioctl is returning an unsigned long, which isn't quite big
enough to hold the total possible size of the file on disk.  I'd have it
return the answer in a u64 instead.

-chris



      reply	other threads:[~2009-04-23 19:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06  6:32 measuring btrfs compression mp3geek
2009-04-07  3:18 ` Chris Mason
2009-04-19  3:56   ` [REVIEW] Btrfs: Introduce ioctl for compressed size of file Chris Ball
2009-04-23 19:20     ` Chris Mason [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=1240514406.28015.18.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=cjb@laptop.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mp3geek@gmail.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