[pnfs] [PATCH 01/18] pnfs: initialize pageio for read
Benny Halevy
bhalevy at panasas.com
Tue Jan 8 08:53:14 EST 2008
On Jan. 07, 2008, 22:47 +0200, andros at umich.edu wrote:
<snip>
> +void
> pnfs_set_pg_test(struct inode *inode, struct nfs_pageio_descriptor *pgio)
> {
> struct pnfs_layout_type *laytype;
> - struct layoutdriver_policy_operations *policy_ops;
> struct pnfs_layoutdriver_type *ld;
>
> + pgio->pg_test = NULL;
> +
> laytype = NFS_I(inode)->current_layout;
> ld = NFS_SERVER(inode)->pnfs_curr_ld;
> if (!pnfs_enabled_sb(NFS_SERVER(inode)) || !laytype)
> return;
> - policy_ops = ld->ld_policy_ops;
>
> - if (policy_ops && policy_ops->pg_test) {
> - pgio->pg_test = policy_ops->pg_test;
> - } else {
> - pgio->pg_test = NULL;
> - }
> + if (ld->ld_policy_ops && ld->ld_policy_ops->pg_test)
Actually, the right hand of the comparison above isn't really needed...
just do the assignment below and if ld->ld_policy_ops->pg_test is NULL
pgio->pg_test will remain NULL.
> + pgio->pg_test = ld->ld_policy_ops->pg_test;
> }
>
More information about the pNFS
mailing list