diff options
author | Dave Brolley <brolley@redhat.com> | 2010-02-04 11:31:47 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2010-02-04 11:31:47 -0500 |
commit | 8155cc835adb286c456f30ebaa961508bc064e90 (patch) | |
tree | 3634a392b6e0ef15f9426928bb23f30f58546f29 /runtime/procfs.c | |
parent | d2334a2233f4efd055dab021c603f7c046730a66 (diff) | |
parent | 23b7dbfaf1e9860f77b6bf1aa3da8610bf31b03c (diff) | |
download | systemtap-steved-8155cc835adb286c456f30ebaa961508bc064e90.tar.gz systemtap-steved-8155cc835adb286c456f30ebaa961508bc064e90.tar.xz systemtap-steved-8155cc835adb286c456f30ebaa961508bc064e90.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/procfs.c')
-rw-r--r-- | runtime/procfs.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/runtime/procfs.c b/runtime/procfs.c index 1d2ad837..1fd9fcc5 100644 --- a/runtime/procfs.c +++ b/runtime/procfs.c @@ -17,7 +17,10 @@ #ifndef _STP_PROCFS_C_ #define _STP_PROCFS_C_ +#ifndef STP_MAX_PROCFS_FILES #define STP_MAX_PROCFS_FILES 16 +#endif + static int _stp_num_pde = 0; static struct proc_dir_entry *_stp_pde[STP_MAX_PROCFS_FILES]; static struct proc_dir_entry *_stp_procfs_files[STP_MAX_PROCFS_FILES]; @@ -131,7 +134,8 @@ static struct proc_dir_entry *_stp_procfs_lookup(const char *dir, struct proc_di return NULL; } -static int _stp_create_procfs(const char *path, int num) +static int _stp_create_procfs(const char *path, int num, + const struct file_operations *fops) { const char *p; char *next; @@ -182,15 +186,18 @@ static int _stp_create_procfs(const char *path, int num) if (_stp_num_pde == STP_MAX_PROCFS_FILES) goto too_many; - de = create_proc_entry (p, 0600, last_dir); + de = proc_create(p, 0600, last_dir, fops); if (de == NULL) { _stp_error("Could not create file \"%s\" in path \"%s\"\n", p, path); goto err; } - _stp_pde[_stp_num_pde++] = de; - _stp_procfs_files[num] = de; +#ifdef AUTOCONF_PROCFS_OWNER + de->owner = THIS_MODULE; +#endif de->uid = _stp_uid; de->gid = _stp_gid; + _stp_pde[_stp_num_pde++] = de; + _stp_procfs_files[num] = de; return 0; too_many: |