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

[PATCH] struct super_block cleanup - ncpfs

Seperates ncp_sb_info from struct super_block.
parent dbd6e343
...@@ -315,6 +315,10 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) ...@@ -315,6 +315,10 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
#endif #endif
struct ncp_entry_info finfo; struct ncp_entry_info finfo;
server = kmalloc(sizeof(struct ncp_server), GFP_KERNEL);
if (!server)
return -ENOMEM;
sb->u.generic_sbp = server;
error = -EFAULT; error = -EFAULT;
if (raw_data == NULL) if (raw_data == NULL)
goto out; goto out;
...@@ -520,6 +524,8 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) ...@@ -520,6 +524,8 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
*/ */
fput(ncp_filp); fput(ncp_filp);
out: out:
sb->u.generic_sbp = NULL;
kfree(server);
return error; return error;
} }
...@@ -553,7 +559,8 @@ static void ncp_put_super(struct super_block *sb) ...@@ -553,7 +559,8 @@ static void ncp_put_super(struct super_block *sb)
if (server->auth.object_name) if (server->auth.object_name)
ncp_kfree_s(server->auth.object_name, server->auth.object_name_len); ncp_kfree_s(server->auth.object_name, server->auth.object_name_len);
vfree(server->packet); vfree(server->packet);
sb->u.generic_sbp = NULL;
kfree(server);
} }
static int ncp_statfs(struct super_block *sb, struct statfs *buf) static int ncp_statfs(struct super_block *sb, struct statfs *buf)
......
...@@ -667,7 +667,6 @@ struct quota_mount_options ...@@ -667,7 +667,6 @@ struct quota_mount_options
#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/udf_fs_sb.h>
#include <linux/ncp_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;
...@@ -724,7 +723,6 @@ struct super_block { ...@@ -724,7 +723,6 @@ struct super_block {
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 udf_sb_info udf_sb;
struct ncp_sb_info ncpfs_sb;
struct jffs2_sb_info jffs2_sb; struct jffs2_sb_info jffs2_sb;
void *generic_sbp; void *generic_sbp;
} u; } u;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/ncp_fs_i.h> #include <linux/ncp_fs_i.h>
#include <linux/ncp_fs_sb.h>
#include <linux/ipx.h> #include <linux/ipx.h>
#include <linux/ncp_no.h> #include <linux/ncp_no.h>
...@@ -190,7 +191,10 @@ struct ncp_entry_info { ...@@ -190,7 +191,10 @@ struct ncp_entry_info {
#define NCP_SUPER_MAGIC 0x564c #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) #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb)
static inline struct ncp_inode_info *NCP_FINFO(struct inode *inode) static inline struct ncp_inode_info *NCP_FINFO(struct inode *inode)
......
...@@ -81,8 +81,6 @@ struct ncp_server { ...@@ -81,8 +81,6 @@ struct ncp_server {
unsigned int flags; unsigned int flags;
}; };
#define ncp_sb_info ncp_server
#define NCP_FLAG_UTF8 1 #define NCP_FLAG_UTF8 1
#define NCP_CLR_FLAG(server, flag) ((server)->flags &= ~(flag)) #define NCP_CLR_FLAG(server, flag) ((server)->flags &= ~(flag))
......
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