All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: JP Abgrall <jpa@google.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] libf2fs: move the finalize_device() into the io lib.
Date: Sat, 14 Jun 2014 14:25:20 +0900	[thread overview]
Message-ID: <20140614052520.GA2456@jmac.local> (raw)
In-Reply-To: <1402691120-38950-1-git-send-email-jpa@google.com>

On Fri, Jun 13, 2014 at 01:25:20PM -0700, JP Abgrall wrote:
> This is required so that libf2fs.c can be used against any kind
> of device (E.g. an in-memory sparse file) just by linking against
> something that provides the libf2fs_io.c functions.
> 
> libf2fs is currently libf2fs.c + libf2fs_io.c

Ok, merged.
Thanks,

> 
> Signed-off-by: JP Abgrall <jpa@google.com>
> ---
>  lib/libf2fs.c    | 12 ------------
>  lib/libf2fs_io.c | 13 +++++++++++++
>  2 files changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/lib/libf2fs.c b/lib/libf2fs.c
> index 8d6c670..6168c5c 100644
> --- a/lib/libf2fs.c
> +++ b/lib/libf2fs.c
> @@ -493,15 +493,3 @@ 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");
> -}
> diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
> index 508ccce..5d9b68d 100644
> --- a/lib/libf2fs_io.c
> +++ b/lib/libf2fs_io.c
> @@ -67,3 +67,16 @@ int dev_read_blocks(void *buf, __u64 addr, __u32 nr_blks)
>  {
>  	return dev_read(buf, addr * F2FS_BLKSIZE, nr_blks * F2FS_BLKSIZE);
>  }
> +
> +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");
> +}
> -- 
> 2.0.0.526.g5318336
> 
> 
> ------------------------------------------------------------------------------
> 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
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

-- 
Jaegeuk Kim

------------------------------------------------------------------------------
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

      reply	other threads:[~2014-06-14  5:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13 20:25 [PATCH] libf2fs: move the finalize_device() into the io lib JP Abgrall
2014-06-14  5:25 ` Jaegeuk Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140614052520.GA2456@jmac.local \
    --to=jaegeuk@kernel.org \
    --cc=jpa@google.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.