From: Boaz Harrosh <bharrosh@panasas.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Avishay Traeger <avishay@gmail.com>,
Jeff Garzik <jeff@garzik.org>, Evgeniy Polyakov <zbr@ioremap.net>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
open-osd <osd-dev@open-osd.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: Re: [PATCH 1/8] exofs: Kbuild, Headers and osd utils
Date: Tue, 31 Mar 2009 11:57:40 +0300 [thread overview]
Message-ID: <49D1DB04.3040505@panasas.com> (raw)
In-Reply-To: <20090331010414.707695a2.akpm@linux-foundation.org>
On 03/31/2009 11:04 AM, Andrew Morton wrote:
> On Wed, 18 Mar 2009 19:57:36 +0200 Boaz Harrosh <bharrosh@panasas.com> wrote:
>
>> This patch includes osd infrastructure that will be used later by
>> the file system.
>>
>> Also the declarations of constants, on disk structures,
>> and prototypes.
>>
>> And the Kbuild+Kconfig files needed to build the exofs module.
>>
>> ...
>>
>> --- /dev/null
>> +++ b/fs/exofs/Kbuild
>> @@ -0,0 +1,30 @@
>> +#
>> +# Kbuild for the EXOFS module
>> +#
>> +# Copyright (C) 2008 Panasas Inc. All rights reserved.
>> +#
>> +# Authors:
>> +# Boaz Harrosh <bharrosh@panasas.com>
>> +#
>> +# This program is free software; you can redistribute it and/or modify
>> +# it under the terms of the GNU General Public License version 2
>> +#
>> +# Kbuild - Gets included from the Kernels Makefile and build system
>> +#
>> +
>> +ifneq ($(OSD_INC),)
>> +# we are built out-of-tree Kconfigure everything as on
>> +
>> +CONFIG_EXOFS_FS=m
>> +ccflags-y += -DCONFIG_EXOFS_FS -DCONFIG_EXOFS_FS_MODULE
>> +# ccflags-y += -DCONFIG_EXOFS_DEBUG
>> +
>> +# if we are built out-of-tree and the hosting kernel has OSD headers
>> +# then "ccflags-y +=" will not pick the out-off-tree headers. Only by doing
>> +# this it will work. This might break in future kernels
>> +KBUILD_CPPFLAGS := -I$(OSD_INC) $(KBUILD_CPPFLAGS)
>> +
>> +endif
>
> But this patch is putting the fs into the tree, so all the above is unneeded.
>
>> ...
>>
>> + * Object IDs 0, 1, and 2 are always in use (see above defines).
>> + */
>> +enum {
>> + EXOFS_UINT64_MAX = (~0LL),
>
> Use ULLONG_MAX?
>
> ~0ULL would be more consistent.
>
>> + EXOFS_MAX_INO_ID = (sizeof(ino_t) * 8 == 64) ? EXOFS_UINT64_MAX :
>> + (1LL << (sizeof(ino_t) * 8 - 1)),
>
> Tricky, needs a comment.
>
> Would be clearer to use 1ULL.
>
>> + EXOFS_MAX_ID = (EXOFS_MAX_INO_ID - 1 - EXOFS_OBJ_OFF),
>> +};
>> +
OK, OK, OK
>> +/****************************************************************************
>> + * Misc.
>> + ****************************************************************************/
>> +#define EXOFS_BLKSHIFT 12
>> +#define EXOFS_BLKSIZE (1UL << EXOFS_BLKSHIFT)
>> +
>> +/****************************************************************************
>> + * superblock-related things
>> + ****************************************************************************/
>> +#define EXOFS_SUPER_MAGIC 0x5DF5
>
> Should be in include/linux/magic.h
>
Is this relevant for OSD, I guess if there are going to
be more OSD filesystems then yes.
I will do it, thanks.
>> ...
>>
>> +/*
>> + * The file control block - stored in an object's attributes. This is where
>> + * the in-memory inode is stored on disk.
>> + */
>> +struct exofs_fcb {
>> + __le64 i_size; /* Size of the file */
>> + __le16 i_mode; /* File mode */
>> + __le16 i_links_count; /* Links count */
>> + __le32 i_uid; /* Owner Uid */
>> + __le32 i_gid; /* Group Id */
>> + __le32 i_atime; /* Access time */
>> + __le32 i_ctime; /* Creation time */
>> + __le32 i_mtime; /* Modification time */
>> + __le32 i_flags; /* File flags (unused for now)*/
>> + __le32 i_generation; /* File version (for NFS) */
>> + __le32 i_data[EXOFS_IDATA]; /* Short symlink names and device #s */
>> +};
>
> There is no room for future expansion. Would that be appropriate/wise?
> I guess it would need versioning information somewhere too.
>
In osd we have the size-of-the-attribute it sits in. So if in future we
add members we can switch according to size, also we can just stick it in
a different attribute number, so like EXOFS_ATTR_INODE_DATA_VER1
EXOFS_ATTR_INODE_DATA_VER2 attribute. Presence of, means support. Hell we can
even be backward compatible with having 2 or three versions at once.
>> ...
>>
>> +/* u64 has problems with printk this will cast it to unsigned long long */
>> +#define _LLU(x) (unsigned long long)(x)
>
> ug.
>
> Normally the response is "please open-code this". But given that one
> day real soon this printk(u64) problem will be fixed, I guess the use
> of _LLU will make it easy to find and delete all the now-unneeded
> casts.
>
Exactly my thoughts
>> ...
>>
>> +/*
>> + * our inode flags
>> + */
>> +#define OBJ_2BCREATED 0 /* object will be created soon*/
>> +#define OBJ_CREATED 1 /* object has been created on the osd*/
>> +
>> +static inline int obj_2bcreated(struct exofs_i_info *oi)
>> +{
>> + return test_bit(OBJ_2BCREATED, &(oi->i_flags));
>> +}
>
> unneeded parentheses around oi->i_flags.
>
>> +static inline void set_obj_2bcreated(struct exofs_i_info *oi)
>> +{
>> + set_bit(OBJ_2BCREATED, &(oi->i_flags));
>> +}
>> +
>> +static inline int obj_created(struct exofs_i_info *oi)
>> +{
>> + return test_bit(OBJ_CREATED, &(oi->i_flags));
>> +}
>> +
>> +static inline void set_obj_created(struct exofs_i_info *oi)
>> +{
>> + set_bit(OBJ_CREATED, &(oi->i_flags));
>> +}
>
> dittoes.
>
>> ...
>>
>
Thanks
will fix
Boaz
next prev parent reply other threads:[~2009-03-31 9:00 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 17:45 [PATCHSET 0/8 version 4] exofs for kernel 2.6.30 Boaz Harrosh
2009-03-18 17:45 ` Boaz Harrosh
2009-03-18 17:57 ` [PATCH 1/8] exofs: Kbuild, Headers and osd utils Boaz Harrosh
2009-03-18 17:57 ` Boaz Harrosh
2009-03-31 8:04 ` Andrew Morton
2009-03-31 8:57 ` Boaz Harrosh [this message]
2009-03-18 17:58 ` [PATCH 2/8] exofs: file and file_inode operations Boaz Harrosh
2009-03-18 17:58 ` Boaz Harrosh
2009-03-31 8:04 ` Andrew Morton
2009-03-31 8:58 ` Boaz Harrosh
2009-03-18 18:01 ` [PATCH 3/8] exofs: symlink_inode and fast_symlink_inode operations Boaz Harrosh
2009-03-18 18:01 ` Boaz Harrosh
2009-03-18 18:04 ` [PATCH 4/8] exofs: address_space_operations Boaz Harrosh
2009-03-18 18:04 ` Boaz Harrosh
2009-03-22 10:22 ` Marcin Slusarz
2009-03-22 10:41 ` Boaz Harrosh
2009-03-22 13:58 ` [PATCH 4/8 ver5] " Boaz Harrosh
2009-03-22 13:58 ` Boaz Harrosh
2009-03-31 8:04 ` Andrew Morton
2009-03-31 9:04 ` Boaz Harrosh
2009-03-31 10:15 ` Andrew Morton
2009-03-31 10:27 ` Boaz Harrosh
2009-03-18 18:08 ` [PATCH 5/8] exofs: dir_inode and directory operations Boaz Harrosh
2009-03-18 18:08 ` Boaz Harrosh
2009-03-31 8:04 ` Andrew Morton
2009-03-31 10:22 ` Boaz Harrosh
2009-03-18 18:09 ` [PATCH 6/8] exofs: super_operations and file_system_type Boaz Harrosh
2009-03-18 18:09 ` Boaz Harrosh
2009-03-31 8:04 ` Andrew Morton
2009-03-31 10:29 ` Boaz Harrosh
2009-03-31 18:52 ` [osd-dev] " Benny Halevy
2009-04-01 8:05 ` Boaz Harrosh
2009-04-01 9:06 ` Benny Halevy
2009-03-18 18:10 ` [PATCH 7/8] exofs: Documentation Boaz Harrosh
2009-03-18 18:10 ` Boaz Harrosh
2009-03-21 13:26 ` Evgeniy Polyakov
2009-03-22 8:42 ` Boaz Harrosh
2009-03-18 18:11 ` [PATCH 8/8] fs: Add exofs to Kernel build Boaz Harrosh
2009-03-18 18:11 ` Boaz Harrosh
2009-03-23 13:06 ` [PATCHSET 0/8 version 4] exofs for kernel 2.6.30 Boaz Harrosh
2009-03-23 13:06 ` Boaz Harrosh
2009-03-24 9:07 ` Boaz Harrosh
2009-03-30 21:22 ` Andrew Morton
2009-03-31 3:01 ` Stephen Rothwell
2009-03-31 7:13 ` Evgeniy Polyakov
2009-03-31 7:20 ` Boaz Harrosh
2009-03-31 7:20 ` Boaz Harrosh
2009-03-31 7:41 ` Boaz Harrosh
2009-03-31 8:04 ` Andrew Morton
2009-04-01 9:23 ` Jeff Garzik
2009-04-01 11:21 ` Boaz Harrosh
2009-04-02 0:39 ` Jeff Garzik
2009-04-02 12:49 ` Boaz Harrosh
-- strict thread matches above, loose matches on Subject: below --
2009-02-09 13:07 [PATCHSET 0/8 version 3] exofs Boaz Harrosh
2009-02-09 13:12 ` [PATCH 1/8] exofs: Kbuild, Headers and osd utils Boaz Harrosh
2009-02-16 4:18 ` FUJITA Tomonori
2009-02-16 8:49 ` Boaz Harrosh
2009-02-16 9:00 ` FUJITA Tomonori
2009-02-16 9:19 ` Boaz Harrosh
2009-02-16 9:27 ` Jeff Garzik
2009-02-16 10:19 ` Boaz Harrosh
2009-02-16 9:38 ` FUJITA Tomonori
2009-02-16 10:29 ` Boaz Harrosh
2009-02-17 0:20 ` FUJITA Tomonori
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=49D1DB04.3040505@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=avishay@gmail.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=jeff@garzik.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=osd-dev@open-osd.org \
--cc=zbr@ioremap.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.