History

XArray: Change xa_insert to return -EBUSY

Userspace translates EEXIST to "File exists" which isn't a very good error message for the problem. "Device or resource busy" is a better indication of what went wrong.

Matthew Wilcox committed 7 years ago

Commit fd9dc931 parent 809ab935 files · +9 −9Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/xarray.h+3−3
@@ -664,7 +664,7 @@ static inline void *xa_cmpxchg_irq(struct xarray *xa, unsigned long index, · 663 unmodified lines
664664 *
665665 * Context: Any context. Takes and releases the xa_lock. May sleep if
666666 * the @gfp flags permit.
667− * Return: 0 if the store succeeded. -EEXIST if another entry was present.
667+ * Return: 0 if the store succeeded. -EBUSY if another entry was present.
668668 * -ENOMEM if memory could not be allocated.
669669 */
670670 static inline int xa_insert(struct xarray *xa, unsigned long index,
@@ -693,7 +693,7 @@ static inline int xa_insert(struct xarray *xa, unsigned long index, · 22 unmodified lines
693693 *
694694 * Context: Any context. Takes and releases the xa_lock while
695695 * disabling softirqs. May sleep if the @gfp flags permit.
696− * Return: 0 if the store succeeded. -EEXIST if another entry was present.
696+ * Return: 0 if the store succeeded. -EBUSY if another entry was present.
697697 * -ENOMEM if memory could not be allocated.
698698 */
699699 static inline int xa_insert_bh(struct xarray *xa, unsigned long index,
@@ -722,7 +722,7 @@ static inline int xa_insert_bh(struct xarray *xa, unsigned long index, · 22 unmodified lines
722722 *
723723 * Context: Process context. Takes and releases the xa_lock while
724724 * disabling interrupts. May sleep if the @gfp flags permit.
725− * Return: 0 if the store succeeded. -EEXIST if another entry was present.
725+ * Return: 0 if the store succeeded. -EBUSY if another entry was present.
726726 * -ENOMEM if memory could not be allocated.
727727 */
728728 static inline int xa_insert_irq(struct xarray *xa, unsigned long index,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t