linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Amit K. Arora" <aarora@linux.vnet.ibm.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-ext4@vger.kernel.org, xfs@oss.sgi.com, tytso@mit.edu,
	cmm@us.ibm.com, suparna@in.ibm.com, adilger@clusterfs.com,
	dgc@sgi.com
Subject: Re: [PATCH 2/6][TAKE7] fallocate() implementation in i386, x86_64 and powerpc
Date: Fri, 13 Jul 2007 14:21:19 +0100	[thread overview]
Message-ID: <20070713132118.GA23256@infradead.org> (raw)
In-Reply-To: <20070713124755.GB22961@amitarora.in.ibm.com>

On Fri, Jul 13, 2007 at 06:17:55PM +0530, Amit K. Arora wrote:
>  /*
> + * sys_fallocate - preallocate blocks or free preallocated blocks
> + * @fd: the file descriptor
> + * @mode: mode specifies the behavior of allocation.
> + * @offset: The offset within file, from where allocation is being
> + *	    requested. It should not have a negative value.
> + * @len: The amount of space in bytes to be allocated, from the offset.
> + *	 This can not be zero or a negative value.

kerneldoc comments are for in-kernel APIs which syscalls aren't.  I'd say
just temove this comment, the manpage is a much better documentation anyway.

> + * <TBD> Generic fallocate to be added for file systems that do not
> + *	 support fallocate.

Please remove the comment, adding a generic fallback in kernelspace is a
very dumb idea as we already discussed long time ago.

> --- linux-2.6.22.orig/include/linux/fs.h
> +++ linux-2.6.22/include/linux/fs.h
> @@ -266,6 +266,21 @@ extern int dir_notify_enable;
>  #define SYNC_FILE_RANGE_WRITE		2
>  #define SYNC_FILE_RANGE_WAIT_AFTER	4
>  
> +/*
> + * sys_fallocate modes
> + * Currently sys_fallocate supports two modes:
> + * FALLOC_ALLOCATE :	This is the preallocate mode, using which an application
> + *			may request reservation of space for a particular file.
> + *			The file size will be changed if the allocation is
> + *			beyond EOF.
> + * FALLOC_RESV_SPACE :	This is same as the above mode, with only one difference
> + *			that the file size will not be modified.
> + */
> +#define FALLOC_FL_KEEP_SIZE    0x01 /* default is extend/shrink size */
> +
> +#define FALLOC_ALLOCATE        0
> +#define FALLOC_RESV_SPACE      FALLOC_FL_KEEP_SIZE

Just remove FALLOC_ALLOCATE, 0 flags should be the default.  I'm also
not sure there is any point in having two namespace now that we have a flags-
based ABI.

Also please don't add this to fs.h.  fs.h is a complete mess and the
falloc flags are a new user ABI.  Add a linux/falloc.h instead which can
be added to headers-y so the ABI constant can be exported to userspace.


  reply	other threads:[~2007-07-13 13:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13 12:38 [PATCH 0/6][TAKE7] fallocate system call Amit K. Arora
2007-07-13 12:46 ` [PATCH 1/6][TAKE7] manpage for fallocate Amit K. Arora
2007-07-13 14:06   ` David Chinner
2007-07-13 14:27     ` Amit K. Arora
2007-07-14  8:23   ` Michael Kerrisk
2007-07-16  5:32     ` Amit K. Arora
2007-07-23  6:09       ` fallocate() man page Michael Kerrisk
2007-07-23 13:10         ` Amit K. Arora
2007-07-24  7:06           ` David Chinner
2007-07-30  6:21             ` Michael Kerrisk
2007-07-30 19:43           ` Michael Kerrisk
2007-07-31 13:56             ` Amit K. Arora
2007-07-30 19:44           ` fallocate() man page - darft 2 Michael Kerrisk
2007-08-02 17:36             ` Amit K. Arora
2007-08-03 11:59               ` Michael Kerrisk
2007-08-06  6:10                 ` Amit K. Arora
2007-07-13 12:47 ` [PATCH 2/6][TAKE7] fallocate() implementation in i386, x86_64 and powerpc Amit K. Arora
2007-07-13 13:21   ` Christoph Hellwig [this message]
2007-07-13 14:18     ` Amit K. Arora
2007-07-13 14:46       ` Christoph Hellwig
2007-07-13 12:48 ` [PATCH 3/6][TAKE7] revalidate write permissions for fallocate Amit K. Arora
2007-07-13 13:21   ` Christoph Hellwig
2007-07-13 14:28     ` Amit K. Arora
2007-07-13 12:50 ` [PATCH 4/6][TAKE7] ext4: fallocate support in ext4 Amit K. Arora
2007-07-13 12:52 ` [PATCH 5/6][TAKE7] ext4: write support for preallocated blocks Amit K. Arora
2007-07-13 12:52 ` [PATCH 6/6][TAKE7] ext4: change for better extent-to-group alignment Amit K. Arora

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=20070713132118.GA23256@infradead.org \
    --to=hch@infradead.org \
    --cc=aarora@linux.vnet.ibm.com \
    --cc=adilger@clusterfs.com \
    --cc=cmm@us.ibm.com \
    --cc=dgc@sgi.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suparna@in.ibm.com \
    --cc=tytso@mit.edu \
    --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;
as well as URLs for NNTP newsgroup(s).