public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Lukáš Czerner" <lczerner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Michael Kerrisk (man-pages)"
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] fallocate.2: Document FALLOC_FL_ZERO_RANGE
Date: Fri, 18 Apr 2014 18:21:42 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1404181819470.2128@localhost.localdomain> (raw)
In-Reply-To: <5351499C.2080506-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Fri, 18 Apr 2014, Michael Kerrisk (man-pages) wrote:

> Date: Fri, 18 Apr 2014 17:49:48 +0200
> From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> To: Lukas Czerner <lczerner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
>     linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: [PATCH] fallocate.2: Document FALLOC_FL_ZERO_RANGE
> 
> Lukas,
> 
> Thanks for the patch.
> 
> Two general comments:
> * The text does not explain what zeroing file space is about and why one 
>   would do it. For example, I'm a little unclear after reading it whether
>   FALLOC_FL_ZERO_RANGE will create a hole in a file.

It is saying that blocks are preallocated for the regions that span
holes in the file. And there isn't anything saying about punching a
hole into the file. But I guess I can be more clear about it.

> * Some entries should probably be added to ERRORS.
> 
> Could you fix both of those and resubmit?

Sure I'll do that next week.

> 
> Note that I've just pushed some changes to the page for 
> FALLOC_FL_COLLAPSE_RANGE, so you may want to pull the latest version to
> ensure there are no conflicts.
> 
> Cheers,
> 
> Michael
> 
> 
> On 04/17/2014 03:30 PM, Lukas Czerner wrote:
> > FALLOC_FL_ZERO_RANGE was added in Linux 3.14,
> > for zeroing ranges in the allocated space in a file.
> > 
> > Signed-off-by: Lukas Czerner <lczerner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > ---
> >  man2/fallocate.2 | 41 +++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 41 insertions(+)
> > 
> > diff --git a/man2/fallocate.2 b/man2/fallocate.2
> > index b31bbde..df31782 100644
> > --- a/man2/fallocate.2
> > +++ b/man2/fallocate.2
> > @@ -124,6 +124,45 @@ Btrfs (since Linux 3.7)
> >  .IP *
> >  tmpfs (since Linux 3.5)
> >  .\" commit 83e4fa9c16e4af7122e31be3eca5d57881d236fe
> > +.SS Zeroing file space
> > +Specifying
> > +.BR FALLOC_FL_ZERO_RANGE
> > +flag (available since Linux 3.14) in
> > +.I mode
> > +zeroes space in the byte range starting at
> > +.I offset
> > +and continuing for
> > +.I len
> > +bytes.
> > +Within the specified range, blocks are preallocated for the regions
> > +that span the holes in the file. After a successful call,
> > +subsequent reads from this range will return zeroes.
> > +
> > +Zeroing is done within the file system preferably by converting range into
> > +unwritten extents which requires very little IO to be issued.
> > +
> > +If the
> > +.B FALLOC_FL_KEEP_SIZE
> > +flag is specified in
> > +.IR mode ,
> > +the behavior of the call is similar,
> > +but the file size will not be changed even if
> > +.IR offset + len
> > +is greater than the file size. This behaviour is the same as when
> > +preallocating space with
> > +.B FALLOC_FL_KEEP_SIZE
> > +specified.
> > +
> > +Not all filesystems support
> > +.BR FALLOC_FL_ZERO_RANGE ;
> > +if a filesystem doesn't support the operation, an error is returned.
> > +The operation is supported on at least the following filesystems
> > +.IP * 3
> > +XFS (since Linux 2.14)
> > +.\" commit 376ba313147b4172f3e8cf620b9fb591f3e8cdfa
> > +.IP *
> > +ext4 (since Linux 3.14)
> > +.\" commit b8a8684502a0fc852afa0056c6bb2a9273f6fcc0
> >  .SH RETURN VALUE
> >  On success,
> >  .BR fallocate ()
> > @@ -193,6 +232,8 @@ Or:
> >  .I mode
> >  specifies
> >  .BR FALLOC_FL_PUNCH_HOLE
> > +or
> > +.BR FALLOC_FL_ZERO_RANGE
> >  and
> >  the file referred to by
> >  .I fd
> > 
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-04-18 16:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 13:30 [PATCH] fallocate.2: Document FALLOC_FL_ZERO_RANGE Lukas Czerner
     [not found] ` <1397741451-19161-1-git-send-email-lczerner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-04-18 15:49   ` Michael Kerrisk (man-pages)
     [not found]     ` <5351499C.2080506-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-18 16:21       ` Lukáš Czerner [this message]
     [not found]         ` <alpine.LFD.2.00.1404181819470.2128-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-04-29 13:26           ` Michael Kerrisk (man-pages)
     [not found]             ` <CAKgNAkibmSZBD4ThhuGg7sJuGBVR+pfMe30b-HXQ0BhYr1Uy2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-30 14:09               ` [PATCH v2] " Lukas Czerner
     [not found]                 ` <1398866967-26887-1-git-send-email-lczerner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-04-30 14:48                   ` Michael Kerrisk (man-pages)
     [not found]                     ` <53610D4A.3090506-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-30 14:54                       ` Lukáš Czerner
     [not found]                         ` <alpine.LFD.2.00.1404301651060.2100-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-04-30 19:47                           ` Michael Kerrisk (man-pages)
     [not found]                             ` <5361533A.1080705-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-03  3:07                               ` Michael Kerrisk (man-pages)
     [not found]                                 ` <53645D7C.4060701-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-05 12:02                                   ` Lukáš Czerner

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=alpine.LFD.2.00.1404181819470.2128@localhost.localdomain \
    --to=lczerner-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox