(a) Any person to whom horses, mules, cattle, sheep, hogs, or other livestock shall be entrusted by their owners or their agent for the purpose of feeding, herding, pasturing, keeping, or ranching shall have a lien upon the horses, mules, cattle, sheep, hogs, or other livestock for the amount that may be due for feeding, herding, pasturing, keeping, or ranching, and for all costs incurred in enforcing the lien, including a reasonable sum for attorney's fees.
(b) The amount that may be due shall either be the specific sum or the share of the livestock set by written contract or, if no specific sum or share is agreed upon, a reasonable sum for the services.