*参照元 [#qc772531] #backlinks *説明 [#pfae118d] -パス: [[linux-2.6.33/kernel/resource.c]] -FIXME: これは何? --説明 **引数 [#n1a667ce] -struct resource *parent -- --[[linux-2.6.33/resource]] -struct resource *new -- **返り値 [#le40eec3] -int --成功ならば 0、失敗ならば負のエラー値。 **参考 [#zdb5024e] *実装 [#l1ef2e7a] /** * insert_resource - Inserts a resource in the resource tree * @parent: parent of the new resource * @new: new resource to insert * * Returns 0 on success, -EBUSY if the resource can't be inserted. * * This function is equivalent to request_resource when no conflict * happens. If a conflict happens, and the conflicting resources * entirely fit within the range of the new resource, then the new * resource is inserted and the conflicting resources become children of * the new resource. */ int insert_resource(struct resource *parent, struct resource *new) { struct resource *conflict; write_lock(&resource_lock); conflict = __insert_resource(parent, new); write_unlock(&resource_lock); - --[[linux-2.6.33/write_lock()]] - --[[linux-2.6.33/__insert_resource()]] - --[[linux-2.6.33/write_unlock()]] return conflict ? -EBUSY : 0; } *コメント [#kd4db132]