Lines Matching refs:fl
564 struct nfs4_filelayout_segment *fl, in filelayout_check_layout() argument
583 if (fl->pattern_offset > lgr->range.offset) { in filelayout_check_layout()
585 __func__, fl->pattern_offset); in filelayout_check_layout()
589 if (!fl->stripe_unit) { in filelayout_check_layout()
591 __func__, fl->stripe_unit); in filelayout_check_layout()
606 fl->dsaddr = dsaddr; in filelayout_check_layout()
608 if (fl->first_stripe_index >= dsaddr->stripe_count) { in filelayout_check_layout()
610 __func__, fl->first_stripe_index); in filelayout_check_layout()
614 if ((fl->stripe_type == STRIPE_SPARSE && in filelayout_check_layout()
615 fl->num_fh > 1 && fl->num_fh != dsaddr->ds_num) || in filelayout_check_layout()
616 (fl->stripe_type == STRIPE_DENSE && in filelayout_check_layout()
617 fl->num_fh != dsaddr->stripe_count)) { in filelayout_check_layout()
619 __func__, fl->num_fh); in filelayout_check_layout()
632 static void _filelayout_free_lseg(struct nfs4_filelayout_segment *fl) in _filelayout_free_lseg() argument
636 if (fl->fh_array) { in _filelayout_free_lseg()
637 for (i = 0; i < fl->num_fh; i++) { in _filelayout_free_lseg()
638 if (!fl->fh_array[i]) in _filelayout_free_lseg()
640 kfree(fl->fh_array[i]); in _filelayout_free_lseg()
642 kfree(fl->fh_array); in _filelayout_free_lseg()
644 kfree(fl); in _filelayout_free_lseg()
649 struct nfs4_filelayout_segment *fl, in filelayout_decode_layout() argument
682 fl->commit_through_mds = 1; in filelayout_decode_layout()
684 fl->stripe_type = STRIPE_DENSE; in filelayout_decode_layout()
686 fl->stripe_type = STRIPE_SPARSE; in filelayout_decode_layout()
687 fl->stripe_unit = nfl_util & ~NFL4_UFLG_MASK; in filelayout_decode_layout()
689 fl->first_stripe_index = be32_to_cpup(p++); in filelayout_decode_layout()
690 p = xdr_decode_hyper(p, &fl->pattern_offset); in filelayout_decode_layout()
691 fl->num_fh = be32_to_cpup(p++); in filelayout_decode_layout()
694 __func__, nfl_util, fl->num_fh, fl->first_stripe_index, in filelayout_decode_layout()
695 fl->pattern_offset); in filelayout_decode_layout()
699 if (fl->num_fh > in filelayout_decode_layout()
703 if (fl->num_fh > 0) { in filelayout_decode_layout()
704 fl->fh_array = kcalloc(fl->num_fh, sizeof(fl->fh_array[0]), in filelayout_decode_layout()
706 if (!fl->fh_array) in filelayout_decode_layout()
710 for (i = 0; i < fl->num_fh; i++) { in filelayout_decode_layout()
712 fl->fh_array[i] = kmalloc(sizeof(struct nfs_fh), gfp_flags); in filelayout_decode_layout()
713 if (!fl->fh_array[i]) in filelayout_decode_layout()
719 fl->fh_array[i]->size = be32_to_cpup(p++); in filelayout_decode_layout()
720 if (sizeof(struct nfs_fh) < fl->fh_array[i]->size) { in filelayout_decode_layout()
722 i, fl->fh_array[i]->size); in filelayout_decode_layout()
726 p = xdr_inline_decode(&stream, fl->fh_array[i]->size); in filelayout_decode_layout()
729 memcpy(fl->fh_array[i]->data, p, fl->fh_array[i]->size); in filelayout_decode_layout()
731 fl->fh_array[i]->size); in filelayout_decode_layout()
745 struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg); in filelayout_free_lseg() local
748 nfs4_fl_put_deviceid(fl->dsaddr); in filelayout_free_lseg()
758 _filelayout_free_lseg(fl); in filelayout_free_lseg()
766 struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg); in filelayout_alloc_commit_info() local
770 if (fl->commit_through_mds) in filelayout_alloc_commit_info()
773 size = (fl->stripe_type == STRIPE_SPARSE) ? in filelayout_alloc_commit_info()
774 fl->dsaddr->ds_num : fl->dsaddr->stripe_count; in filelayout_alloc_commit_info()
823 struct nfs4_filelayout_segment *fl; in filelayout_alloc_lseg() local
828 fl = kzalloc(sizeof(*fl), gfp_flags); in filelayout_alloc_lseg()
829 if (!fl) in filelayout_alloc_lseg()
832 rc = filelayout_decode_layout(layoutid, fl, lgr, &id, gfp_flags); in filelayout_alloc_lseg()
833 if (rc != 0 || filelayout_check_layout(layoutid, fl, lgr, &id, gfp_flags)) { in filelayout_alloc_lseg()
834 _filelayout_free_lseg(fl); in filelayout_alloc_lseg()
837 return &fl->generic_hdr; in filelayout_alloc_lseg()
941 static u32 select_bucket_index(struct nfs4_filelayout_segment *fl, u32 j) in select_bucket_index() argument
943 if (fl->stripe_type == STRIPE_SPARSE) in select_bucket_index()
944 return nfs4_fl_calc_ds_index(&fl->generic_hdr, j); in select_bucket_index()
956 struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg); in filelayout_mark_request_commit() local
959 if (fl->commit_through_mds) { in filelayout_mark_request_commit()
969 i = select_bucket_index(fl, j); in filelayout_mark_request_commit()