From: Steven Whitehouse <steve@gw.chygwyn.com>
To: davem@redhat.com (David S. Miller)
Cc: linux-decnet-user@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: Remains of seq_file conversion for DECnet, plus fixes
Date: Thu, 1 May 2003 21:52:01 +0100 (BST) [thread overview]
Message-ID: <200305012052.VAA19274@gw.chygwyn.com> (raw)
In-Reply-To: <20030501.060909.26990580.davem@redhat.com> from "David S. Miller" at May 01, 2003 06:09:09 AM
Hi,
I've split the patch into three. Any further splitting/changes will have to
wait until next week when I'll have time to work on it again.
- Part 1. Things outside DECnet
- Part 2. seq_file & fixes for DECnet depending on part 1
- Part 3. Addition of the DECnet routing grabulator (does not depend on other
patches)
Below is part 1 with the following features:
o Introduce kfree_release() in seq_file.c for use of DECnet and eventually
IP as well (and other things...?)
o Added proc_net_fops_create() like proc_net_create() but with file_operations argument to use with seq_file code (cleans up some #ifdefs). If there are
no objections, I'll send a patch for IPv4/6 shortly.
Steve.
--------------------------------------------------------------------------
diff -Nru linux-2.5.68-bk10/fs/seq_file.c linux/fs/seq_file.c
--- linux-2.5.68-bk10/fs/seq_file.c Sun Apr 20 03:27:58 2003
+++ linux/fs/seq_file.c Mon Apr 21 14:40:35 2003
@@ -338,3 +338,13 @@
kfree(op);
return res;
}
+
+int kfree_release(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-bk10/include/linux/proc_fs.h linux/include/linux/proc_fs.h
--- linux-2.5.68-bk10/include/linux/proc_fs.h Wed Jan 1 19:20:49 2003
+++ linux/include/linux/proc_fs.h Tue Apr 22 01:32:43 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-bk10/include/linux/seq_file.h linux/include/linux/seq_file.h
--- linux-2.5.68-bk10/include/linux/seq_file.h Wed Jan 1 19:23:19 2003
+++ linux/include/linux/seq_file.h Mon Apr 21 14:41:12 2003
@@ -60,5 +60,6 @@
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
int single_release(struct inode *, struct file *);
+int kfree_release(struct inode *, struct file *);
#endif
#endif
diff -Nru linux-2.5.68-bk10/kernel/ksyms.c linux/kernel/ksyms.c
--- linux-2.5.68-bk10/kernel/ksyms.c Thu May 1 03:00:23 2003
+++ linux/kernel/ksyms.c Thu May 1 03:00:48 2003
@@ -539,6 +539,7 @@
EXPORT_SYMBOL(seq_lseek);
EXPORT_SYMBOL(single_open);
EXPORT_SYMBOL(single_release);
+EXPORT_SYMBOL(kfree_release);
/* Program loader interfaces */
#ifdef CONFIG_MMU
next prev parent reply other threads:[~2003-05-01 20:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20030421.234303.59654654.davem@redhat.com>
2003-05-01 13:27 ` Remains of seq_file conversion for DECnet, plus fixes Steven Whitehouse
2003-05-01 12:45 ` David S. Miller
2003-05-01 14:04 ` Steven Whitehouse
2003-05-01 13:09 ` David S. Miller
2003-05-01 20:52 ` Steven Whitehouse [this message]
2003-05-01 20:57 ` Christoph Hellwig
2003-05-01 21:35 ` Steven Whitehouse
2003-05-01 21:22 ` David S. Miller
2003-05-02 1:54 ` Arnaldo Carvalho de Melo
2003-05-04 18:43 ` Steven Whitehouse
2003-05-06 6:46 ` David S. Miller
2003-05-01 20:55 ` Remains of seq_file conversion for DECnet, plus fixes (part 2) Steven Whitehouse
2003-05-01 20:57 ` Remains of seq_file conversion for DECnet, plus fixes (part 3) Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200305012052.VAA19274@gw.chygwyn.com \
--to=steve@gw.chygwyn.com \
--cc=Steve@ChyGwyn.com \
--cc=davem@redhat.com \
--cc=linux-decnet-user@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).