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
acec7ca3
Commit
acec7ca3
authored
May 05, 2003
by
Steven Whitehouse
Committed by
David S. Miller
May 05, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FS]: Add seq_release_private and proc_net_fops_create helpers.
parent
ebaabbc2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
fs/seq_file.c
fs/seq_file.c
+10
-0
include/linux/proc_fs.h
include/linux/proc_fs.h
+10
-1
include/linux/seq_file.h
include/linux/seq_file.h
+1
-0
kernel/ksyms.c
kernel/ksyms.c
+1
-0
No files found.
fs/seq_file.c
View file @
acec7ca3
...
...
@@ -338,3 +338,13 @@ int single_release(struct inode *inode, struct file *file)
kfree
(
op
);
return
res
;
}
int
seq_release_private
(
struct
inode
*
inode
,
struct
file
*
file
)
{
struct
seq_file
*
seq
=
file
->
private_data
;
kfree
(
seq
->
private
);
seq
->
private
=
NULL
;
return
seq_release
(
inode
,
file
);
}
include/linux/proc_fs.h
View file @
acec7ca3
...
...
@@ -163,6 +163,15 @@ static inline struct proc_dir_entry *proc_net_create(const char *name,
return
create_proc_info_entry
(
name
,
mode
,
proc_net
,
get_info
);
}
static
inline
struct
proc_dir_entry
*
proc_net_fops_create
(
const
char
*
name
,
mode_t
mode
,
struct
file_operations
*
fops
)
{
struct
proc_dir_entry
*
res
=
create_proc_entry
(
name
,
mode
,
proc_net
);
if
(
res
)
res
->
proc_fops
=
fops
;
return
res
;
}
static
inline
void
proc_net_remove
(
const
char
*
name
)
{
remove_proc_entry
(
name
,
proc_net
);
...
...
@@ -171,7 +180,7 @@ static inline void proc_net_remove(const char *name)
#else
#define proc_root_driver NULL
#define proc_net_fops_create(name,mode,fops) do {} while(0)
static
inline
struct
proc_dir_entry
*
proc_net_create
(
const
char
*
name
,
mode_t
mode
,
get_info_t
*
get_info
)
{
return
NULL
;}
static
inline
void
proc_net_remove
(
const
char
*
name
)
{}
...
...
include/linux/seq_file.h
View file @
acec7ca3
...
...
@@ -60,5 +60,6 @@ int seq_printf(struct seq_file *, const char *, ...)
int
single_open
(
struct
file
*
,
int
(
*
)(
struct
seq_file
*
,
void
*
),
void
*
);
int
single_release
(
struct
inode
*
,
struct
file
*
);
int
seq_release_private
(
struct
inode
*
,
struct
file
*
);
#endif
#endif
kernel/ksyms.c
View file @
acec7ca3
...
...
@@ -540,6 +540,7 @@ EXPORT_SYMBOL(seq_read);
EXPORT_SYMBOL
(
seq_lseek
);
EXPORT_SYMBOL
(
single_open
);
EXPORT_SYMBOL
(
single_release
);
EXPORT_SYMBOL
(
seq_release_private
);
/* Program loader interfaces */
#ifdef CONFIG_MMU
...
...
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