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
Kirill Smelkov
linux
Commits
4d7fcae9
Commit
4d7fcae9
authored
Jun 15, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[kobject] Add sequence number to kobject hotplug.
parent
eaaaa304
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
lib/kobject.c
lib/kobject.c
+11
-0
No files found.
lib/kobject.c
View file @
4d7fcae9
...
@@ -100,6 +100,9 @@ static void fill_kobj_path(struct kset *kset, struct kobject *kobj, char *path,
...
@@ -100,6 +100,9 @@ static void fill_kobj_path(struct kset *kset, struct kobject *kobj, char *path,
#define BUFFER_SIZE 1024
/* should be enough memory for the env */
#define BUFFER_SIZE 1024
/* should be enough memory for the env */
#define NUM_ENVP 32
/* number of env pointers */
#define NUM_ENVP 32
/* number of env pointers */
static
unsigned
long
sequence_num
;
static
spinlock_t
sequence_lock
=
SPIN_LOCK_UNLOCKED
;
static
void
kset_hotplug
(
const
char
*
action
,
struct
kset
*
kset
,
static
void
kset_hotplug
(
const
char
*
action
,
struct
kset
*
kset
,
struct
kobject
*
kobj
)
struct
kobject
*
kobj
)
{
{
...
@@ -112,6 +115,7 @@ static void kset_hotplug(const char *action, struct kset *kset,
...
@@ -112,6 +115,7 @@ static void kset_hotplug(const char *action, struct kset *kset,
int
kobj_path_length
;
int
kobj_path_length
;
char
*
kobj_path
=
NULL
;
char
*
kobj_path
=
NULL
;
char
*
name
=
NULL
;
char
*
name
=
NULL
;
unsigned
long
seq
;
/* If the kset has a filter operation, call it. If it returns
/* If the kset has a filter operation, call it. If it returns
failure, no hotplug event is required. */
failure, no hotplug event is required. */
...
@@ -152,6 +156,13 @@ static void kset_hotplug(const char *action, struct kset *kset,
...
@@ -152,6 +156,13 @@ static void kset_hotplug(const char *action, struct kset *kset,
envp
[
i
++
]
=
scratch
;
envp
[
i
++
]
=
scratch
;
scratch
+=
sprintf
(
scratch
,
"ACTION=%s"
,
action
)
+
1
;
scratch
+=
sprintf
(
scratch
,
"ACTION=%s"
,
action
)
+
1
;
spin_lock
(
&
sequence_lock
);
seq
=
sequence_num
++
;
spin_unlock
(
&
sequence_lock
);
envp
[
i
++
]
=
scratch
;
scratch
+=
sprintf
(
scratch
,
"SEQNUM=%ld"
,
seq
)
+
1
;
kobj_path_length
=
get_kobj_path_length
(
kset
,
kobj
);
kobj_path_length
=
get_kobj_path_length
(
kset
,
kobj
);
kobj_path
=
kmalloc
(
kobj_path_length
,
GFP_KERNEL
);
kobj_path
=
kmalloc
(
kobj_path_length
,
GFP_KERNEL
);
if
(
!
kobj_path
)
if
(
!
kobj_path
)
...
...
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