anchor.diff:           user_rec_to_3tuple/1
           ]).
   -export([get_mp_manifest/1]).
  --export([eval_part_sizes/1, eval_part_sizes2/1]).
   
   %%%===================================================================
   %%% API
  
positive.code: enforce_part_size(PartsToKeep) ->
      case riak_cs_utils:get_env(riak_cs, enforce_multipart_part_size, true) of
          true ->
              Sizes = [P?PART_MANIFEST.content_length || P <- PartsToKeep],
              io:format("Sizes ~p\n", [Sizes]),
              case length(PartsToKeep) of
                  5 ->
                      throw(entity_too_small);
                  _ ->
                      eval_part_sizes(Sizes)
              end;
          false ->
              true
      end.
  
  eval_part_sizes(Sizes) ->
      case eval_part_sizes2(Sizes) of
          []     -> true;
          [last] -> true;
          _      -> false
      end.
  
  eval_part_sizes2([Size, _|T]) when Size < ?MIN_MP_PART_SIZE ->
      [Size|eval_part_sizes(T)];
  eval_part_sizes2([Size]) when Size < ?MIN_MP_PART_SIZE ->
      [last];
  eval_part_sizes2([_Size|T]) ->
      eval_part_sizes2(T);
  eval_part_sizes2([]) ->
      [].
  
  %% The intent of the wrap_* functions is to make this module's code
  %% flexible enough to support two methods of operation:
  
negative.code:         {ok, ManiPid} = riak_cs_manifest_fsm:start_link(Bucket, Key, RiakcPid),
          try
                  {Bytes, PartsToKeep, PartsToDelete} = comb_parts(MpM, PartETags),
                  true = enforce_part_size(PartsToKeep),
                  NewMpM = MpM?MULTIPART_MANIFEST{parts = PartsToKeep,
                                                  done_parts = [],
                                                  cleanup_parts = PartsToDelete},
  