Name

get_futex_key — Get parameters which are the keys for a futex

Synopsis

int get_futex_key (u32 __user * uaddr,
 int fshared,
 union futex_key * key,
 int rw);
 

Arguments

uaddr

virtual address of the futex

fshared

0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED

key

address where result is stored.

rw

mapping needs to be read/write (values: VERIFY_READ, VERIFY_WRITE)

Return

a negative error code or 0

The key words are stored in *key on success.

For shared mappings (when fshared), the key is: ( inode->i_sequence, page->index, offset_within_page ) [ also see get_inode_sequence_number ]

For private mappings (or when !fshared), the key is: ( current->mm, address, 0 )

This allows (cross process, where applicable) identification of the futex without keeping the page pinned for the duration of the FUTEX_WAIT.

lock_page might sleep, the caller should not hold a spinlock.