[PATCH v4 02/23] mm/gup: factor out duplicate code from four routines