diff options
author | David S. Miller <davem@davemloft.net> | 2008-10-31 03:17:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 03:17:34 -0400 |
commit | a1744d3bee19d3b9cbfb825ab316a101b9c9f109 (patch) | |
tree | c0e2324c09beca0eb5782eb5abf241ea2b7a4a11 /fs | |
parent | 275f165fa970174f8a98205529750e8abb6c0a33 (diff) | |
parent | a432226614c5616e3cfd211e0acffa0acfb4770c (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/p54/p54common.c
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ecryptfs/crypto.c | 15 | ||||
-rw-r--r-- | fs/fat/inode.c | 2 | ||||
-rw-r--r-- | fs/jbd/transaction.c | 1 | ||||
-rw-r--r-- | fs/libfs.c | 2 | ||||
-rw-r--r-- | fs/nfs/inode.c | 11 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 3 | ||||
-rw-r--r-- | fs/splice.c | 4 |
7 files changed, 16 insertions, 22 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 06db79d05c12..6046239465a1 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -1251,6 +1251,7 @@ struct kmem_cache *ecryptfs_header_cache_2; | |||
1251 | /** | 1251 | /** |
1252 | * ecryptfs_write_headers_virt | 1252 | * ecryptfs_write_headers_virt |
1253 | * @page_virt: The virtual address to write the headers to | 1253 | * @page_virt: The virtual address to write the headers to |
1254 | * @max: The size of memory allocated at page_virt | ||
1254 | * @size: Set to the number of bytes written by this function | 1255 | * @size: Set to the number of bytes written by this function |
1255 | * @crypt_stat: The cryptographic context | 1256 | * @crypt_stat: The cryptographic context |
1256 | * @ecryptfs_dentry: The eCryptfs dentry | 1257 | * @ecryptfs_dentry: The eCryptfs dentry |
@@ -1278,7 +1279,8 @@ struct kmem_cache *ecryptfs_header_cache_2; | |||
1278 | * | 1279 | * |
1279 | * Returns zero on success | 1280 | * Returns zero on success |
1280 | */ | 1281 | */ |
1281 | static int ecryptfs_write_headers_virt(char *page_virt, size_t *size, | 1282 | static int ecryptfs_write_headers_virt(char *page_virt, size_t max, |
1283 | size_t *size, | ||
1282 | struct ecryptfs_crypt_stat *crypt_stat, | 1284 | struct ecryptfs_crypt_stat *crypt_stat, |
1283 | struct dentry *ecryptfs_dentry) | 1285 | struct dentry *ecryptfs_dentry) |
1284 | { | 1286 | { |
@@ -1296,7 +1298,7 @@ static int ecryptfs_write_headers_virt(char *page_virt, size_t *size, | |||
1296 | offset += written; | 1298 | offset += written; |
1297 | rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, | 1299 | rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, |
1298 | ecryptfs_dentry, &written, | 1300 | ecryptfs_dentry, &written, |
1299 | PAGE_CACHE_SIZE - offset); | 1301 | max - offset); |
1300 | if (rc) | 1302 | if (rc) |
1301 | ecryptfs_printk(KERN_WARNING, "Error generating key packet " | 1303 | ecryptfs_printk(KERN_WARNING, "Error generating key packet " |
1302 | "set; rc = [%d]\n", rc); | 1304 | "set; rc = [%d]\n", rc); |
@@ -1368,14 +1370,14 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) | |||
1368 | goto out; | 1370 | goto out; |
1369 | } | 1371 | } |
1370 | /* Released in this function */ | 1372 | /* Released in this function */ |
1371 | virt = kzalloc(crypt_stat->num_header_bytes_at_front, GFP_KERNEL); | 1373 | virt = (char *)get_zeroed_page(GFP_KERNEL); |
1372 | if (!virt) { | 1374 | if (!virt) { |
1373 | printk(KERN_ERR "%s: Out of memory\n", __func__); | 1375 | printk(KERN_ERR "%s: Out of memory\n", __func__); |
1374 | rc = -ENOMEM; | 1376 | rc = -ENOMEM; |
1375 | goto out; | 1377 | goto out; |
1376 | } | 1378 | } |
1377 | rc = ecryptfs_write_headers_virt(virt, &size, crypt_stat, | 1379 | rc = ecryptfs_write_headers_virt(virt, PAGE_CACHE_SIZE, &size, |
1378 | ecryptfs_dentry); | 1380 | crypt_stat, ecryptfs_dentry); |
1379 | if (unlikely(rc)) { | 1381 | if (unlikely(rc)) { |
1380 | printk(KERN_ERR "%s: Error whilst writing headers; rc = [%d]\n", | 1382 | printk(KERN_ERR "%s: Error whilst writing headers; rc = [%d]\n", |
1381 | __func__, rc); | 1383 | __func__, rc); |
@@ -1393,8 +1395,7 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) | |||
1393 | goto out_free; | 1395 | goto out_free; |
1394 | } | 1396 | } |
1395 | out_free: | 1397 | out_free: |
1396 | memset(virt, 0, crypt_stat->num_header_bytes_at_front); | 1398 | free_page((unsigned long)virt); |
1397 | kfree(virt); | ||
1398 | out: | 1399 | out: |
1399 | return rc; | 1400 | return rc; |
1400 | } | 1401 | } |
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 19eafbe3c379..2b2eec1283bf 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -175,7 +175,7 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, | |||
175 | 175 | ||
176 | if (rw == WRITE) { | 176 | if (rw == WRITE) { |
177 | /* | 177 | /* |
178 | * FIXME: blockdev_direct_IO() doesn't use ->prepare_write(), | 178 | * FIXME: blockdev_direct_IO() doesn't use ->write_begin(), |
179 | * so we need to update the ->mmu_private to block boundary. | 179 | * so we need to update the ->mmu_private to block boundary. |
180 | * | 180 | * |
181 | * But we must fill the remaining area or hole by nul for | 181 | * But we must fill the remaining area or hole by nul for |
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index d15cd6e7251e..60d4c32c8808 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c | |||
@@ -860,7 +860,6 @@ out: | |||
860 | * int journal_get_undo_access() - Notify intent to modify metadata with non-rewindable consequences | 860 | * int journal_get_undo_access() - Notify intent to modify metadata with non-rewindable consequences |
861 | * @handle: transaction | 861 | * @handle: transaction |
862 | * @bh: buffer to undo | 862 | * @bh: buffer to undo |
863 | * @credits: store the number of taken credits here (if not NULL) | ||
864 | * | 863 | * |
865 | * Sometimes there is a need to distinguish between metadata which has | 864 | * Sometimes there is a need to distinguish between metadata which has |
866 | * been committed to disk and that which has not. The ext3fs code uses | 865 | * been committed to disk and that which has not. The ext3fs code uses |
diff --git a/fs/libfs.c b/fs/libfs.c index 74688598bcf7..e960a8321902 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
@@ -814,7 +814,7 @@ EXPORT_SYMBOL(simple_getattr); | |||
814 | EXPORT_SYMBOL(simple_link); | 814 | EXPORT_SYMBOL(simple_link); |
815 | EXPORT_SYMBOL(simple_lookup); | 815 | EXPORT_SYMBOL(simple_lookup); |
816 | EXPORT_SYMBOL(simple_pin_fs); | 816 | EXPORT_SYMBOL(simple_pin_fs); |
817 | EXPORT_SYMBOL(simple_prepare_write); | 817 | EXPORT_UNUSED_SYMBOL(simple_prepare_write); |
818 | EXPORT_SYMBOL(simple_readpage); | 818 | EXPORT_SYMBOL(simple_readpage); |
819 | EXPORT_SYMBOL(simple_release_fs); | 819 | EXPORT_SYMBOL(simple_release_fs); |
820 | EXPORT_SYMBOL(simple_rename); | 820 | EXPORT_SYMBOL(simple_rename); |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index dc52793ff8f8..d22eb383e1cf 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -908,21 +908,16 @@ static int nfs_size_need_update(const struct inode *inode, const struct nfs_fatt | |||
908 | return nfs_size_to_loff_t(fattr->size) > i_size_read(inode); | 908 | return nfs_size_to_loff_t(fattr->size) > i_size_read(inode); |
909 | } | 909 | } |
910 | 910 | ||
911 | static unsigned long nfs_attr_generation_counter; | 911 | static atomic_long_t nfs_attr_generation_counter; |
912 | 912 | ||
913 | static unsigned long nfs_read_attr_generation_counter(void) | 913 | static unsigned long nfs_read_attr_generation_counter(void) |
914 | { | 914 | { |
915 | smp_rmb(); | 915 | return atomic_long_read(&nfs_attr_generation_counter); |
916 | return nfs_attr_generation_counter; | ||
917 | } | 916 | } |
918 | 917 | ||
919 | unsigned long nfs_inc_attr_generation_counter(void) | 918 | unsigned long nfs_inc_attr_generation_counter(void) |
920 | { | 919 | { |
921 | unsigned long ret; | 920 | return atomic_long_inc_return(&nfs_attr_generation_counter); |
922 | smp_rmb(); | ||
923 | ret = ++nfs_attr_generation_counter; | ||
924 | smp_wmb(); | ||
925 | return ret; | ||
926 | } | 921 | } |
927 | 922 | ||
928 | void nfs_fattr_init(struct nfs_fattr *fattr) | 923 | void nfs_fattr_init(struct nfs_fattr *fattr) |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 8d3225a78073..7efe937a415f 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -679,8 +679,7 @@ leave: | |||
679 | 679 | ||
680 | /* Some parts of this taken from generic_cont_expand, which turned out | 680 | /* Some parts of this taken from generic_cont_expand, which turned out |
681 | * to be too fragile to do exactly what we need without us having to | 681 | * to be too fragile to do exactly what we need without us having to |
682 | * worry about recursive locking in ->prepare_write() and | 682 | * worry about recursive locking in ->write_begin() and ->write_end(). */ |
683 | * ->commit_write(). */ | ||
684 | static int ocfs2_write_zero_page(struct inode *inode, | 683 | static int ocfs2_write_zero_page(struct inode *inode, |
685 | u64 size) | 684 | u64 size) |
686 | { | 685 | { |
diff --git a/fs/splice.c b/fs/splice.c index a1e701c27156..1abab5cee4ba 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -731,8 +731,8 @@ ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out, | |||
731 | }; | 731 | }; |
732 | 732 | ||
733 | /* | 733 | /* |
734 | * The actor worker might be calling ->prepare_write and | 734 | * The actor worker might be calling ->write_begin and |
735 | * ->commit_write. Most of the time, these expect i_mutex to | 735 | * ->write_end. Most of the time, these expect i_mutex to |
736 | * be held. Since this may result in an ABBA deadlock with | 736 | * be held. Since this may result in an ABBA deadlock with |
737 | * pipe->inode, we have to order lock acquiry here. | 737 | * pipe->inode, we have to order lock acquiry here. |
738 | */ | 738 | */ |