Re: Remains of seq_file conversion for DECnet, plus fixes

Steven Whitehouse (steve@gw.chygwyn.com)
Sun, 4 May 2003 19:43:51 +0100 (BST)


Hi,

Now that I'm back again, here is the first patch again with kfree_release
renamed as suggested to seq_release_private,

Steve.
-----------------------------------------------------------------------------
diff -Nru linux-2.5.68-bk12/fs/seq_file.c linux/fs/seq_file.c
--- linux-2.5.68-bk12/fs/seq_file.c Sat Apr 19 19:50:30 2003
+++ linux/fs/seq_file.c Sun May 4 11:45:16 2003
@@ -338,3 +338,13 @@
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);
+}
+
diff -Nru linux-2.5.68-bk12/include/linux/proc_fs.h linux/include/linux/proc_fs.h
--- linux-2.5.68-bk12/include/linux/proc_fs.h Sat Apr 19 19:48:46 2003
+++ linux/include/linux/proc_fs.h Sun May 4 11:45:16 2003
@@ -163,6 +163,15 @@
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 @@
#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) {}
diff -Nru linux-2.5.68-bk12/include/linux/seq_file.h linux/include/linux/seq_file.h
--- linux-2.5.68-bk12/include/linux/seq_file.h Sat Apr 19 19:51:18 2003
+++ linux/include/linux/seq_file.h Sun May 4 11:45:16 2003
@@ -60,5 +60,6 @@

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
diff -Nru linux-2.5.68-bk12/kernel/ksyms.c linux/kernel/ksyms.c
--- linux-2.5.68-bk12/kernel/ksyms.c Sun May 4 11:37:41 2003
+++ linux/kernel/ksyms.c Sun May 4 11:45:16 2003
@@ -540,6 +540,7 @@
EXPORT_SYMBOL(seq_lseek);
EXPORT_SYMBOL(single_open);
EXPORT_SYMBOL(single_release);
+EXPORT_SYMBOL(seq_release_private);

/* Program loader interfaces */
#ifdef CONFIG_MMU
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/