All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: David Chinner <dgc@sgi.com>
Cc: xfs@oss.sgi.com, t-nagano@ah.jp.nec.com, xfs-dev@sgi.com
Subject: Re: [REVIEW 1 of 4] Clean up i_flags handling
Date: Tue, 24 Oct 2006 22:38:22 +0100	[thread overview]
Message-ID: <20061024213822.GA23909@infradead.org> (raw)
In-Reply-To: <20061024071723.GR11034@melbourne.sgi.com>

> +/*
> + * i_flags helper functions
> + */
> +static inline void
> +__xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
> +{
> +	ip->i_flags |= flags;
> +}
> +
> +static inline void
> +xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
> +{
> +	spin_lock(&ip->i_flags_lock);
> +	__xfs_iflags_set(ip, flags);
> +	spin_unlock(&ip->i_flags_lock);
> +}

This is not actually 

> +
> +static inline void
> +xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags)
> +{
> +	spin_lock(&ip->i_flags_lock);
> +	ip->i_flags &= ~flags;
> +	spin_unlock(&ip->i_flags_lock);
> +}
> +
> +static inline int
> +__xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
> +{
> +	return (ip->i_flags & flags);
> +}
> +
> +static inline int
> +xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
> +{
> +	int ret;
> +	spin_lock(&ip->i_flags_lock);
> +	ret = __xfs_iflags_test(ip, flags);
> +	spin_unlock(&ip->i_flags_lock);
> +	return ret;

This is not actually guaranteed to work on machiens with very weak
memory ordering.  Please use the *_bit routines from bitops.h instead.

  reply	other threads:[~2006-10-24 21:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-24  7:17 [REVIEW 1 of 4] Clean up i_flags handling David Chinner
2006-10-24 21:38 ` Christoph Hellwig [this message]
2006-10-24 22:15   ` Shailendra Tripathi
2006-10-26  9:46   ` David Chinner

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=20061024213822.GA23909@infradead.org \
    --to=hch@infradead.org \
    --cc=dgc@sgi.com \
    --cc=t-nagano@ah.jp.nec.com \
    --cc=xfs-dev@sgi.com \
    --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 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.