aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/configfs.h
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-07-17 18:21:29 -0400
committerJoel Becker <joel.becker@oracle.com>2008-07-17 18:21:29 -0400
commita6795e9ebb420d87af43789174689af0d66d1d35 (patch)
treefb2a86ad010015fdd311f3b7f6ef30f60c14b8f7 /include/linux/configfs.h
parentf89ab8619e5320cc9c2576f5f8dcbaf6c0ba3950 (diff)
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.h3
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 {
148 * items. If the item is a group, it may support mkdir(2). 148 * items. If the item is a group, it may support mkdir(2).
149 * Groups supply one of make_group() and make_item(). If the 149 * Groups supply one of make_group() and make_item(). If the
150 * group supports make_group(), one can create group children. If it 150 * group supports make_group(), one can create group children. If it
151 * supports make_item(), one can create config_item children. If it has 151 * supports make_item(), one can create config_item children. make_group()
152 * and make_item() return ERR_PTR() on errors. If it has
152 * default_groups on group->default_groups, it has automatically created 153 * default_groups on group->default_groups, it has automatically created
153 * group children. default_groups may coexist alongsize make_group() or 154 * group children. default_groups may coexist alongsize make_group() or
154 * make_item(), but if the group wishes to have only default_groups 155 * make_item(), but if the group wishes to have only default_groups