linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk,
	arnd@arndb.de, tytso@mit.edu, chur.lee@samsung.com,
	cm224.lee@samsung.com, jooyoung.hwang@samsung.com
Subject: Re: [PATCH 02/16 v2] f2fs: add on-disk layout
Date: Tue, 23 Oct 2012 14:46:40 +1100	[thread overview]
Message-ID: <20121023144640.228d919e@notabene.brown> (raw)
In-Reply-To: <001201cdb0c5$bdf728f0$39e57ad0$%kim@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 2148 bytes --]

On Tue, 23 Oct 2012 11:26:00 +0900 Jaegeuk Kim <jaegeuk.kim@samsung.com>
wrote:

> This adds a header file describing the on-disk layout of f2fs.
> 


> +struct f2fs_inode {
> +	__le16 i_mode;			/* File mode */
> +	__u8 i_advise;			/* File hints */
> +	__u8 i_reserved;		/* Reserved */
> +	__le32 i_uid;			/* User ID */
> +	__le32 i_gid;			/* Group ID */
> +	__le32 i_links;			/* Links count */
> +	__le64 i_size;			/* File size in bytes */
> +	__le64 i_blocks;		/* File size in blocks */
> +	__le64 i_ctime;			/* Inode change time */
> +	__le64 i_mtime;			/* Modification time */
> +	__le32 i_ctime_nsec;
> +	__le32 i_mtime_nsec;
> +	__le32 current_depth;
> +	__le32 i_xattr_nid;		/* nid to save xattr */
> +	__le32 i_flags;			/* file attributes */
> +	__le32 i_pino;			/* parent inode number */
> +	__le32 i_namelen;		/* file name length */
> +	__u8 i_name[F2FS_MAX_NAME_LEN];	/* file name for SPOR */
> +
> +	struct f2fs_extent i_ext;	/* caching a largest extent */
> +
> +	__le32 i_addr[ADDRS_PER_INODE];	/* Pointers to data blocks */
> +
> +	__le32 i_nid[5];		/* direct(2), indirect(2),
> +						double_indirect(1) node id */
> +} __packed;
> +


You appear to have dropped i_btime - no big deal, you weren't using it anyway.
However if you ever want to support NFS export you will need some value which
is assigned when the inode is allocated and never changed until it is
de-allocated.  This is used to detect when an NFS file-handle refers to a
previous incarnation of an inode and so should be rejected as STALE.
i_btime could have possibly provided this, but not any more.  You might want
to add something back.
ext3 uses "i_generation" and has an 's_next_generation' in the superblock to
ensure that each new inode gets a new generation number.

You've also dropped i_atime.  I can certainly understand the desire to do
that, but I wonder if it is entirely wise.  There are some use-cases where
i_mtime is a poor substitute.

Also 'current_depth' looks a little odd without a 'i_' prefix.  It wouldn't
hurt to have a comment noting that it is for directories.

