Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
a3ac1414
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a3ac1414
编写于
11月 25, 2011
作者:
C
Cong Wang
提交者:
Cong Wang
3月 20, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ntfs: remove the second argument of k[un]map_atomic()
Signed-off-by:
N
Cong Wang
<
amwang@redhat.com
>
上级
7b9c0976
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
32 deletion
+32
-32
fs/ntfs/aops.c
fs/ntfs/aops.c
+10
-10
fs/ntfs/attrib.c
fs/ntfs/attrib.c
+10
-10
fs/ntfs/file.c
fs/ntfs/file.c
+8
-8
fs/ntfs/super.c
fs/ntfs/super.c
+4
-4
未找到文件。
fs/ntfs/aops.c
浏览文件 @
a3ac1414
...
...
@@ -94,11 +94,11 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
if
(
file_ofs
<
init_size
)
ofs
=
init_size
-
file_ofs
;
local_irq_save
(
flags
);
kaddr
=
kmap_atomic
(
page
,
KM_BIO_SRC_IRQ
);
kaddr
=
kmap_atomic
(
page
);
memset
(
kaddr
+
bh_offset
(
bh
)
+
ofs
,
0
,
bh
->
b_size
-
ofs
);
flush_dcache_page
(
page
);
kunmap_atomic
(
kaddr
,
KM_BIO_SRC_IRQ
);
kunmap_atomic
(
kaddr
);
local_irq_restore
(
flags
);
}
}
else
{
...
...
@@ -147,11 +147,11 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
/* Should have been verified before we got here... */
BUG_ON
(
!
recs
);
local_irq_save
(
flags
);
kaddr
=
kmap_atomic
(
page
,
KM_BIO_SRC_IRQ
);
kaddr
=
kmap_atomic
(
page
);
for
(
i
=
0
;
i
<
recs
;
i
++
)
post_read_mst_fixup
((
NTFS_RECORD
*
)(
kaddr
+
i
*
rec_size
),
rec_size
);
kunmap_atomic
(
kaddr
,
KM_BIO_SRC_IRQ
);
kunmap_atomic
(
kaddr
);
local_irq_restore
(
flags
);
flush_dcache_page
(
page
);
if
(
likely
(
page_uptodate
&&
!
PageError
(
page
)))
...
...
@@ -504,7 +504,7 @@ static int ntfs_readpage(struct file *file, struct page *page)
/* Race with shrinking truncate. */
attr_len
=
i_size
;
}
addr
=
kmap_atomic
(
page
,
KM_USER0
);
addr
=
kmap_atomic
(
page
);
/* Copy the data to the page. */
memcpy
(
addr
,
(
u8
*
)
ctx
->
attr
+
le16_to_cpu
(
ctx
->
attr
->
data
.
resident
.
value_offset
),
...
...
@@ -512,7 +512,7 @@ static int ntfs_readpage(struct file *file, struct page *page)
/* Zero the remainder of the page. */
memset
(
addr
+
attr_len
,
0
,
PAGE_CACHE_SIZE
-
attr_len
);
flush_dcache_page
(
page
);
kunmap_atomic
(
addr
,
KM_USER0
);
kunmap_atomic
(
addr
);
put_unm_err_out:
ntfs_attr_put_search_ctx
(
ctx
);
unm_err_out:
...
...
@@ -746,14 +746,14 @@ static int ntfs_write_block(struct page *page, struct writeback_control *wbc)
unsigned
long
*
bpos
,
*
bend
;
/* Check if the buffer is zero. */
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
bpos
=
(
unsigned
long
*
)(
kaddr
+
bh_offset
(
bh
));
bend
=
(
unsigned
long
*
)((
u8
*
)
bpos
+
blocksize
);
do
{
if
(
unlikely
(
*
bpos
))
break
;
}
while
(
likely
(
++
bpos
<
bend
));
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
if
(
bpos
==
bend
)
{
/*
* Buffer is zero and sparse, no need to write
...
...
@@ -1495,14 +1495,14 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
/* Shrinking cannot fail. */
BUG_ON
(
err
);
}
addr
=
kmap_atomic
(
page
,
KM_USER0
);
addr
=
kmap_atomic
(
page
);
/* Copy the data from the page to the mft record. */
memcpy
((
u8
*
)
ctx
->
attr
+
le16_to_cpu
(
ctx
->
attr
->
data
.
resident
.
value_offset
),
addr
,
attr_len
);
/* Zero out of bounds area in the page cache page. */
memset
(
addr
+
attr_len
,
0
,
PAGE_CACHE_SIZE
-
attr_len
);
kunmap_atomic
(
addr
,
KM_USER0
);
kunmap_atomic
(
addr
);
flush_dcache_page
(
page
);
flush_dcache_mft_record_page
(
ctx
->
ntfs_ino
);
/* We are done with the page. */
...
...
fs/ntfs/attrib.c
浏览文件 @
a3ac1414
...
...
@@ -1656,12 +1656,12 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size)
attr_size
=
le32_to_cpu
(
a
->
data
.
resident
.
value_length
);
BUG_ON
(
attr_size
!=
data_size
);
if
(
page
&&
!
PageUptodate
(
page
))
{
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
memcpy
(
kaddr
,
(
u8
*
)
a
+
le16_to_cpu
(
a
->
data
.
resident
.
value_offset
),
attr_size
);
memset
(
kaddr
+
attr_size
,
0
,
PAGE_CACHE_SIZE
-
attr_size
);
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
flush_dcache_page
(
page
);
SetPageUptodate
(
page
);
}
...
...
@@ -1806,9 +1806,9 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size)
sizeof
(
a
->
data
.
resident
.
reserved
));
/* Copy the data from the page back to the attribute value. */
if
(
page
)
{
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
memcpy
((
u8
*
)
a
+
mp_ofs
,
kaddr
,
attr_size
);
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
}
/* Setup the allocated size in the ntfs inode in case it changed. */
write_lock_irqsave
(
&
ni
->
size_lock
,
flags
);
...
...
@@ -2540,10 +2540,10 @@ int ntfs_attr_set(ntfs_inode *ni, const s64 ofs, const s64 cnt, const u8 val)
size
=
PAGE_CACHE_SIZE
;
if
(
idx
==
end
)
size
=
end_ofs
;
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
memset
(
kaddr
+
start_ofs
,
val
,
size
-
start_ofs
);
flush_dcache_page
(
page
);
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
set_page_dirty
(
page
);
page_cache_release
(
page
);
balance_dirty_pages_ratelimited
(
mapping
);
...
...
@@ -2561,10 +2561,10 @@ int ntfs_attr_set(ntfs_inode *ni, const s64 ofs, const s64 cnt, const u8 val)
"page (index 0x%lx)."
,
idx
);
return
-
ENOMEM
;
}
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
memset
(
kaddr
,
val
,
PAGE_CACHE_SIZE
);
flush_dcache_page
(
page
);
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
/*
* If the page has buffers, mark them uptodate since buffer
* state and not page state is definitive in 2.6 kernels.
...
...
@@ -2598,10 +2598,10 @@ int ntfs_attr_set(ntfs_inode *ni, const s64 ofs, const s64 cnt, const u8 val)
"(error, index 0x%lx)."
,
idx
);
return
PTR_ERR
(
page
);
}
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
memset
(
kaddr
,
val
,
end_ofs
);
flush_dcache_page
(
page
);
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
set_page_dirty
(
page
);
page_cache_release
(
page
);
balance_dirty_pages_ratelimited
(
mapping
);
...
...
fs/ntfs/file.c
浏览文件 @
a3ac1414
...
...
@@ -704,7 +704,7 @@ static int ntfs_prepare_pages_for_non_resident_write(struct page **pages,
u8
*
kaddr
;
unsigned
pofs
;
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
if
(
bh_pos
<
pos
)
{
pofs
=
bh_pos
&
~
PAGE_CACHE_MASK
;
memset
(
kaddr
+
pofs
,
0
,
pos
-
bh_pos
);
...
...
@@ -713,7 +713,7 @@ static int ntfs_prepare_pages_for_non_resident_write(struct page **pages,
pofs
=
end
&
~
PAGE_CACHE_MASK
;
memset
(
kaddr
+
pofs
,
0
,
bh_end
-
end
);
}
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
flush_dcache_page
(
page
);
}
continue
;
...
...
@@ -1287,9 +1287,9 @@ static inline size_t ntfs_copy_from_user(struct page **pages,
len
=
PAGE_CACHE_SIZE
-
ofs
;
if
(
len
>
bytes
)
len
=
bytes
;
addr
=
kmap_atomic
(
*
pages
,
KM_USER0
);
addr
=
kmap_atomic
(
*
pages
);
left
=
__copy_from_user_inatomic
(
addr
+
ofs
,
buf
,
len
);
kunmap_atomic
(
addr
,
KM_USER0
);
kunmap_atomic
(
addr
);
if
(
unlikely
(
left
))
{
/* Do it the slow way. */
addr
=
kmap
(
*
pages
);
...
...
@@ -1401,10 +1401,10 @@ static inline size_t ntfs_copy_from_user_iovec(struct page **pages,
len
=
PAGE_CACHE_SIZE
-
ofs
;
if
(
len
>
bytes
)
len
=
bytes
;
addr
=
kmap_atomic
(
*
pages
,
KM_USER0
);
addr
=
kmap_atomic
(
*
pages
);
copied
=
__ntfs_copy_from_user_iovec_inatomic
(
addr
+
ofs
,
*
iov
,
*
iov_ofs
,
len
);
kunmap_atomic
(
addr
,
KM_USER0
);
kunmap_atomic
(
addr
);
if
(
unlikely
(
copied
!=
len
))
{
/* Do it the slow way. */
addr
=
kmap
(
*
pages
);
...
...
@@ -1691,7 +1691,7 @@ static int ntfs_commit_pages_after_write(struct page **pages,
BUG_ON
(
end
>
le32_to_cpu
(
a
->
length
)
-
le16_to_cpu
(
a
->
data
.
resident
.
value_offset
));
kattr
=
(
u8
*
)
a
+
le16_to_cpu
(
a
->
data
.
resident
.
value_offset
);
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
/* Copy the received data from the page to the mft record. */
memcpy
(
kattr
+
pos
,
kaddr
+
pos
,
bytes
);
/* Update the attribute length if necessary. */
...
...
@@ -1713,7 +1713,7 @@ static int ntfs_commit_pages_after_write(struct page **pages,
flush_dcache_page
(
page
);
SetPageUptodate
(
page
);
}
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
/* Update initialized_size/i_size if necessary. */
read_lock_irqsave
(
&
ni
->
size_lock
,
flags
);
initialized_size
=
ni
->
initialized_size
;
...
...
fs/ntfs/super.c
浏览文件 @
a3ac1414
...
...
@@ -2473,7 +2473,7 @@ static s64 get_nr_free_clusters(ntfs_volume *vol)
nr_free
-=
PAGE_CACHE_SIZE
*
8
;
continue
;
}
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
/*
* Subtract the number of set bits. If this
* is the last page and it is partial we don't really care as
...
...
@@ -2483,7 +2483,7 @@ static s64 get_nr_free_clusters(ntfs_volume *vol)
*/
nr_free
-=
bitmap_weight
(
kaddr
,
PAGE_CACHE_SIZE
*
BITS_PER_BYTE
);
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
page_cache_release
(
page
);
}
ntfs_debug
(
"Finished reading $Bitmap, last index = 0x%lx."
,
index
-
1
);
...
...
@@ -2544,7 +2544,7 @@ static unsigned long __get_nr_free_mft_records(ntfs_volume *vol,
nr_free
-=
PAGE_CACHE_SIZE
*
8
;
continue
;
}
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
kaddr
=
kmap_atomic
(
page
);
/*
* Subtract the number of set bits. If this
* is the last page and it is partial we don't really care as
...
...
@@ -2554,7 +2554,7 @@ static unsigned long __get_nr_free_mft_records(ntfs_volume *vol,
*/
nr_free
-=
bitmap_weight
(
kaddr
,
PAGE_CACHE_SIZE
*
BITS_PER_BYTE
);
kunmap_atomic
(
kaddr
,
KM_USER0
);
kunmap_atomic
(
kaddr
);
page_cache_release
(
page
);
}
ntfs_debug
(
"Finished reading $MFT/$BITMAP, last index = 0x%lx."
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录