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
Kirill Smelkov
linux
Commits
2cf4ce7c
Commit
2cf4ce7c
authored
Sep 18, 2011
by
Chris Mason
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'btrfs-3.0' into for-linus
parents
b6fd41e2
dde820fb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
fs/btrfs/inode.c
fs/btrfs/inode.c
+3
-2
fs/btrfs/ioctl.c
fs/btrfs/ioctl.c
+9
-5
No files found.
fs/btrfs/inode.c
View file @
2cf4ce7c
...
...
@@ -4125,7 +4125,8 @@ static int btrfs_real_readdir(struct file *filp, void *dirent,
/* special case for "." */
if
(
filp
->
f_pos
==
0
)
{
over
=
filldir
(
dirent
,
"."
,
1
,
1
,
btrfs_ino
(
inode
),
DT_DIR
);
over
=
filldir
(
dirent
,
"."
,
1
,
filp
->
f_pos
,
btrfs_ino
(
inode
),
DT_DIR
);
if
(
over
)
return
0
;
filp
->
f_pos
=
1
;
...
...
@@ -4134,7 +4135,7 @@ static int btrfs_real_readdir(struct file *filp, void *dirent,
if
(
filp
->
f_pos
==
1
)
{
u64
pino
=
parent_ino
(
filp
->
f_path
.
dentry
);
over
=
filldir
(
dirent
,
".."
,
2
,
2
,
pino
,
DT_DIR
);
filp
->
f_pos
,
pino
,
DT_DIR
);
if
(
over
)
return
0
;
filp
->
f_pos
=
2
;
...
...
fs/btrfs/ioctl.c
View file @
2cf4ce7c
...
...
@@ -2177,6 +2177,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
if
(
!
(
src_file
->
f_mode
&
FMODE_READ
))
goto
out_fput
;
/* don't make the dst file partly checksummed */
if
((
BTRFS_I
(
src
)
->
flags
&
BTRFS_INODE_NODATASUM
)
!=
(
BTRFS_I
(
inode
)
->
flags
&
BTRFS_INODE_NODATASUM
))
goto
out_fput
;
ret
=
-
EISDIR
;
if
(
S_ISDIR
(
src
->
i_mode
)
||
S_ISDIR
(
inode
->
i_mode
))
goto
out_fput
;
...
...
@@ -2226,6 +2231,10 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
goto
out_unlock
;
}
/* truncate page cache pages from target inode range */
truncate_inode_pages_range
(
&
inode
->
i_data
,
destoff
,
PAGE_CACHE_ALIGN
(
destoff
+
len
)
-
1
);
/* do any pending delalloc/csum calc on src, one way or
another, and lock file content */
while
(
1
)
{
...
...
@@ -2242,10 +2251,6 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
btrfs_wait_ordered_range
(
src
,
off
,
len
);
}
/* truncate page cache pages from target inode range */
truncate_inode_pages_range
(
&
inode
->
i_data
,
off
,
ALIGN
(
off
+
len
,
PAGE_CACHE_SIZE
)
-
1
);
/* clone data */
key
.
objectid
=
btrfs_ino
(
src
);
key
.
type
=
BTRFS_EXTENT_DATA_KEY
;
...
...
@@ -2442,7 +2447,6 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
if
(
endoff
>
inode
->
i_size
)
btrfs_i_size_write
(
inode
,
endoff
);
BTRFS_I
(
inode
)
->
flags
=
BTRFS_I
(
src
)
->
flags
;
ret
=
btrfs_update_inode
(
trans
,
root
,
inode
);
BUG_ON
(
ret
);
btrfs_end_transaction
(
trans
,
root
);
...
...
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