[#include <linux/fs.h>
#include <linux/namei.h>],
[path_lookup(NULL, 0, NULL);])
+ AC_CHECK_LINUX_FUNC([proc_create],
+ [#include <linux/proc_fs.h>],
+ [proc_create(NULL, 0, NULL, NULL);])
AC_CHECK_LINUX_FUNC([rcu_read_lock],
[#include <linux/rcupdate.h>],
[rcu_read_lock();])
return code;
}
+static inline struct proc_dir_entry *
+afs_proc_create(char *name, umode_t mode, struct proc_dir_entry *parent, struct file_operations *fops) {
+#if defined(HAVE_LINUX_PROC_CREATE)
+ return proc_create(name, mode, parent, fops);
+#else
+ struct proc_dir_entry *entry;
+ entry = create_proc_entry(name, mode, parent);
+ if (entry)
+ entry->proc_fops = fops;
+ return entry;
+#endif
+}
+
#endif /* AFS_LINUX_OSI_COMPAT_H */
#include <linux/ioctl32.h>
#endif
-#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/kernel.h>
+#include "osi_compat.h"
+
extern struct proc_dir_entry *openafs_procfs;
#if defined(NEED_IOCTL32) && !defined(HAVE_COMPAT_IOCTL)
static int ioctl32_done;
{
struct proc_dir_entry *entry;
- entry = create_proc_entry(PROC_SYSCALL_NAME, 0666, openafs_procfs);
- entry->proc_fops = &afs_syscall_fops;
+ entry = afs_proc_create(PROC_SYSCALL_NAME, 0666, openafs_procfs, &afs_syscall_fops);
#if defined(STRUCT_PROC_DIR_ENTRY_HAS_OWNER)
- entry->owner = THIS_MODULE;
+ if (entry)
+ entry->owner = THIS_MODULE;
#endif
#if defined(NEED_IOCTL32) && !defined(HAVE_COMPAT_IOCTL)
# include <asm/ia32_unistd.h>
#endif
-#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/kernel.h>
+#include "osi_compat.h"
+
struct proc_dir_entry *openafs_procfs;
#ifdef HAVE_LINUX_SEQ_FILE_H
openafs_procfs = proc_mkdir(path, NULL);
#endif
#ifdef HAVE_LINUX_SEQ_FILE_H
- entry = create_proc_entry("unixusers", 0, openafs_procfs);
- if (entry) {
- entry->proc_fops = &afs_unixuser_fops;
+ entry = afs_proc_create("unixusers", 0, openafs_procfs, &afs_unixuser_fops);
# if defined(STRUCT_PROC_DIR_ENTRY_HAS_OWNER)
+ if (entry)
entry->owner = THIS_MODULE;
# endif
- }
- entry = create_proc_entry(PROC_CELLSERVDB_NAME, 0, openafs_procfs);
- if (entry)
- entry->proc_fops = &afs_csdb_operations;
+ entry = afs_proc_create(PROC_CELLSERVDB_NAME, 0, openafs_procfs, &afs_csdb_operations);
#else
entry = create_proc_info_entry(PROC_CELLSERVDB_NAME, (S_IFREG|S_IRUGO), openafs_procfs, csdbproc_info);
#endif
#if defined(STRUCT_PROC_DIR_ENTRY_HAS_OWNER)
- entry->owner = THIS_MODULE;
+ if (entry)
+ entry->owner = THIS_MODULE;
#endif
}
# include <linux/sched.h>
# include <linux/mm.h>
# include <linux/slab.h>
+# include <linux/proc_fs.h>
# include <linux/string.h>
# if defined(HAVE_LINUX_SEMAPHORE_H)
# include <linux/semaphore.h>