lkml.org 
[lkml]   [2002]   [Jan]   [18]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateFri, 18 Jan 2002 12:38:07 +0100 (CET)
FromRoman Zippel <>
SubjectRe: attr.c::notify_change() -- locking_change
Hi,

On Thu, 17 Jan 2002, Craig Christophel wrote:

> +		spin_lock(&inode_lock);
> +		if(inode->i_state & I_ATTR_LOCK) {
> +			spin_unlock(&inode_lock);
> +		}
> +		else {
> +			inode->i_state =| I_ATTR_LOCK;
> +			tflag = 1;
> +			spin_unlock(&inode_lock);
> +		}

There are other write accesses to i_state, so you either have to protect
them all with this lock or you could convert all accesses to use bitfield
instructions.

> +static inline void wait_on_inode(struct inode *inode, int flag);

Instead of the flag two separate functions wait_on_inode_lock,
wait_on_inode_attr_lock are IMO more readable and cleaner.

bye, Roman

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 11:15    [from the cache]
©2003-2008