diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-07-12 13:47:50 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-16 04:04:28 -0700 |
commit | 43fdf27470b216ebdef47e09ff83bed2f2894b13 (patch) | |
tree | 76b9b838089e5679471026037c93325c228df84a /arch/sparc64/kernel/ldc.c | |
parent | 133f09a169f3022be3de671b29658b7ecb375022 (diff) |
[SPARC64]: Abstract out mdesc accesses for better MD update handling.
Since we have to be able to handle MD updates, having an in-tree
set of data structures representing the MD objects actually makes
things more painful.
The MD itself is easy to parse, and we can implement the existing
interfaces using direct parsing of the MD binary image.
The MD is now reference counted, so accesses have to now take the
form:
handle = mdesc_grab();
... operations on MD ...
mdesc_release(handle);
The only remaining issue are cases where code holds on to references
to MD property values. mdesc_get_property() returns a direct pointer
to the property value, most cases just pull in the information they
need and discard the pointer, but there are few that use the pointer
directly over a long lifetime. Those will be fixed up in a subsequent
changeset.
A preliminary handler for MD update events from domain services is
there, it is rudimentry but it works and handles all of the reference
counting. It does not check the generation number of the MDs,
and it does not generate a "add/delete" list for notification to
interesting parties about MD changes but that will be forthcoming.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/ldc.c')
-rw-r--r-- | arch/sparc64/kernel/ldc.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c index dbb65b674a6..85a2be0b096 100644 --- a/arch/sparc64/kernel/ldc.c +++ b/arch/sparc64/kernel/ldc.c @@ -2335,15 +2335,20 @@ EXPORT_SYMBOL(ldc_free_exp_dring); static int __init ldc_init(void) { - struct mdesc_node *mp; unsigned long major, minor; + struct mdesc_handle *hp; const u64 *v; + u64 mp; - mp = md_find_node_by_name(NULL, "platform"); - if (!mp) + hp = mdesc_grab(); + if (!hp) return -ENODEV; - v = md_get_property(mp, "domaining-enabled", NULL); + mp = mdesc_node_by_name(hp, MDESC_NODE_NULL, "platform"); + if (mp == MDESC_NODE_NULL) + return -ENODEV; + + v = mdesc_get_property(hp, mp, "domaining-enabled", NULL); if (!v) return -ENODEV; |