Lines Matching refs:fl

563 			struct nfs4_filelayout_segment *fl,  in filelayout_check_layout()  argument
582 if (fl->pattern_offset > lgr->range.offset) { in filelayout_check_layout()
584 __func__, fl->pattern_offset); in filelayout_check_layout()
588 if (!fl->stripe_unit) { in filelayout_check_layout()
590 __func__, fl->stripe_unit); in filelayout_check_layout()
605 fl->dsaddr = dsaddr; in filelayout_check_layout()
607 if (fl->first_stripe_index >= dsaddr->stripe_count) { in filelayout_check_layout()
609 __func__, fl->first_stripe_index); in filelayout_check_layout()
613 if ((fl->stripe_type == STRIPE_SPARSE && in filelayout_check_layout()
614 fl->num_fh > 1 && fl->num_fh != dsaddr->ds_num) || in filelayout_check_layout()
615 (fl->stripe_type == STRIPE_DENSE && in filelayout_check_layout()
616 fl->num_fh != dsaddr->stripe_count)) { in filelayout_check_layout()
618 __func__, fl->num_fh); in filelayout_check_layout()
631 static void _filelayout_free_lseg(struct nfs4_filelayout_segment *fl) in _filelayout_free_lseg() argument
635 if (fl->fh_array) { in _filelayout_free_lseg()
636 for (i = 0; i < fl->num_fh; i++) { in _filelayout_free_lseg()
637 if (!fl->fh_array[i]) in _filelayout_free_lseg()
639 kfree(fl->fh_array[i]); in _filelayout_free_lseg()
641 kfree(fl->fh_array); in _filelayout_free_lseg()
643 kfree(fl); in _filelayout_free_lseg()
648 struct nfs4_filelayout_segment *fl, in filelayout_decode_layout() argument
681 fl->commit_through_mds = 1; in filelayout_decode_layout()
683 fl->stripe_type = STRIPE_DENSE; in filelayout_decode_layout()
685 fl->stripe_type = STRIPE_SPARSE; in filelayout_decode_layout()
686 fl->stripe_unit = nfl_util & ~NFL4_UFLG_MASK; in filelayout_decode_layout()
688 fl->first_stripe_index = be32_to_cpup(p++); in filelayout_decode_layout()
689 p = xdr_decode_hyper(p, &fl->pattern_offset); in filelayout_decode_layout()
690 fl->num_fh = be32_to_cpup(p++); in filelayout_decode_layout()
693 __func__, nfl_util, fl->num_fh, fl->first_stripe_index, in filelayout_decode_layout()
694 fl->pattern_offset); in filelayout_decode_layout()
698 if (fl->num_fh > in filelayout_decode_layout()
702 if (fl->num_fh > 0) { in filelayout_decode_layout()
703 fl->fh_array = kcalloc(fl->num_fh, sizeof(fl->fh_array[0]), in filelayout_decode_layout()
705 if (!fl->fh_array) in filelayout_decode_layout()
709 for (i = 0; i < fl->num_fh; i++) { in filelayout_decode_layout()
711 fl->fh_array[i] = kmalloc(sizeof(struct nfs_fh), gfp_flags); in filelayout_decode_layout()
712 if (!fl->fh_array[i]) in filelayout_decode_layout()
718 fl->fh_array[i]->size = be32_to_cpup(p++); in filelayout_decode_layout()
719 if (sizeof(struct nfs_fh) < fl->fh_array[i]->size) { in filelayout_decode_layout()
721 i, fl->fh_array[i]->size); in filelayout_decode_layout()
725 p = xdr_inline_decode(&stream, fl->fh_array[i]->size); in filelayout_decode_layout()
728 memcpy(fl->fh_array[i]->data, p, fl->fh_array[i]->size); in filelayout_decode_layout()
730 fl->fh_array[i]->size); in filelayout_decode_layout()
744 struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg); in filelayout_free_lseg() local
747 nfs4_fl_put_deviceid(fl->dsaddr); in filelayout_free_lseg()
757 _filelayout_free_lseg(fl); in filelayout_free_lseg()
765 struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg); in filelayout_alloc_commit_info() local
769 if (fl->commit_through_mds) in filelayout_alloc_commit_info()
772 size = (fl->stripe_type == STRIPE_SPARSE) ? in filelayout_alloc_commit_info()
773 fl->dsaddr->ds_num : fl->dsaddr->stripe_count; in filelayout_alloc_commit_info()
822 struct nfs4_filelayout_segment *fl; in filelayout_alloc_lseg() local
827 fl = kzalloc(sizeof(*fl), gfp_flags); in filelayout_alloc_lseg()
828 if (!fl) in filelayout_alloc_lseg()
831 rc = filelayout_decode_layout(layoutid, fl, lgr, &id, gfp_flags); in filelayout_alloc_lseg()
832 if (rc != 0 || filelayout_check_layout(layoutid, fl, lgr, &id, gfp_flags)) { in filelayout_alloc_lseg()
833 _filelayout_free_lseg(fl); in filelayout_alloc_lseg()
836 return &fl->generic_hdr; in filelayout_alloc_lseg()
940 static u32 select_bucket_index(struct nfs4_filelayout_segment *fl, u32 j) in select_bucket_index() argument
942 if (fl->stripe_type == STRIPE_SPARSE) in select_bucket_index()
943 return nfs4_fl_calc_ds_index(&fl->generic_hdr, j); in select_bucket_index()
955 struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg); in filelayout_mark_request_commit() local
958 if (fl->commit_through_mds) { in filelayout_mark_request_commit()
968 i = select_bucket_index(fl, j); in filelayout_mark_request_commit()