Thanks,
NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2012-10-23  3:46 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23  2:21 [PATCH 00/16 v2] f2fs: introduce flash-friendly file system Jaegeuk Kim
2012-10-23  2:25 ` [PATCH 01/16 v2] f2fs: add document Jaegeuk Kim
2012-10-23 11:41   ` Vyacheslav Dubeyko
2012-10-25 22:14     ` Jaegeuk Kim
2012-10-23  2:26 ` [PATCH 02/16 v2] f2fs: add on-disk layout Jaegeuk Kim
2012-10-23  3:46   ` NeilBrown [this message]
2012-10-23  6:30     ` Jaegeuk Kim
2012-10-23  6:47   ` Marco Stornelli
2012-10-23  7:08     ` Jaegeuk Kim
2012-10-24 11:25   ` Vyacheslav Dubeyko
2012-10-26  3:31     ` Jaegeuk Kim
2012-10-26  8:18       ` Arnd Bergmann
2012-10-26  8:31         ` Jaegeuk Kim
2012-10-26 12:48       ` Vyacheslav Dubeyko
2012-10-26 13:13         ` Jaegeuk Kim
2012-10-23  2:26 ` [PATCH 03/16 v2] f2fs: add superblock and major in-memory structure Jaegeuk Kim
2012-10-27 13:58   ` Vyacheslav Dubeyko
2012-10-23  2:27 ` [PATCH 04/16 v2] f2fs: add super block operations Jaegeuk Kim
2012-10-23  6:51   ` Marco Stornelli
2012-10-23  7:09     ` Jaegeuk Kim
2012-10-28 12:08   ` Vyacheslav Dubeyko
2012-10-23  2:28 ` [PATCH 05/16 v2] f2fs: add checkpoint operations Jaegeuk Kim
2012-10-23  2:28 ` [PATCH 06/16 v2] f2fs: add node operations Jaegeuk Kim
2012-10-23  2:28 ` [PATCH 07/16 v2] f2fs: add segment operations Jaegeuk Kim
2012-10-23  3:02   ` Max Filippov
2012-10-23  3:23     ` Jaegeuk Kim
2012-10-23  2:29 ` [PATCH 08/16 v2] f2fs: add file operations Jaegeuk Kim
2012-10-23  6:58   ` Marco Stornelli
2012-10-23  7:31     ` Jaegeuk Kim
2012-10-23  7:39       ` Marco Stornelli
2012-10-23  2:29 ` [PATCH 09/16 v2] f2fs: add address space operations for data Jaegeuk Kim
2012-10-23  2:30 ` [PATCH 10/16 v2] f2fs: add core inode operations Jaegeuk Kim
2012-10-23  2:30 ` [PATCH 11/16 v2] f2fs: add inode operations for special inodes Jaegeuk Kim
2012-10-23  7:01   ` Marco Stornelli
2012-10-23  7:46     ` Jaegeuk Kim
2012-10-23  8:20       ` Marco Stornelli
2012-10-23  8:49         ` Jaegeuk Kim
2012-10-23  9:35           ` Marco Stornelli
2012-10-23  2:31 ` [PATCH 12/16 v2] f2fs: add core directory operations Jaegeuk Kim
2012-10-23  2:31 ` [PATCH 13/16 v2] f2fs: add xattr and acl functionalities Jaegeuk Kim
2012-10-23  2:32 ` [PATCH 14/16 v2] f2fs: add garbage collection functions Jaegeuk Kim
2012-10-23  2:32 ` [PATCH 15/16 v2] f2fs: add recovery routines for roll-forward Jaegeuk Kim
2012-10-23  2:33 ` [PATCH 16/16 v2] f2fs: update Kconfig and Makefile Jaegeuk Kim
2012-10-23  3:04   ` Greg KH
2012-10-23  3:21     ` Jaegeuk Kim
2012-10-23 18:20 ` [PATCH 0/3] f2fs: move proc files to debugfs Greg KH
2012-10-23 18:21   ` [PATCH 1/3] f2fs: gc.h: make should_do_checkpoint() inline Greg KH
2012-10-23 18:22   ` [PATCH 2/3] f2fs: move statistics code into one file Greg KH
2012-10-23 18:23   ` [PATCH 3/3] f2fs: move proc files to debugfs Greg KH
2012-10-23 19:20     ` [PATCH 3/3 v2] " Greg KH
2012-10-23 19:11   ` [PATCH 0/3] " Greg KH
2012-10-25  8:12     ` Jaegeuk Kim
2012-10-23 18:26 ` [PATCH 00/16 v2] f2fs: introduce flash-friendly file system Greg KH
2012-10-23 18:57   ` Greg KH
2012-10-23 23:18     ` Jaegeuk Kim
2012-10-24  3:02       ` 'Greg KH'
2012-10-24  5:35         ` Jaegeuk Kim
2012-10-23 23:14   ` Jaegeuk Kim
2012-10-24  3:01     ` 'Greg KH'
2012-10-24  5:34       ` Jaegeuk Kim

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=20121023144640.228d919e@notabene.brown \
    --to=neilb@suse.de \
    --cc=arnd@arndb.de \
    --cc=chur.lee@samsung.com \
    --cc=cm224.lee@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaegeuk.kim@samsung.com \
    --cc=jooyoung.hwang@samsung.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).