diff options
author | Steve French <sfrench@us.ibm.com> | 2006-03-30 22:35:56 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-03-30 22:35:56 -0500 |
commit | d62e54abca1146981fc9f98f85ff398a113a22c2 (patch) | |
tree | 870420dbc4c65e716dcef8a802aafdc0ef97a8b4 /fs/jffs2 | |
parent | fd4a0b92db6a57cba8d03efbe1cebf91f9124ce0 (diff) | |
parent | ce362c009250340358a7221f3cdb7954cbf19c01 (diff) |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/compr_zlib.c | 19 | ||||
-rw-r--r-- | fs/jffs2/dir.c | 2 | ||||
-rw-r--r-- | fs/jffs2/file.c | 2 | ||||
-rw-r--r-- | fs/jffs2/os-linux.h | 4 | ||||
-rw-r--r-- | fs/jffs2/super.c | 7 |
5 files changed, 18 insertions, 16 deletions
diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c index 4db8be8e90cc..5c63e0cdcf4c 100644 --- a/fs/jffs2/compr_zlib.c +++ b/fs/jffs2/compr_zlib.c | |||
@@ -33,13 +33,14 @@ | |||
33 | */ | 33 | */ |
34 | #define STREAM_END_SPACE 12 | 34 | #define STREAM_END_SPACE 12 |
35 | 35 | ||
36 | static DECLARE_MUTEX(deflate_sem); | 36 | static DEFINE_MUTEX(deflate_mutex); |
37 | static DECLARE_MUTEX(inflate_sem); | 37 | static DEFINE_MUTEX(inflate_mutex); |
38 | static z_stream inf_strm, def_strm; | 38 | static z_stream inf_strm, def_strm; |
39 | 39 | ||
40 | #ifdef __KERNEL__ /* Linux-only */ | 40 | #ifdef __KERNEL__ /* Linux-only */ |
41 | #include <linux/vmalloc.h> | 41 | #include <linux/vmalloc.h> |
42 | #include <linux/init.h> | 42 | #include <linux/init.h> |
43 | #include <linux/mutex.h> | ||
43 | 44 | ||
44 | static int __init alloc_workspaces(void) | 45 | static int __init alloc_workspaces(void) |
45 | { | 46 | { |
@@ -79,11 +80,11 @@ static int jffs2_zlib_compress(unsigned char *data_in, | |||
79 | if (*dstlen <= STREAM_END_SPACE) | 80 | if (*dstlen <= STREAM_END_SPACE) |
80 | return -1; | 81 | return -1; |
81 | 82 | ||
82 | down(&deflate_sem); | 83 | mutex_lock(&deflate_mutex); |
83 | 84 | ||
84 | if (Z_OK != zlib_deflateInit(&def_strm, 3)) { | 85 | if (Z_OK != zlib_deflateInit(&def_strm, 3)) { |
85 | printk(KERN_WARNING "deflateInit failed\n"); | 86 | printk(KERN_WARNING "deflateInit failed\n"); |
86 | up(&deflate_sem); | 87 | mutex_unlock(&deflate_mutex); |
87 | return -1; | 88 | return -1; |
88 | } | 89 | } |
89 | 90 | ||
@@ -104,7 +105,7 @@ static int jffs2_zlib_compress(unsigned char *data_in, | |||
104 | if (ret != Z_OK) { | 105 | if (ret != Z_OK) { |
105 | D1(printk(KERN_DEBUG "deflate in loop returned %d\n", ret)); | 106 | D1(printk(KERN_DEBUG "deflate in loop returned %d\n", ret)); |
106 | zlib_deflateEnd(&def_strm); | 107 | zlib_deflateEnd(&def_strm); |
107 | up(&deflate_sem); | 108 | mutex_unlock(&deflate_mutex); |
108 | return -1; | 109 | return -1; |
109 | } | 110 | } |
110 | } | 111 | } |
@@ -133,7 +134,7 @@ static int jffs2_zlib_compress(unsigned char *data_in, | |||
133 | *sourcelen = def_strm.total_in; | 134 | *sourcelen = def_strm.total_in; |
134 | ret = 0; | 135 | ret = 0; |
135 | out: | 136 | out: |
136 | up(&deflate_sem); | 137 | mutex_unlock(&deflate_mutex); |
137 | return ret; | 138 | return ret; |
138 | } | 139 | } |
139 | 140 | ||
@@ -145,7 +146,7 @@ static int jffs2_zlib_decompress(unsigned char *data_in, | |||
145 | int ret; | 146 | int ret; |
146 | int wbits = MAX_WBITS; | 147 | int wbits = MAX_WBITS; |
147 | 148 | ||
148 | down(&inflate_sem); | 149 | mutex_lock(&inflate_mutex); |
149 | 150 | ||
150 | inf_strm.next_in = data_in; | 151 | inf_strm.next_in = data_in; |
151 | inf_strm.avail_in = srclen; | 152 | inf_strm.avail_in = srclen; |
@@ -173,7 +174,7 @@ static int jffs2_zlib_decompress(unsigned char *data_in, | |||
173 | 174 | ||
174 | if (Z_OK != zlib_inflateInit2(&inf_strm, wbits)) { | 175 | if (Z_OK != zlib_inflateInit2(&inf_strm, wbits)) { |
175 | printk(KERN_WARNING "inflateInit failed\n"); | 176 | printk(KERN_WARNING "inflateInit failed\n"); |
176 | up(&inflate_sem); | 177 | mutex_unlock(&inflate_mutex); |
177 | return 1; | 178 | return 1; |
178 | } | 179 | } |
179 | 180 | ||
@@ -183,7 +184,7 @@ static int jffs2_zlib_decompress(unsigned char *data_in, | |||
183 | printk(KERN_NOTICE "inflate returned %d\n", ret); | 184 | printk(KERN_NOTICE "inflate returned %d\n", ret); |
184 | } | 185 | } |
185 | zlib_inflateEnd(&inf_strm); | 186 | zlib_inflateEnd(&inf_strm); |
186 | up(&inflate_sem); | 187 | mutex_unlock(&inflate_mutex); |
187 | return 0; | 188 | return 0; |
188 | } | 189 | } |
189 | 190 | ||
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index a7bf9cb2567f..8bc7a5018e40 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -37,7 +37,7 @@ static int jffs2_mknod (struct inode *,struct dentry *,int,dev_t); | |||
37 | static int jffs2_rename (struct inode *, struct dentry *, | 37 | static int jffs2_rename (struct inode *, struct dentry *, |
38 | struct inode *, struct dentry *); | 38 | struct inode *, struct dentry *); |
39 | 39 | ||
40 | struct file_operations jffs2_dir_operations = | 40 | const struct file_operations jffs2_dir_operations = |
41 | { | 41 | { |
42 | .read = generic_read_dir, | 42 | .read = generic_read_dir, |
43 | .readdir = jffs2_readdir, | 43 | .readdir = jffs2_readdir, |
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 935f273dc57b..9f4171213e58 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
@@ -38,7 +38,7 @@ int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync) | |||
38 | return 0; | 38 | return 0; |
39 | } | 39 | } |
40 | 40 | ||
41 | struct file_operations jffs2_file_operations = | 41 | const struct file_operations jffs2_file_operations = |
42 | { | 42 | { |
43 | .llseek = generic_file_llseek, | 43 | .llseek = generic_file_llseek, |
44 | .open = generic_file_open, | 44 | .open = generic_file_open, |
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 59e7a393200c..d307cf548625 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h | |||
@@ -159,11 +159,11 @@ void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c); | |||
159 | void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); | 159 | void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); |
160 | 160 | ||
161 | /* dir.c */ | 161 | /* dir.c */ |
162 | extern struct file_operations jffs2_dir_operations; | 162 | extern const struct file_operations jffs2_dir_operations; |
163 | extern struct inode_operations jffs2_dir_inode_operations; | 163 | extern struct inode_operations jffs2_dir_inode_operations; |
164 | 164 | ||
165 | /* file.c */ | 165 | /* file.c */ |
166 | extern struct file_operations jffs2_file_operations; | 166 | extern const struct file_operations jffs2_file_operations; |
167 | extern struct inode_operations jffs2_file_inode_operations; | 167 | extern struct inode_operations jffs2_file_inode_operations; |
168 | extern struct address_space_operations jffs2_file_address_operations; | 168 | extern struct address_space_operations jffs2_file_address_operations; |
169 | int jffs2_fsync(struct file *, struct dentry *, int); | 169 | int jffs2_fsync(struct file *, struct dentry *, int); |
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 93883817cbd0..ffd8e84b22cc 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c | |||
@@ -152,7 +152,7 @@ static struct super_block *jffs2_get_sb_mtd(struct file_system_type *fs_type, | |||
152 | sb->s_op = &jffs2_super_operations; | 152 | sb->s_op = &jffs2_super_operations; |
153 | sb->s_flags = flags | MS_NOATIME; | 153 | sb->s_flags = flags | MS_NOATIME; |
154 | 154 | ||
155 | ret = jffs2_do_fill_super(sb, data, (flags&MS_VERBOSE)?1:0); | 155 | ret = jffs2_do_fill_super(sb, data, flags & MS_SILENT ? 1 : 0); |
156 | 156 | ||
157 | if (ret) { | 157 | if (ret) { |
158 | /* Failure case... */ | 158 | /* Failure case... */ |
@@ -257,7 +257,7 @@ static struct super_block *jffs2_get_sb(struct file_system_type *fs_type, | |||
257 | } | 257 | } |
258 | 258 | ||
259 | if (imajor(nd.dentry->d_inode) != MTD_BLOCK_MAJOR) { | 259 | if (imajor(nd.dentry->d_inode) != MTD_BLOCK_MAJOR) { |
260 | if (!(flags & MS_VERBOSE)) /* Yes I mean this. Strangely */ | 260 | if (!(flags & MS_SILENT)) |
261 | printk(KERN_NOTICE "Attempt to mount non-MTD device \"%s\" as JFFS2\n", | 261 | printk(KERN_NOTICE "Attempt to mount non-MTD device \"%s\" as JFFS2\n", |
262 | dev_name); | 262 | dev_name); |
263 | goto out; | 263 | goto out; |
@@ -331,7 +331,8 @@ static int __init init_jffs2_fs(void) | |||
331 | 331 | ||
332 | jffs2_inode_cachep = kmem_cache_create("jffs2_i", | 332 | jffs2_inode_cachep = kmem_cache_create("jffs2_i", |
333 | sizeof(struct jffs2_inode_info), | 333 | sizeof(struct jffs2_inode_info), |
334 | 0, SLAB_RECLAIM_ACCOUNT, | 334 | 0, (SLAB_RECLAIM_ACCOUNT| |
335 | SLAB_MEM_SPREAD), | ||
335 | jffs2_i_init_once, NULL); | 336 | jffs2_i_init_once, NULL); |
336 | if (!jffs2_inode_cachep) { | 337 | if (!jffs2_inode_cachep) { |
337 | printk(KERN_ERR "JFFS2 error: Failed to initialise inode cache\n"); | 338 | printk(KERN_ERR "JFFS2 error: Failed to initialise inode cache\n"); |