2013-10-28 (월), 21:16 +0900, Jaegeuk Kim:
Hi,

> 
> 2013-10-26 (토), 00:01 +0800, Huajun Li:
> > From: Huajun Li <huajun...@intel.com>
> > 
> > Add the function f2fs_reserve_block() to easily reserve new blocks.
> > 
> > Signed-off-by: Huajun Li <huajun...@intel.com>
> > Signed-off-by: Haicheng Li <haicheng...@linux.intel.com>
> > Signed-off-by: Weihong Xu <weihong...@intel.com>
> > ---
> >  fs/f2fs/data.c |   29 ++++++++++++++++++-----------
> >  fs/f2fs/f2fs.h |    1 +
> >  2 files changed, 19 insertions(+), 11 deletions(-)
> > 
> > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> > index c8887d8..7b31911 100644
> > --- a/fs/f2fs/data.c
> > +++ b/fs/f2fs/data.c
> > @@ -64,6 +64,23 @@ int reserve_new_block(struct dnode_of_data *dn)
> >     return 0;
> >  }
> >  
> > +int f2fs_reserve_block(struct inode *inode,
> > +                  struct dnode_of_data *dn, pgoff_t index)
> 

We don't need to get dnode_of_data from parameters, since it is
used by this function only.

> 
> > +{
> > +   int err;

+        struct dnode_of_data dn;

> 
> > +
> > +   set_new_dnode(dn, inode, NULL, NULL, 0);
> > +   err = get_dnode_of_data(dn, index, ALLOC_NODE);
> > +   if (err)
> > +           return err;
> > +   if (dn->data_blkaddr == NULL_ADDR)
> > +           err = reserve_new_block(dn);
> > +
> > +   f2fs_put_dnode(dn);
> > +
> > +   return err;
> > +}
> > +
> 

-- 
Jaegeuk Kim
Samsung



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to