On 05/31/2010 04:43 PM, Boaz Harrosh wrote: > On 05/31/2010 01:33 PM, Christoph Hellwig wrote: >> On Mon, May 31, 2010 at 01:31:01PM +0300, Boaz Harrosh wrote: >>> OK, I was just looking at that. thanks you saved me some digging. >>> should I just open-code the generic_file_fsync minus the blocks >>> thing then? >> >> sync_mapping_buffers is a no-op for you so you can keep it. >> The other difference is that you sync out the superblock at the >> end of your fsync implementation. That is rather unusual, but I don't >> know enough about exofs if you really need to update data in the >> superblock to commit file data to disk. >> >>> I'm busy with the truncate stuff, but I'll do this next. >>> Do you need this ASAP? >> >> I just noticed it while walking through the fsync implementations. >> > > OK Chritoff I would need your help Please. > > It looks like what I need exactly is: > write_inode_now(inode, sync) > > But write_inode_now() has one extra hunk over generic_file_fsync: > if (sync) > inode_sync_wait(inode); > > Do you think I can get in trouble calling it from ->fsync > > I don't like generic_file_fsync because it does not write my > data since I don't have buffer_heads. > > OK, I'm totally lost what does ->fsync need to do? only write > the inode or the pages as well? > > Boaz > --- > git diff --stat -p -M fs/exofs/file.c > fs/exofs/file.c | 8 ++------ > 1 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/fs/exofs/file.c b/fs/exofs/file.c > index f9bfe2b..9b3555e 100644 > --- a/fs/exofs/file.c > +++ b/fs/exofs/file.c > @@ -47,18 +47,14 @@ static int exofs_file_fsync(struct file *filp, int datasync) > struct inode *inode = mapping->host; > struct super_block *sb; > > - ret = filemap_write_and_wait(mapping); > - if (ret) > - return ret; > - You think I also need a: if (!(inode->i_state & I_DIRTY)) return ret; if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) return ret; before the write_inode_now call ? > /* sync the inode attributes */ > - ret = write_inode_now(inode, 1); > + ret = write_inode_now(inode, datasync); > > /* This is a good place to write the sb */ > /* TODO: Sechedule an sb-sync on create */ > sb = inode->i_sb; > if (sb->s_dirt) > - exofs_sync_fs(sb, 1); > + exofs_sync_fs(sb, datasync); > > return ret; > } -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html