File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,25 @@ static inline void folio_attach_private(struct folio *folio, void *data)
279
279
folio_set_private (folio );
280
280
}
281
281
282
+ /**
283
+ * folio_change_private - Change private data on a folio.
284
+ * @folio: Folio to change the data on.
285
+ * @data: Data to set on the folio.
286
+ *
287
+ * Change the private data attached to a folio and return the old
288
+ * data. The page must previously have had data attached and the data
289
+ * must be detached before the folio will be freed.
290
+ *
291
+ * Return: Data that was previously attached to the folio.
292
+ */
293
+ static inline void * folio_change_private (struct folio * folio , void * data )
294
+ {
295
+ void * old = folio_get_private (folio );
296
+
297
+ folio -> private = data ;
298
+ return old ;
299
+ }
300
+
282
301
/**
283
302
* folio_detach_private - Detach private data from a folio.
284
303
* @folio: Folio to detach data from.
You can’t perform that action at this time.
0 commit comments