diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2011-02-03 10:53:25 -0500 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2011-03-15 09:02:51 -0400 |
commit | 1cea312ad49d9cb964179a784fedb1fcfe396283 (patch) | |
tree | 27c45af006b48b1a079698605ea9007398f652b5 /fs/exofs/file.c | |
parent | 9ed96484311b89360b80a4181d856cbdb21630fd (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/file.c')
-rw-r--r-- | fs/exofs/file.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/exofs/file.c b/fs/exofs/file.c index 4c0d6bac9143..45ca323d8363 100644 --- a/fs/exofs/file.c +++ b/fs/exofs/file.c | |||
@@ -45,17 +45,8 @@ static int exofs_release_file(struct inode *inode, struct file *filp) | |||
45 | static int exofs_file_fsync(struct file *filp, int datasync) | 45 | static int exofs_file_fsync(struct file *filp, int datasync) |
46 | { | 46 | { |
47 | int ret; | 47 | int ret; |
48 | struct inode *inode = filp->f_mapping->host; | ||
49 | struct super_block *sb; | ||
50 | |||
51 | ret = sync_inode_metadata(inode, 1); | ||
52 | |||
53 | /* This is a good place to write the sb */ | ||
54 | /* TODO: Sechedule an sb-sync on create */ | ||
55 | sb = inode->i_sb; | ||
56 | if (sb->s_dirt) | ||
57 | exofs_sync_fs(sb, 1); | ||
58 | 48 | ||
49 | ret = sync_inode_metadata(filp->f_mapping->host, 1); | ||
59 | return ret; | 50 | return ret; |
60 | } | 51 | } |
61 | 52 | ||