aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exofs/inode.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2011-02-03 10:53:25 -0500
committerBoaz Harrosh <bharrosh@panasas.com>2011-03-15 09:02:51 -0400
commit1cea312ad49d9cb964179a784fedb1fcfe396283 (patch)
tree27c45af006b48b1a079698605ea9007398f652b5 /fs/exofs/inode.c
parent9ed96484311b89360b80a4181d856cbdb21630fd (diff)
exofs: Write sbi->s_nextid as part of the Create command
Before when creating a new inode, we'd set the sb->s_dirt flag, and sometime later the system would write out s_nextid as part of the sb_info. Also on inode sync we would force the sb sync as well. Define the s_nextid as a new partition attribute and set it every time we create a new object. At mount we read it from it's new place. We now never set sb->s_dirt anywhere in exofs. write_super is actually never called. The call to exofs_write_super from exofs_put_super is also removed because the VFS always calls ->sync_fs before calling ->put_super twice. To stay backward-and-forward compatible we also write the old s_nextid in the super_block object at unmount, and support zero length attribute on mount. This also fixes a BUG where in layouts when group_width was not a divisor of EXOFS_SUPER_ID (0x10000) the s_nextid was not read from the device it was written to. Because of the sliding window layout trick, and because the read was always done from the 0 device but the write was done via the raid engine that might slide the device view. Now we read and write through the raid engine. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/inode.c')
-rw-r--r--fs/exofs/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
index 681b3cb9b4d..0c713cfbebf 100644
--- a/fs/exofs/inode.c
+++ b/fs/exofs/inode.c
@@ -1102,6 +1102,7 @@ int __exofs_wait_obj_created(struct exofs_i_info *oi)
1102 } 1102 }
1103 return unlikely(is_bad_inode(&oi->vfs_inode)) ? -EIO : 0; 1103 return unlikely(is_bad_inode(&oi->vfs_inode)) ? -EIO : 0;
1104} 1104}
1105
1105/* 1106/*
1106 * Callback function from exofs_new_inode(). The important thing is that we 1107 * Callback function from exofs_new_inode(). The important thing is that we
1107 * set the obj_created flag so that other methods know that the object exists on 1108 * set the obj_created flag so that other methods know that the object exists on
@@ -1160,7 +1161,6 @@ struct inode *exofs_new_inode(struct inode *dir, int mode)
1160 sbi = sb->s_fs_info; 1161 sbi = sb->s_fs_info;
1161 1162
1162 inode->i_mapping->backing_dev_info = sb->s_bdi; 1163 inode->i_mapping->backing_dev_info = sb->s_bdi;
1163 sb->s_dirt = 1;
1164 inode_init_owner(inode, dir, mode); 1164 inode_init_owner(inode, dir, mode);
1165 inode->i_ino = sbi->s_nextid++; 1165 inode->i_ino = sbi->s_nextid++;
1166 inode->i_blkbits = EXOFS_BLKSHIFT; 1166 inode->i_blkbits = EXOFS_BLKSHIFT;
@@ -1171,6 +1171,8 @@ struct inode *exofs_new_inode(struct inode *dir, int mode)
1171 spin_unlock(&sbi->s_next_gen_lock); 1171 spin_unlock(&sbi->s_next_gen_lock);
1172 insert_inode_hash(inode); 1172 insert_inode_hash(inode);
1173 1173
1174 exofs_sbi_write_stats(sbi); /* Make sure new sbi->s_nextid is on disk */
1175
1174 mark_inode_dirty(inode); 1176 mark_inode_dirty(inode);
1175 1177
1176 ret = exofs_get_io_state(&sbi->layout, &ios); 1178 ret = exofs_get_io_state(&sbi->layout, &ios);