linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: "Steven Whitehouse" <swhiteho@redhat.com>
Cc: "Andrew Morton" <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: GFS2 Filesystem [1/16]
Date: Sat, 25 Feb 2006 23:48:24 +0200	[thread overview]
Message-ID: <84144f020602251348t3ea1420du4e84ac012e9d7909@mail.gmail.com> (raw)
In-Reply-To: <1140792745.6400.710.camel@quoit.chygwyn.com>

On 2/24/06, Steven Whitehouse <swhiteho@redhat.com> wrote:
> +/*  Divide num by den.  Round up if there is a remainder.  */
> +#define DIV_RU(num, den) (((num) + (den) - 1) / (den))

Seems generally useful. Consider putting this to <linux/kernel.h> and
giving it a better name e.g. DIV_ROUND_UP.

> +#define get_v2sdp(sb) ((struct gfs2_sbd *)(sb)->s_fs_info)
> +#define set_v2sdp(sb, sdp) (sb)->s_fs_info = (sdp)
> +#define get_v2ip(inode) ((struct gfs2_inode *)(inode)->u.generic_ip)
> +#define set_v2ip(inode, ip) (inode)->u.generic_ip = (ip)
> +#define get_v2fp(file) ((struct gfs2_file *)(file)->private_data)
> +#define set_v2fp(file, fp) (file)->private_data = (fp)
> +#define get_v2bd(bh) ((struct gfs2_bufdata *)(bh)->b_private)
> +#define set_v2bd(bh, bd) (bh)->b_private = (bd)
> +
> +#define get_transaction ((struct gfs2_trans *)(current->journal_info))
> +#define set_transaction(tr) (current->journal_info) = (tr)
> +
> +#define get_gl2ip(gl) ((struct gfs2_inode *)(gl)->gl_object)
> +#define set_gl2ip(gl, ip) (gl)->gl_object = (ip)
> +#define get_gl2rgd(gl) ((struct gfs2_rgrpd *)(gl)->gl_object)
> +#define set_gl2rgd(gl, rgd) (gl)->gl_object = (rgd)
> +#define get_gl2gl(gl) ((struct gfs2_glock *)(gl)->gl_object)
> +#define set_gl2gl(gl, gl2) (gl)->gl_object = (gl2)

Consider dropping these macros. Please note redundant casting.

> +#define gfs2_inum_equal(ino1, ino2) \
> +       (((ino1)->no_formal_ino == (ino2)->no_formal_ino) && \
> +       ((ino1)->no_addr == (ino2)->no_addr))

Consider using static inline function instead.

> +#define DT2IF(dt) (((dt) << 12) & S_IFMT)
> +#define IF2DT(sif) (((sif) & S_IFMT) >> 12)

Ditto.

                                              Pekka

  reply	other threads:[~2006-02-25 21:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-24 14:52 GFS2 Filesystem [1/16] Steven Whitehouse
2006-02-25 21:48 ` Pekka Enberg [this message]
2006-02-27  9:10   ` Steven Whitehouse

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=84144f020602251348t3ea1420du4e84ac012e9d7909@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swhiteho@redhat.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).