Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3f6bba82
Commit
3f6bba82
authored
Sep 05, 2012
by
Jan Kara
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fast_track' into for_next
parents
76f59b3b
9c2fc0de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
6 deletions
+29
-6
fs/udf/file.c
fs/udf/file.c
+29
-6
No files found.
fs/udf/file.c
View file @
3f6bba82
...
...
@@ -39,20 +39,24 @@
#include "udf_i.h"
#include "udf_sb.h"
static
int
udf_adinicb_readpage
(
struct
file
*
file
,
struct
page
*
page
)
static
void
__udf_adinicb_readpage
(
struct
page
*
page
)
{
struct
inode
*
inode
=
page
->
mapping
->
host
;
char
*
kaddr
;
struct
udf_inode_info
*
iinfo
=
UDF_I
(
inode
);
BUG_ON
(
!
PageLocked
(
page
));
kaddr
=
kmap
(
page
);
memset
(
kaddr
,
0
,
PAGE_CACHE_SIZE
);
memcpy
(
kaddr
,
iinfo
->
i_ext
.
i_data
+
iinfo
->
i_lenEAttr
,
inode
->
i_size
);
memset
(
kaddr
+
inode
->
i_size
,
0
,
PAGE_CACHE_SIZE
-
inode
->
i_size
);
flush_dcache_page
(
page
);
SetPageUptodate
(
page
);
kunmap
(
page
);
}
static
int
udf_adinicb_readpage
(
struct
file
*
file
,
struct
page
*
page
)
{
BUG_ON
(
!
PageLocked
(
page
));
__udf_adinicb_readpage
(
page
);
unlock_page
(
page
);
return
0
;
...
...
@@ -77,6 +81,25 @@ static int udf_adinicb_writepage(struct page *page,
return
0
;
}
static
int
udf_adinicb_write_begin
(
struct
file
*
file
,
struct
address_space
*
mapping
,
loff_t
pos
,
unsigned
len
,
unsigned
flags
,
struct
page
**
pagep
,
void
**
fsdata
)
{
struct
page
*
page
;
if
(
WARN_ON_ONCE
(
pos
>=
PAGE_CACHE_SIZE
))
return
-
EIO
;
page
=
grab_cache_page_write_begin
(
mapping
,
0
,
flags
);
if
(
!
page
)
return
-
ENOMEM
;
*
pagep
=
page
;
if
(
!
PageUptodate
(
page
)
&&
len
!=
PAGE_CACHE_SIZE
)
__udf_adinicb_readpage
(
page
);
return
0
;
}
static
int
udf_adinicb_write_end
(
struct
file
*
file
,
struct
address_space
*
mapping
,
loff_t
pos
,
unsigned
len
,
unsigned
copied
,
...
...
@@ -98,8 +121,8 @@ static int udf_adinicb_write_end(struct file *file,
const
struct
address_space_operations
udf_adinicb_aops
=
{
.
readpage
=
udf_adinicb_readpage
,
.
writepage
=
udf_adinicb_writepage
,
.
write_begin
=
simple
_write_begin
,
.
write_end
=
udf_adinicb_write_end
,
.
write_begin
=
udf_adinicb
_write_begin
,
.
write_end
=
udf_adinicb_write_end
,
};
static
ssize_t
udf_file_aio_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
...
...
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