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
93f47055
Commit
93f47055
authored
Sep 11, 2003
by
Amir Noam
Committed by
Stephen Hemminger
Sep 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bonding 2.6] make each bond device use its own /proc entry
parent
d8bf4cb3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
106 deletions
+102
-106
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_main.c
+102
-106
No files found.
drivers/net/bonding/bond_main.c
View file @
93f47055
...
...
@@ -545,14 +545,6 @@ static int bond_release(struct net_device *master, struct net_device *slave);
static
int
bond_release_all
(
struct
net_device
*
master
);
static
int
bond_sethwaddr
(
struct
net_device
*
master
,
struct
net_device
*
slave
);
/*
* bond_get_info is the interface into the /proc filesystem. This is
* a different interface than the BOND_INFO_QUERY ioctl. That is done
* through the generic networking ioctl interface, and bond_info_query
* is the internal function which provides that information.
*/
static
int
bond_get_info
(
char
*
buf
,
char
**
start
,
off_t
offset
,
int
length
);
/* Caller must hold bond->ptrlock for write */
static
inline
struct
slave
*
bond_assign_current_slave
(
struct
bonding
*
bond
,
struct
slave
*
newslave
)
...
...
@@ -3337,18 +3329,19 @@ static struct net_device_stats *bond_get_stats(struct net_device *dev)
return
stats
;
}
static
int
bond_get_info
(
char
*
buf
,
char
**
start
,
off_t
offset
,
int
length
)
#ifdef CONFIG_PROC_FS
static
int
bond_read_proc
(
char
*
buf
,
char
**
start
,
off_t
off
,
int
count
,
int
*
eof
,
void
*
data
)
{
bonding_t
*
bond
;
struct
bonding
*
bond
=
(
struct
bonding
*
)
data
;
int
len
=
0
;
off_t
begin
=
0
;
u16
link
;
slave_t
*
slave
=
NULL
;
/* make sure the bond won't be taken away */
read_lock
(
&
dev_base_lock
);
len
+=
sprintf
(
buf
+
len
,
"%s
\n
"
,
version
);
read_lock
(
&
dev_base_lock
);
list_for_each_entry
(
bond
,
&
bond_dev_list
,
bond_list
)
{
/*
* This function locks the mutex, so we can't lock it until
* afterwards
...
...
@@ -3449,20 +3442,23 @@ static int bond_get_info(char *buf, char **start, off_t offset, int length)
/*
* Figure out the calcs for the /proc/net interface
*/
*
start
=
buf
+
(
offset
-
begin
);
len
-=
(
offset
-
begin
);
if
(
len
>
length
)
{
len
=
length
;
if
(
len
<=
off
+
count
)
{
*
eof
=
1
;
}
*
start
=
buf
+
off
;
len
-=
off
;
if
(
len
>
count
)
{
len
=
count
;
}
if
(
len
<
0
)
{
len
=
0
;
}
}
read_unlock
(
&
dev_base_lock
);
return
len
;
}
#endif
/* CONFIG_PROC_FS */
static
int
bond_event
(
struct
notifier_block
*
this
,
unsigned
long
event
,
void
*
ptr
)
...
...
@@ -3594,8 +3590,8 @@ static int __init bond_init(struct net_device *dev)
bond
->
bond_proc_dir
->
owner
=
THIS_MODULE
;
bond
->
bond_proc_info_file
=
create_proc_
info_entry
(
"info"
,
0
,
bond
->
bond_proc_dir
,
bond_
get_info
);
create_proc_
read_entry
(
"info"
,
0
,
bond
->
bond_proc_dir
,
bond_
read_proc
,
bond
);
if
(
bond
->
bond_proc_info_file
==
NULL
)
{
printk
(
KERN_ERR
"%s: Cannot init /proc/net/%s/info
\n
"
,
dev
->
name
,
dev
->
name
);
...
...
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