patch-2.4.27 linux-2.4.27/fs/jfs/file.c
Next file: linux-2.4.27/fs/jfs/inode.c
Previous file: linux-2.4.27/fs/jbd/transaction.c
Back to the patch index
Back to the overall index
- Lines: 28
- Date:
2004-08-07 16:26:05.985401468 -0700
- Orig file:
linux-2.4.26/fs/jfs/file.c
- Orig date:
2003-11-28 10:26:21.000000000 -0800
diff -urN linux-2.4.26/fs/jfs/file.c linux-2.4.27/fs/jfs/file.c
@@ -70,11 +70,13 @@
if (S_ISREG(inode->i_mode) && file->f_mode & FMODE_WRITE &&
(inode->i_size == 0)) {
struct jfs_inode_info *ji = JFS_IP(inode);
+ spin_lock_irq(&ji->ag_lock);
if (ji->active_ag == -1) {
ji->active_ag = ji->agno;
atomic_inc(
&JFS_SBI(inode->i_sb)->bmap->db_active[ji->agno]);
}
+ spin_unlock_irq(&ji->ag_lock);
}
return 0;
@@ -83,11 +85,13 @@
{
struct jfs_inode_info *ji = JFS_IP(inode);
+ spin_lock_irq(&ji->ag_lock);
if (ji->active_ag != -1) {
struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap;
atomic_dec(&bmap->db_active[ji->active_ag]);
ji->active_ag = -1;
}
+ spin_unlock_irq(&ji->ag_lock);
return 0;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)