When several persons hold and are in possession of real property as tenants in common, in which one or more of them have an estate of inheritance, or for life or years, or when several persons hold as tenants in common a vested remainder or reversion in any real property, any one or more of them may maintain an action of an equitable nature for the partition of such real property according to the respective rights of the persons interested therein, and for a sale of such property, or a part of it, if it appears that a partition cannot be had without great prejudice to the owners.