In all cases of the partition or sale of property for division of proceeds, the court may allow a reasonable attorney’s fee to the attorney or the plaintiff, to be taxed as a common charge on all the interests, and to be paid out of the proceeds in case of a sale, and to be a lien on the several parts in case of partition.