Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
60c74f81
Commit
60c74f81
authored
Oct 22, 2007
by
Jens Axboe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update fs/ to use sg helpers
Signed-off-by:
Jens Axboe
<
jens.axboe@oracle.com
>
parent
45711f1a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
fs/ecryptfs/crypto.c
fs/ecryptfs/crypto.c
+11
-5
fs/ecryptfs/keystore.c
fs/ecryptfs/keystore.c
+3
-0
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4recover.c
+3
-5
No files found.
fs/ecryptfs/crypto.c
View file @
60c74f81
...
@@ -283,7 +283,7 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg,
...
@@ -283,7 +283,7 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg,
pg
=
virt_to_page
(
addr
);
pg
=
virt_to_page
(
addr
);
offset
=
offset_in_page
(
addr
);
offset
=
offset_in_page
(
addr
);
if
(
sg
)
{
if
(
sg
)
{
sg
[
i
].
page
=
pg
;
sg
_set_page
(
&
sg
[
i
],
pg
)
;
sg
[
i
].
offset
=
offset
;
sg
[
i
].
offset
=
offset
;
}
}
remainder_of_page
=
PAGE_CACHE_SIZE
-
offset
;
remainder_of_page
=
PAGE_CACHE_SIZE
-
offset
;
...
@@ -713,10 +713,13 @@ ecryptfs_encrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
...
@@ -713,10 +713,13 @@ ecryptfs_encrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
{
{
struct
scatterlist
src_sg
,
dst_sg
;
struct
scatterlist
src_sg
,
dst_sg
;
src_sg
.
page
=
src_page
;
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
.
offset
=
src_offset
;
src_sg
.
length
=
size
;
src_sg
.
length
=
size
;
dst_sg
.
page
=
dst_page
;
sg_set_page
(
&
dst_sg
,
dst_page
)
;
dst_sg
.
offset
=
dst_offset
;
dst_sg
.
offset
=
dst_offset
;
dst_sg
.
length
=
size
;
dst_sg
.
length
=
size
;
return
encrypt_scatterlist
(
crypt_stat
,
&
dst_sg
,
&
src_sg
,
size
,
iv
);
return
encrypt_scatterlist
(
crypt_stat
,
&
dst_sg
,
&
src_sg
,
size
,
iv
);
...
@@ -742,10 +745,13 @@ ecryptfs_decrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
...
@@ -742,10 +745,13 @@ ecryptfs_decrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
{
{
struct
scatterlist
src_sg
,
dst_sg
;
struct
scatterlist
src_sg
,
dst_sg
;
src_sg
.
page
=
src_page
;
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
.
offset
=
src_offset
;
src_sg
.
length
=
size
;
src_sg
.
length
=
size
;
dst_sg
.
page
=
dst_page
;
sg_set_page
(
&
dst_sg
,
dst_page
)
;
dst_sg
.
offset
=
dst_offset
;
dst_sg
.
offset
=
dst_offset
;
dst_sg
.
length
=
size
;
dst_sg
.
length
=
size
;
return
decrypt_scatterlist
(
crypt_stat
,
&
dst_sg
,
&
src_sg
,
size
,
iv
);
return
decrypt_scatterlist
(
crypt_stat
,
&
dst_sg
,
&
src_sg
,
size
,
iv
);
...
...
fs/ecryptfs/keystore.c
View file @
60c74f81
...
@@ -1040,6 +1040,9 @@ decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
...
@@ -1040,6 +1040,9 @@ decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
};
};
int
rc
=
0
;
int
rc
=
0
;
sg_init_table
(
&
dst_sg
,
1
);
sg_init_table
(
&
src_sg
,
1
);
if
(
unlikely
(
ecryptfs_verbosity
>
0
))
{
if
(
unlikely
(
ecryptfs_verbosity
>
0
))
{
ecryptfs_printk
(
ecryptfs_printk
(
KERN_DEBUG
,
"Session key encryption key (size [%d]):
\n
"
,
KERN_DEBUG
,
"Session key encryption key (size [%d]):
\n
"
,
...
...
fs/nfsd/nfs4recover.c
View file @
60c74f81
...
@@ -88,7 +88,7 @@ nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname)
...
@@ -88,7 +88,7 @@ nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname)
{
{
struct
xdr_netobj
cksum
;
struct
xdr_netobj
cksum
;
struct
hash_desc
desc
;
struct
hash_desc
desc
;
struct
scatterlist
sg
[
1
]
;
struct
scatterlist
sg
;
__be32
status
=
nfserr_resource
;
__be32
status
=
nfserr_resource
;
dprintk
(
"NFSD: nfs4_make_rec_clidname for %.*s
\n
"
,
dprintk
(
"NFSD: nfs4_make_rec_clidname for %.*s
\n
"
,
...
@@ -102,11 +102,9 @@ nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname)
...
@@ -102,11 +102,9 @@ nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname)
if
(
cksum
.
data
==
NULL
)
if
(
cksum
.
data
==
NULL
)
goto
out
;
goto
out
;
sg
[
0
].
page
=
virt_to_page
(
clname
->
data
);
sg_init_one
(
&
sg
,
clname
->
data
,
clname
->
len
);
sg
[
0
].
offset
=
offset_in_page
(
clname
->
data
);
sg
[
0
].
length
=
clname
->
len
;
if
(
crypto_hash_digest
(
&
desc
,
sg
,
sg
->
length
,
cksum
.
data
))
if
(
crypto_hash_digest
(
&
desc
,
&
sg
,
sg
.
length
,
cksum
.
data
))
goto
out
;
goto
out
;
md5_to_hex
(
dname
,
cksum
.
data
);
md5_to_hex
(
dname
,
cksum
.
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment