lkml.org 
[lkml]   [2018]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 11/11] xfs, dax: introduce xfs_break_dax_layouts()
> +static int xfs_wait_dax_page(
> + atomic_t *count,
> + unsigned int mode)
> +{

Normal XFS style would be:

static int
xfs_wait_dax_page(
atomic_t *count,
unsigned int mode)
{

> + struct page *page = refcount_to_page(count);
> + struct address_space *mapping = page->mapping;
> + struct inode *inode = mapping->host;
> + struct xfs_inode *ip = XFS_I(inode);

Looks we don't really need the mapping and inode variables:

struct page *page = refcount_to_page(count);
struct xfs_inode *ip = XFS_I(page->mapping->host);

> + do {
> + if (flags & XFS_BREAK_REMOTE)
> + ret = xfs_break_leased_layouts(inode, iolock);
> + if (ret)
> + return ret;
> + if (flags & XFS_BREAK_MAPS)
> + ret = xfs_break_dax_layouts(inode, *iolock);
> + /*
> + * EBUSY indicates that we dropped locks and waited for
> + * the dax layout to be released. When that happens we
> + * need to revalidate that no new leases or pinned dax
> + * mappings have been established.
> + */
> + } while (ret == -EBUSY);

Maybe instead of the flags argument this should be a type argument
of something like

enum layout_break_reason {
BREAK_WRITE, /* write to file */
BREAK_TRUNCATE, /* truncate or hole punch */
};

as that makes the intent more clear?

\
 
 \ /
  Last update: 2018-03-10 10:56    [W:0.121 / U:2.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site