[PATCH v2 01/19] mm/gup: factor out duplicate code from four routines