All of lore.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>, bfennema@calpoly.edu
Subject: [PATCH] struct super_block cleanup - udf
Date: Sun, 17 Mar 2002 10:20:05 -0500	[thread overview]
Message-ID: <3C94B425.2000603@didntduck.org> (raw)

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

Seperates udf_sb_info from struct super_block.

-- 

						Brian Gerst

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

diff -urN linux-2.5.7-pre2/fs/udf/super.c linux/fs/udf/super.c
--- linux-2.5.7-pre2/fs/udf/super.c	Sat Mar 16 00:17:33 2002
+++ linux/fs/udf/super.c	Sat Mar 16 01:09:32 2002
@@ -1413,12 +1413,17 @@
 	struct inode *inode=NULL;
 	struct udf_options uopt;
 	lb_addr rootdir, fileset;
+	struct udf_sb_info *sbi;
 
 	uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT);
 	uopt.uid = -1;
 	uopt.gid = -1;
 	uopt.umask = 0;
 
+	sbi = kmalloc(sizeof(struct udf_sb_info), GFP_KERNEL);
+	if (!sbi)
+		return -ENOMEM;
+	sb->u.generic_sbp = sbi;
 	memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info));
 
 #if UDFFS_RW != 1
@@ -1607,6 +1612,8 @@
 		udf_close_lvid(sb);
 	udf_release_data(UDF_SB_LVIDBH(sb));
 	UDF_SB_FREE(sb);
+	kfree(sbi);
+	sb->u.generic_sbp = NULL;
 	return -EINVAL;
 }
 
@@ -1697,6 +1704,8 @@
 		udf_close_lvid(sb);
 	udf_release_data(UDF_SB_LVIDBH(sb));
 	UDF_SB_FREE(sb);
+	kfree(sb->u.generic_sbp);
+	sb->u.generic_sbp = NULL;
 }
 
 /*
diff -urN linux-2.5.7-pre2/fs/udf/udf_sb.h linux/fs/udf/udf_sb.h
--- linux-2.5.7-pre2/fs/udf/udf_sb.h	Sat Mar 16 00:17:33 2002
+++ linux/fs/udf/udf_sb.h	Sat Mar 16 01:18:22 2002
@@ -30,6 +30,11 @@
 #define UDF_PART_FLAG_REWRITABLE	0x0040
 #define UDF_PART_FLAG_OVERWRITABLE	0x0080
 
+static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
+{
+	return sb->u.generic_sbp;
+}
+
 #define UDF_SB_FREE(X)\
 {\
 	if (UDF_SB(X))\
@@ -39,7 +44,6 @@
 		UDF_SB_PARTMAPS(X) = NULL;\
 	}\
 }
-#define UDF_SB(X)	(&((X)->u.udf_sb))
 
 #define UDF_SB_ALLOC_PARTMAPS(X,Y)\
 {\
diff -urN linux-2.5.7-pre2/fs/udf/udfdecl.h linux/fs/udf/udfdecl.h
--- linux-2.5.7-pre2/fs/udf/udfdecl.h	Sat Mar 16 00:17:33 2002
+++ linux/fs/udf/udfdecl.h	Sat Mar 16 01:16:39 2002
@@ -8,6 +8,8 @@
 #include <linux/fs.h>
 #include <linux/config.h>
 #include <linux/types.h>
+#include <linux/udf_fs_i.h>
+#include <linux/udf_fs_sb.h>
 
 #ifndef LINUX_VERSION_CODE
 #include <linux/version.h>
@@ -15,8 +17,6 @@
 
 #if !defined(CONFIG_UDF_FS) && !defined(CONFIG_UDF_FS_MODULE)
 #define CONFIG_UDF_FS_MODULE
-#include <linux/udf_fs_i.h>
-#include <linux/udf_fs_sb.h>
 #endif
 
 #include "udfend.h"
diff -urN linux-2.5.7-pre2/include/linux/fs.h linux/include/linux/fs.h
--- linux-2.5.7-pre2/include/linux/fs.h	Sat Mar 16 00:17:34 2002
+++ linux/include/linux/fs.h	Sat Mar 16 01:12:41 2002
@@ -657,7 +657,6 @@
 #include <linux/adfs_fs_sb.h>
 #include <linux/reiserfs_fs_sb.h>
 #include <linux/bfs_fs_sb.h>
-#include <linux/udf_fs_sb.h>
 #include <linux/jffs2_fs_sb.h>
 
 extern struct list_head super_blocks;
@@ -707,7 +706,6 @@
 		struct adfs_sb_info	adfs_sb;
 		struct reiserfs_sb_info	reiserfs_sb;
 		struct bfs_sb_info	bfs_sb;
-		struct udf_sb_info	udf_sb;
 		struct jffs2_sb_info	jffs2_sb;
 		void			*generic_sbp;
 	} u;

                 reply	other threads:[~2002-03-17 15:21 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=3C94B425.2000603@didntduck.org \
    --to=bgerst@didntduck.org \
    --cc=bfennema@calpoly.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.