Commit 27033215 authored by Brian Gerst's avatar Brian Gerst Committed by Linus Torvalds

[PATCH] struct super_block cleanup - udf

Seperates udf_sb_info from struct super_block.
parent 7d42ccf3
...@@ -1413,12 +1413,17 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -1413,12 +1413,17 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
struct inode *inode=NULL; struct inode *inode=NULL;
struct udf_options uopt; struct udf_options uopt;
lb_addr rootdir, fileset; lb_addr rootdir, fileset;
struct udf_sb_info *sbi;
uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT); uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT);
uopt.uid = -1; uopt.uid = -1;
uopt.gid = -1; uopt.gid = -1;
uopt.umask = 0; 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)); memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info));
#if UDFFS_RW != 1 #if UDFFS_RW != 1
...@@ -1607,6 +1612,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -1607,6 +1612,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
udf_close_lvid(sb); udf_close_lvid(sb);
udf_release_data(UDF_SB_LVIDBH(sb)); udf_release_data(UDF_SB_LVIDBH(sb));
UDF_SB_FREE(sb); UDF_SB_FREE(sb);
kfree(sbi);
sb->u.generic_sbp = NULL;
return -EINVAL; return -EINVAL;
} }
...@@ -1697,6 +1704,8 @@ udf_put_super(struct super_block *sb) ...@@ -1697,6 +1704,8 @@ udf_put_super(struct super_block *sb)
udf_close_lvid(sb); udf_close_lvid(sb);
udf_release_data(UDF_SB_LVIDBH(sb)); udf_release_data(UDF_SB_LVIDBH(sb));
UDF_SB_FREE(sb); UDF_SB_FREE(sb);
kfree(sb->u.generic_sbp);
sb->u.generic_sbp = NULL;
} }
/* /*
......
...@@ -30,6 +30,11 @@ ...@@ -30,6 +30,11 @@
#define UDF_PART_FLAG_REWRITABLE 0x0040 #define UDF_PART_FLAG_REWRITABLE 0x0040
#define UDF_PART_FLAG_OVERWRITABLE 0x0080 #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)\ #define UDF_SB_FREE(X)\
{\ {\
if (UDF_SB(X))\ if (UDF_SB(X))\
...@@ -39,7 +44,6 @@ ...@@ -39,7 +44,6 @@
UDF_SB_PARTMAPS(X) = NULL;\ UDF_SB_PARTMAPS(X) = NULL;\
}\ }\
} }
#define UDF_SB(X) (&((X)->u.udf_sb))
#define UDF_SB_ALLOC_PARTMAPS(X,Y)\ #define UDF_SB_ALLOC_PARTMAPS(X,Y)\
{\ {\
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/udf_fs_i.h>
#include <linux/udf_fs_sb.h>
#ifndef LINUX_VERSION_CODE #ifndef LINUX_VERSION_CODE
#include <linux/version.h> #include <linux/version.h>
...@@ -15,8 +17,6 @@ ...@@ -15,8 +17,6 @@
#if !defined(CONFIG_UDF_FS) && !defined(CONFIG_UDF_FS_MODULE) #if !defined(CONFIG_UDF_FS) && !defined(CONFIG_UDF_FS_MODULE)
#define CONFIG_UDF_FS_MODULE #define CONFIG_UDF_FS_MODULE
#include <linux/udf_fs_i.h>
#include <linux/udf_fs_sb.h>
#endif #endif
#include "udfend.h" #include "udfend.h"
......
...@@ -656,7 +656,6 @@ struct quota_mount_options ...@@ -656,7 +656,6 @@ struct quota_mount_options
#include <linux/adfs_fs_sb.h> #include <linux/adfs_fs_sb.h>
#include <linux/reiserfs_fs_sb.h> #include <linux/reiserfs_fs_sb.h>
#include <linux/bfs_fs_sb.h> #include <linux/bfs_fs_sb.h>
#include <linux/udf_fs_sb.h>
#include <linux/jffs2_fs_sb.h> #include <linux/jffs2_fs_sb.h>
extern struct list_head super_blocks; extern struct list_head super_blocks;
...@@ -705,7 +704,6 @@ struct super_block { ...@@ -705,7 +704,6 @@ struct super_block {
struct adfs_sb_info adfs_sb; struct adfs_sb_info adfs_sb;
struct reiserfs_sb_info reiserfs_sb; struct reiserfs_sb_info reiserfs_sb;
struct bfs_sb_info bfs_sb; struct bfs_sb_info bfs_sb;
struct udf_sb_info udf_sb;
struct jffs2_sb_info jffs2_sb; struct jffs2_sb_info jffs2_sb;
void *generic_sbp; void *generic_sbp;
} u; } u;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment