public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@didntduck.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
	Alexander Viro <viro@math.psu.edu>
Subject: [PATCH] struct super_block cleanup - efs
Date: Tue, 12 Mar 2002 22:10:16 -0500	[thread overview]
Message-ID: <3C8EC318.50408@didntduck.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 71 bytes --]

Seperates efs_sb_info from struct super_block.

-- 

						Brian Gerst

[-- Attachment #2: sb-efs-1 --]
[-- Type: text/plain, Size: 2401 bytes --]

diff -urN linux-2.5.7-pre1/fs/efs/super.c linux/fs/efs/super.c
--- linux-2.5.7-pre1/fs/efs/super.c	Tue Mar 12 17:35:10 2002
+++ linux/fs/efs/super.c	Tue Mar 12 22:03:48 2002
@@ -70,10 +70,17 @@
 		printk(KERN_INFO "efs_inode_cache: not all structures were freed\n");
 }
 
+void efs_put_super(struct super_block *s)
+{
+	kfree(s->u.generic_sbp);
+	s->u.generic_sbp = NULL;
+}
+
 static struct super_operations efs_superblock_operations = {
 	alloc_inode:	efs_alloc_inode,
 	destroy_inode:	efs_destroy_inode,
 	read_inode:	efs_read_inode,
+	put_super:	efs_put_super,
 	statfs:		efs_statfs,
 };
 
@@ -205,7 +212,11 @@
 	struct efs_sb_info *sb;
 	struct buffer_head *bh;
 
- 	sb = SUPER_INFO(s);
+ 	sb = kmalloc(sizeof(struct efs_sb_info), GFP_KERNEL);
+	if (!sb)
+		return -ENOMEM;
+	s->u.generic_sbp = sb;
+	memset(sb, 0, sizeof(struct efs_sb_info));
  
 	s->s_magic		= EFS_SUPER_MAGIC;
 	sb_set_blocksize(s, EFS_BLOCKSIZE);
@@ -263,6 +274,8 @@
 
 out_no_fs_ul:
 out_no_fs:
+	s->u.generic_sbp = NULL;
+	kfree(sb);
 	return -EINVAL;
 }
 
diff -urN linux-2.5.7-pre1/include/linux/efs_fs.h linux/include/linux/efs_fs.h
--- linux-2.5.7-pre1/include/linux/efs_fs.h	Thu Mar  7 21:18:27 2002
+++ linux/include/linux/efs_fs.h	Tue Mar 12 22:06:27 2002
@@ -29,6 +29,7 @@
 
 #include <linux/fs.h>
 #include <linux/efs_fs_i.h>
+#include <linux/efs_fs_sb.h>
 #include <linux/efs_dir.h>
 
 #ifndef MIN
@@ -42,7 +43,11 @@
 {
 	return list_entry(inode, struct efs_inode_info, vfs_inode);
 }
-#define SUPER_INFO(s)				&((s)->u.efs_sb)
+
+static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb)
+{
+	return sb->u.generic_sbp;
+}
 
 extern struct inode_operations efs_dir_inode_operations;
 extern struct file_operations efs_dir_operations;
diff -urN linux-2.5.7-pre1/include/linux/fs.h linux/include/linux/fs.h
--- linux-2.5.7-pre1/include/linux/fs.h	Tue Mar 12 20:22:02 2002
+++ linux/include/linux/fs.h	Tue Mar 12 22:06:23 2002
@@ -658,7 +658,6 @@
 #include <linux/sysv_fs_sb.h>
 #include <linux/affs_fs_sb.h>
 #include <linux/ufs_fs_sb.h>
-#include <linux/efs_fs_sb.h>
 #include <linux/romfs_fs_sb.h>
 #include <linux/smb_fs_sb.h>
 #include <linux/hfs_fs_sb.h>
@@ -714,7 +713,6 @@
 		struct sysv_sb_info	sysv_sb;
 		struct affs_sb_info	affs_sb;
 		struct ufs_sb_info	ufs_sb;
-		struct efs_sb_info	efs_sb;
 		struct shmem_sb_info	shmem_sb;
 		struct romfs_sb_info	romfs_sb;
 		struct smb_sb_info	smbfs_sb;

                 reply	other threads:[~2002-03-13  3:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3C8EC318.50408@didntduck.org \
    --to=bgerst@didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /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