summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-25 15:44:54 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-25 15:44:54 -0700
commit7f1495745347bc2cb9cc4f50d0a889caeb71f1f1 (patch)
tree2402b7e52fec57cdbf16d52e5fb467044589ec31 /fs
parent2c7505570353af02e48c58ab4d109edd9bbbdd81 (diff)
parent85cdffcde0b6b831a06422413300d0f5c0e608c3 (diff)
downloadblackbird-op-linux-7f1495745347bc2cb9cc4f50d0a889caeb71f1f1.tar.gz
blackbird-op-linux-7f1495745347bc2cb9cc4f50d0a889caeb71f1f1.zip
Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
* 'sg' of git://git.kernel.dk/linux-2.6-block: fix sg_phys to use dma_addr_t ub: add sg_init_table for sense and read capacity commands x86: pci-gart fix blackfin: fix sg fallout xtensa: dma-mapping.h is using linux/scatterlist.h functions, so include it SG: audit of drivers that use blk_rq_map_sg() arch/um/drivers/ubd_kern.c: fix a building error SG: Change sg_set_page() to take length and offset argument AVR32: Fix sg_page breakage mmc: sg fallout m68k: sg fallout More SG build fixes sg: add missing sg_init_table calls to zfcp SG build fix
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/crypto.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 0a9882edf562..7a472b129997 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -282,10 +282,8 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg,
while (size > 0 && i < sg_size) {
pg = virt_to_page(addr);
offset = offset_in_page(addr);
- if (sg) {
- sg_set_page(&sg[i], pg);
- sg[i].offset = offset;
- }
+ if (sg)
+ sg_set_page(&sg[i], pg, 0, offset);
remainder_of_page = PAGE_CACHE_SIZE - offset;
if (size >= remainder_of_page) {
if (sg)
@@ -716,12 +714,8 @@ ecryptfs_encrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
sg_init_table(&src_sg, 1);
sg_init_table(&dst_sg, 1);
- sg_set_page(&src_sg, src_page);
- src_sg.offset = src_offset;
- src_sg.length = size;
- sg_set_page(&dst_sg, dst_page);
- dst_sg.offset = dst_offset;
- dst_sg.length = size;
+ sg_set_page(&src_sg, src_page, size, src_offset);
+ sg_set_page(&dst_sg, dst_page, size, dst_offset);
return encrypt_scatterlist(crypt_stat, &dst_sg, &src_sg, size, iv);
}
@@ -746,14 +740,11 @@ ecryptfs_decrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
struct scatterlist src_sg, dst_sg;
sg_init_table(&src_sg, 1);
+ sg_set_page(&src_sg, src_page, size, src_offset);
+
sg_init_table(&dst_sg, 1);
+ sg_set_page(&dst_sg, dst_page, size, dst_offset);
- sg_set_page(&src_sg, src_page);
- src_sg.offset = src_offset;
- src_sg.length = size;
- sg_set_page(&dst_sg, dst_page);
- dst_sg.offset = dst_offset;
- dst_sg.length = size;
return decrypt_scatterlist(crypt_stat, &dst_sg, &src_sg, size, iv);
}
OpenPOWER on IntegriCloud