[PATCH v7 02/24] mm/gup: factor out duplicate code from four routines