diff options
author | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
commit | cb5629b10d64a8006622ce3a52bc887d91057d69 (patch) | |
tree | 7c06d8f30783115e3384721046258ce615b129c5 /fs/ubifs/compress.c | |
parent | 8920d5ad6ba74ae8ab020e90cc4d976980e68701 (diff) | |
parent | f01d1d546abb2f4028b5299092f529eefb01253a (diff) |
Merge branch 'master' into next
Conflicts:
fs/namei.c
Manually merged per:
diff --cc fs/namei.c
index 734f2b5,bbc15c2..0000000
--- a/fs/namei.c
+++ b/fs/namei.c
@@@ -860,9 -848,8 +849,10 @@@ static int __link_path_walk(const char
nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
- err = vfs_permission(nd, MAY_EXEC);
+ err = inode_permission(nd->path.dentry->d_inode,
+ MAY_EXEC);
+ if (!err)
+ err = ima_path_check(&nd->path, MAY_EXEC);
if (err)
break;
@@@ -1525,14 -1506,9 +1509,14 @@@ int may_open(struct path *path, int acc
flag &= ~O_TRUNC;
}
- error = vfs_permission(nd, acc_mode);
+ error = inode_permission(inode, acc_mode);
if (error)
return error;
+
- error = ima_path_check(&nd->path,
++ error = ima_path_check(path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
+ if (error)
+ return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/ubifs/compress.c')
-rw-r--r-- | fs/ubifs/compress.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/ubifs/compress.c b/fs/ubifs/compress.c index a0ada596b17c..11e4132f314a 100644 --- a/fs/ubifs/compress.c +++ b/fs/ubifs/compress.c | |||
@@ -33,7 +33,7 @@ | |||
33 | /* Fake description object for the "none" compressor */ | 33 | /* Fake description object for the "none" compressor */ |
34 | static struct ubifs_compressor none_compr = { | 34 | static struct ubifs_compressor none_compr = { |
35 | .compr_type = UBIFS_COMPR_NONE, | 35 | .compr_type = UBIFS_COMPR_NONE, |
36 | .name = "no compression", | 36 | .name = "none", |
37 | .capi_name = "", | 37 | .capi_name = "", |
38 | }; | 38 | }; |
39 | 39 | ||
@@ -43,13 +43,13 @@ static DEFINE_MUTEX(lzo_mutex); | |||
43 | static struct ubifs_compressor lzo_compr = { | 43 | static struct ubifs_compressor lzo_compr = { |
44 | .compr_type = UBIFS_COMPR_LZO, | 44 | .compr_type = UBIFS_COMPR_LZO, |
45 | .comp_mutex = &lzo_mutex, | 45 | .comp_mutex = &lzo_mutex, |
46 | .name = "LZO", | 46 | .name = "lzo", |
47 | .capi_name = "lzo", | 47 | .capi_name = "lzo", |
48 | }; | 48 | }; |
49 | #else | 49 | #else |
50 | static struct ubifs_compressor lzo_compr = { | 50 | static struct ubifs_compressor lzo_compr = { |
51 | .compr_type = UBIFS_COMPR_LZO, | 51 | .compr_type = UBIFS_COMPR_LZO, |
52 | .name = "LZO", | 52 | .name = "lzo", |
53 | }; | 53 | }; |
54 | #endif | 54 | #endif |
55 | 55 | ||
@@ -108,7 +108,7 @@ void ubifs_compress(const void *in_buf, int in_len, void *out_buf, int *out_len, | |||
108 | if (compr->comp_mutex) | 108 | if (compr->comp_mutex) |
109 | mutex_lock(compr->comp_mutex); | 109 | mutex_lock(compr->comp_mutex); |
110 | err = crypto_comp_compress(compr->cc, in_buf, in_len, out_buf, | 110 | err = crypto_comp_compress(compr->cc, in_buf, in_len, out_buf, |
111 | out_len); | 111 | (unsigned int *)out_len); |
112 | if (compr->comp_mutex) | 112 | if (compr->comp_mutex) |
113 | mutex_unlock(compr->comp_mutex); | 113 | mutex_unlock(compr->comp_mutex); |
114 | if (unlikely(err)) { | 114 | if (unlikely(err)) { |
@@ -119,10 +119,10 @@ void ubifs_compress(const void *in_buf, int in_len, void *out_buf, int *out_len, | |||
119 | } | 119 | } |
120 | 120 | ||
121 | /* | 121 | /* |
122 | * Presently, we just require that compression results in less data, | 122 | * If the data compressed only slightly, it is better to leave it |
123 | * rather than any defined minimum compression ratio or amount. | 123 | * uncompressed to improve read speed. |
124 | */ | 124 | */ |
125 | if (ALIGN(*out_len, 8) >= ALIGN(in_len, 8)) | 125 | if (in_len - *out_len < UBIFS_MIN_COMPRESS_DIFF) |
126 | goto no_compr; | 126 | goto no_compr; |
127 | 127 | ||
128 | return; | 128 | return; |
@@ -172,7 +172,7 @@ int ubifs_decompress(const void *in_buf, int in_len, void *out_buf, | |||
172 | if (compr->decomp_mutex) | 172 | if (compr->decomp_mutex) |
173 | mutex_lock(compr->decomp_mutex); | 173 | mutex_lock(compr->decomp_mutex); |
174 | err = crypto_comp_decompress(compr->cc, in_buf, in_len, out_buf, | 174 | err = crypto_comp_decompress(compr->cc, in_buf, in_len, out_buf, |
175 | out_len); | 175 | (unsigned int *)out_len); |
176 | if (compr->decomp_mutex) | 176 | if (compr->decomp_mutex) |
177 | mutex_unlock(compr->decomp_mutex); | 177 | mutex_unlock(compr->decomp_mutex); |
178 | if (err) | 178 | if (err) |
@@ -244,7 +244,7 @@ out_lzo: | |||
244 | /** | 244 | /** |
245 | * ubifs_compressors_exit - de-initialize UBIFS compressors. | 245 | * ubifs_compressors_exit - de-initialize UBIFS compressors. |
246 | */ | 246 | */ |
247 | void __exit ubifs_compressors_exit(void) | 247 | void ubifs_compressors_exit(void) |
248 | { | 248 | { |
249 | compr_exit(&lzo_compr); | 249 | compr_exit(&lzo_compr); |
250 | compr_exit(&zlib_compr); | 250 | compr_exit(&zlib_compr); |