diff -urN FS-bind/fs/seq_file.c FS-seq_open/fs/seq_file.c --- FS-bind/fs/seq_file.c 2005-10-21 19:06:43.000000000 -0400 +++ FS-seq_open/fs/seq_file.c 2005-11-03 06:59:14.000000000 -0500 @@ -28,13 +28,17 @@ */ int seq_open(struct file *file, struct seq_operations *op) { - struct seq_file *p = kmalloc(sizeof(*p), GFP_KERNEL); - if (!p) - return -ENOMEM; + struct seq_file *p = file->private_data; + + if (!p) { + p = kmalloc(sizeof(*p), GFP_KERNEL); + if (!p) + return -ENOMEM; + file->private_data = p; + } memset(p, 0, sizeof(*p)); sema_init(&p->sem, 1); p->op = op; - file->private_data = p; /* * Wrappers around seq_open(e.g. swaps_open) need to be