lkml.org 
[lkml]   [2002]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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 13:15    [W:0.049 / U:10.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site