Re: [PATCH v2] mm: shmem: implement POSIX_FADV_[WILL|DONT]NEED for shmem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



()

On 12/2/2021 9:24 PM, Matthew Wilcox wrote:
> Would this change to the documentation have prevented you from making
> this mistake?
> 
>  The advanced API is based around the xa_state.  This is an opaque data
>  structure which you declare on the stack using the XA_STATE()
>  macro.  This macro initialises the xa_state ready to start walking
>  around the XArray.  It is used as a cursor to maintain the position
>  in the XArray and let you compose various operations together without
> -having to restart from the top every time.
> +having to restart from the top every time.  The contents of the xa_state
> +are protected by the rcu_read_lock() or the xas_lock().  If you need to
> +drop whichever of those locks is protecting your state and tree, you must
> +call xas_pause() so that future calls do not rely on the parts of the
> +state which were left unprotected.

Yes, this looks much clear to me.

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum, a Linux Foundation Collaborative Project




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux