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: Alexander Viro <viro@math.psu.edu>,
	vandrove@vc.cvut.cz, Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] struct super_block cleanup - ncpfs
Date: Tue, 12 Mar 2002 17:56:20 -0500	[thread overview]
Message-ID: <3C8E8794.5060903@didntduck.org> (raw)

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

Seperates ncp_sb_info from struct super_block.

-- 

						Brian Gerst

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

diff -urN linux-2.5.7-pre1/fs/ncpfs/inode.c linux/fs/ncpfs/inode.c
--- linux-2.5.7-pre1/fs/ncpfs/inode.c	Tue Mar 12 17:35:11 2002
+++ linux/fs/ncpfs/inode.c	Tue Mar 12 17:44:53 2002
@@ -315,6 +315,10 @@
 #endif
 	struct ncp_entry_info finfo;
 
+	server = kmalloc(sizeof(struct ncp_server), GFP_KERNEL);
+	if (!server)
+		return -ENOMEM;
+	sb->u.generic_sbp = server;
 	error = -EFAULT;
 	if (raw_data == NULL)
 		goto out;
@@ -520,6 +524,8 @@
 	 */
 	fput(ncp_filp);
 out:
+	sb->u.generic_sbp = NULL;
+	kfree(server);
 	return error;
 }
 
@@ -553,7 +559,8 @@
 	if (server->auth.object_name)
 		ncp_kfree_s(server->auth.object_name, server->auth.object_name_len);
 	vfree(server->packet);
-
+	sb->u.generic_sbp = NULL;
+	kfree(server);
 }
 
 static int ncp_statfs(struct super_block *sb, struct statfs *buf)
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 17:35:11 2002
+++ linux/include/linux/fs.h	Tue Mar 12 17:40:30 2002
@@ -667,7 +667,6 @@
 #include <linux/reiserfs_fs_sb.h>
 #include <linux/bfs_fs_sb.h>
 #include <linux/udf_fs_sb.h>
-#include <linux/ncp_fs_sb.h>
 #include <linux/jffs2_fs_sb.h>
 
 extern struct list_head super_blocks;
@@ -724,7 +723,6 @@
 		struct reiserfs_sb_info	reiserfs_sb;
 		struct bfs_sb_info	bfs_sb;
 		struct udf_sb_info	udf_sb;
-		struct ncp_sb_info	ncpfs_sb;
 		struct jffs2_sb_info	jffs2_sb;
 		void			*generic_sbp;
 	} u;
diff -urN linux-2.5.7-pre1/include/linux/ncp_fs.h linux/include/linux/ncp_fs.h
--- linux-2.5.7-pre1/include/linux/ncp_fs.h	Thu Mar  7 21:18:17 2002
+++ linux/include/linux/ncp_fs.h	Tue Mar 12 17:44:20 2002
@@ -13,6 +13,7 @@
 #include <linux/types.h>
 
 #include <linux/ncp_fs_i.h>
+#include <linux/ncp_fs_sb.h>
 #include <linux/ipx.h>
 #include <linux/ncp_no.h>
 
@@ -190,7 +191,10 @@
 #define NCP_SUPER_MAGIC  0x564c
 
 
-#define NCP_SBP(sb)		(&((sb)->u.ncpfs_sb))
+static inline struct ncp_server *NCP_SBP(struct super_block *sb)
+{
+	return sb->u.generic_sbp;
+}
 
 #define NCP_SERVER(inode)	NCP_SBP((inode)->i_sb)
 static inline struct ncp_inode_info *NCP_FINFO(struct inode *inode)
diff -urN linux-2.5.7-pre1/include/linux/ncp_fs_sb.h linux/include/linux/ncp_fs_sb.h
--- linux-2.5.7-pre1/include/linux/ncp_fs_sb.h	Tue Mar 12 13:53:06 2002
+++ linux/include/linux/ncp_fs_sb.h	Tue Mar 12 17:43:57 2002
@@ -81,8 +81,6 @@
 	unsigned int flags;
 };
 
-#define ncp_sb_info	ncp_server
-
 #define NCP_FLAG_UTF8	1
 
 #define NCP_CLR_FLAG(server, flag)	((server)->flags &= ~(flag))

                 reply	other threads:[~2002-03-12 22:57 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=3C8E8794.5060903@didntduck.org \
    --to=bgerst@didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=vandrove@vc.cvut.cz \
    --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