On Fri, Jun 13, 2014 at 1:25 AM, Jaegeuk Kim <[email protected]> wrote: > diff --git a/lib/libf2fs.c b/lib/libf2fs.c > index 6168c5c..8d6c670 100644 > --- a/lib/libf2fs.c > +++ b/lib/libf2fs.c > @@ -493,3 +493,15 @@ int f2fs_get_device_info(struct f2fs_configuration *c) > return 0; > } > > +void f2fs_finalize_device(struct f2fs_configuration *c) > +{ > + /* > + * We should call fsync() to flush out all the dirty pages > + * in the block device page cache. > + */ > + if (fsync(c->fd) < 0) > + MSG(0, "\tError: Could not conduct fsync!!!\n"); > + > + if (close(c->fd) < 0) > + MSG(0, "\tError: Failed to close device file!!!\n"); > +}
This might be better in lib/libf2fs_io.c. It should stay outside of libf2fs otherwise it prevents building code that works on something else that an fd which supports fsync/close/... Currently libf2fs is device agnostic: I'm able to use it against Android's libsparse by linking against a lib that provides stubs for everything in f2fs_format_utils.c and lib/libf2fs_io.c. ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
