diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-07-17 15:21:29 -0700 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2008-07-17 15:21:29 -0700 |
commit | a6795e9ebb420d87af43789174689af0d66d1d35 (patch) | |
tree | fb2a86ad010015fdd311f3b7f6ef30f60c14b8f7 /include/linux/configfs.h | |
parent | f89ab8619e5320cc9c2576f5f8dcbaf6c0ba3950 (diff) | |
download | lwn-a6795e9ebb420d87af43789174689af0d66d1d35.tar.gz lwn-a6795e9ebb420d87af43789174689af0d66d1d35.zip |
configfs: Allow ->make_item() and ->make_group() to return detailed errors.
The configfs operations ->make_item() and ->make_group() currently
return a new item/group. A return of NULL signifies an error. Because
of this, -ENOMEM is the only return code bubbled up the stack.
Multiple folks have requested the ability to return specific error codes
when these operations fail. This patch adds that ability by changing the
->make_item/group() ops to return ERR_PTR() values. These errors are
bubbled up appropriately. NULL returns are changed to -ENOMEM for
compatibility.
Also updated are the in-kernel users of configfs.
This is a rework of reverted commit 11c3b79218390a139f2d474ee1e983a672d5839a.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'include/linux/configfs.h')
-rw-r--r-- | include/linux/configfs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/configfs.h b/include/linux/configfs.h index 3ae65b1bf90f..d62c19ff041c 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h @@ -148,7 +148,8 @@ struct configfs_attribute { * items. If the item is a group, it may support mkdir(2). * Groups supply one of make_group() and make_item(). If the * group supports make_group(), one can create group children. If it - * supports make_item(), one can create config_item children. If it has + * supports make_item(), one can create config_item children. make_group() + * and make_item() return ERR_PTR() on errors. If it has * default_groups on group->default_groups, it has automatically created * group children. default_groups may coexist alongsize make_group() or * make_item(), but if the group wishes to have only default_groups |