Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3db29faf
Commit
3db29faf
authored
Jun 10, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Plain Diff
Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-core
parents
a2249c27
f5417dc2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
18 deletions
+22
-18
drivers/base/memblk.c
drivers/base/memblk.c
+1
-8
drivers/base/node.c
drivers/base/node.c
+7
-8
drivers/base/sys.c
drivers/base/sys.c
+13
-0
include/linux/node.h
include/linux/node.h
+1
-2
No files found.
drivers/base/memblk.c
View file @
3db29faf
...
@@ -13,13 +13,6 @@ static struct sysdev_class memblk_class = {
...
@@ -13,13 +13,6 @@ static struct sysdev_class memblk_class = {
set_kset_name
(
"memblk"
),
set_kset_name
(
"memblk"
),
};
};
static
struct
device_driver
memblk_driver
=
{
.
name
=
"memblk"
,
.
bus
=
&
system_bus_type
,
};
/*
/*
* register_memblk - Setup a driverfs device for a MemBlk
* register_memblk - Setup a driverfs device for a MemBlk
* @num - MemBlk number to use when creating the device.
* @num - MemBlk number to use when creating the device.
...
@@ -37,7 +30,7 @@ int __init register_memblk(struct memblk *memblk, int num, struct node *root)
...
@@ -37,7 +30,7 @@ int __init register_memblk(struct memblk *memblk, int num, struct node *root)
error
=
sys_device_register
(
&
memblk
->
sysdev
);
error
=
sys_device_register
(
&
memblk
->
sysdev
);
if
(
!
error
)
if
(
!
error
)
error
=
sysfs_create_link
(
&
root
->
sysdev
.
kobj
,
error
=
sysfs_create_link
(
&
root
->
sysdev
.
kobj
,
&
memblk
->
sysdev
,
kobj
,
&
memblk
->
sysdev
.
kobj
,
memblk
->
sysdev
.
kobj
.
name
);
memblk
->
sysdev
.
kobj
.
name
);
return
error
;
return
error
;
}
}
...
...
drivers/base/node.c
View file @
3db29faf
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* drivers/base/node.c - basic Node class support
* drivers/base/node.c - basic Node class support
*/
*/
#include <linux/
device
.h>
#include <linux/
sysdev
.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/mm.h>
...
@@ -14,18 +14,17 @@ static struct sysdev_class node_class = {
...
@@ -14,18 +14,17 @@ static struct sysdev_class node_class = {
};
};
static
ssize_t
node_read_cpumap
(
struct
device
*
dev
,
char
*
buf
)
static
ssize_t
node_read_cpumap
(
struct
sys_
device
*
dev
,
char
*
buf
)
{
{
struct
node
*
node_dev
=
to_node
(
to_root
(
dev
)
);
struct
node
*
node_dev
=
to_node
(
dev
);
return
sprintf
(
buf
,
"%lx
\n
"
,
node_dev
->
cpumap
);
return
sprintf
(
buf
,
"%lx
\n
"
,
node_dev
->
cpumap
);
}
}
static
SYSDEV_ATTR
(
cpumap
,
S_IRUGO
,
node_read_cpumap
,
NULL
);
static
SYSDEV_ATTR
(
cpumap
,
S_IRUGO
,
node_read_cpumap
,
NULL
);
#define K(x) ((x) << (PAGE_SHIFT - 10))
#define K(x) ((x) << (PAGE_SHIFT - 10))
static
ssize_t
node_read_meminfo
(
struct
device
*
dev
,
char
*
buf
)
static
ssize_t
node_read_meminfo
(
struct
sys_
device
*
dev
,
char
*
buf
)
{
{
struct
sys_root
*
node
=
to_root
(
dev
);
int
nid
=
dev
->
id
;
int
nid
=
node
->
id
;
struct
sysinfo
i
;
struct
sysinfo
i
;
si_meminfo_node
(
&
i
,
nid
);
si_meminfo_node
(
&
i
,
nid
);
return
sprintf
(
buf
,
"
\n
"
return
sprintf
(
buf
,
"
\n
"
...
@@ -64,8 +63,8 @@ int __init register_node(struct node *node, int num, struct node *parent)
...
@@ -64,8 +63,8 @@ int __init register_node(struct node *node, int num, struct node *parent)
error
=
sys_device_register
(
&
node
->
sysdev
);
error
=
sys_device_register
(
&
node
->
sysdev
);
if
(
!
error
){
if
(
!
error
){
sys
_device_create_file
(
&
node
->
sysroot
.
dev
,
&
attr_cpumap
);
sys
dev_create_file
(
&
node
->
sys
dev
,
&
attr_cpumap
);
sys
_device_create_file
(
&
node
->
sysroot
.
dev
,
&
attr_meminfo
);
sys
dev_create_file
(
&
node
->
sys
dev
,
&
attr_meminfo
);
}
}
return
error
;
return
error
;
}
}
...
...
drivers/base/sys.c
View file @
3db29faf
...
@@ -62,6 +62,19 @@ static struct kobj_type ktype_sysdev = {
...
@@ -62,6 +62,19 @@ static struct kobj_type ktype_sysdev = {
.
sysfs_ops
=
&
sysfs_ops
,
.
sysfs_ops
=
&
sysfs_ops
,
};
};
int
sysdev_create_file
(
struct
sys_device
*
s
,
struct
sysdev_attribute
*
a
)
{
return
sysfs_create_file
(
&
s
->
kobj
,
&
a
->
attr
);
}
void
sysdev_remove_file
(
struct
sys_device
*
s
,
struct
sysdev_attribute
*
a
)
{
sysfs_remove_file
(
&
s
->
kobj
,
&
a
->
attr
);
}
/*
/*
* declare system_subsys
* declare system_subsys
*/
*/
...
...
include/linux/node.h
View file @
3db29faf
...
@@ -28,7 +28,6 @@ struct node {
...
@@ -28,7 +28,6 @@ struct node {
extern
int
register_node
(
struct
node
*
,
int
,
struct
node
*
);
extern
int
register_node
(
struct
node
*
,
int
,
struct
node
*
);
#define to_node(_root) container_of(_root, struct node, sysroot)
#define to_node(sys_device) container_of(sys_device, struct node, sysdev)
#define to_root(_dev) container_of(_dev, struct sys_root, dev)
#endif
/* _LINUX_NODE_H_ */
#endif
/* _LINUX_NODE_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment