linux-2.6.33/generic_segment_checks()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#c270f447]
#backlinks
*説明 [#ofeb965b]
-パス: [[linux-2.6.33/mm/filemap.c]]
-FIXME: これは何?
--説明
**引数 [#g51d9c69]
-const struct iovec *iov
--
--[[linux-2.6.33/iovec]]
-unsigned long *nr_segs
--
-size_t *count
--
-int access_flags
--
**返り値 [#e27d5b13]
-
--
**参考 [#wb3f9297]
*実装 [#u1347f59]
/*
* Performs necessary checks before doing a write
* @iov: io vector request
* @nr_segs: number of segments in the iovec
* @count: number of bytes to write
* @access_flags: type of access: %VERIFY_READ or %VERIF...
*
* Adjust number of segments and amount of bytes to writ...
* properly initialized first). Returns appropriate erro...
* should return or zero in case that write should be al...
*/
int generic_segment_checks(const struct iovec *iov,
unsigned long *nr_segs, size_t *count, int access_fla...
{
unsigned long seg;
size_t cnt = 0;
for (seg = 0; seg < *nr_segs; seg++) {
const struct iovec *iv = &iov[seg];
/*
* If any segment has a negative length, or the cumula...
* length ever wraps negative then return -EINVAL.
*/
cnt += iv->iov_len;
if (unlikely((ssize_t)(cnt|iv->iov_len) < 0))
return -EINVAL;
-
--[[linux-2.6.33/unlikely()]]
if (access_ok(access_flags, iv->iov_base, iv->iov_len))
continue;
-
--[[linux-2.6.33/access_ok()]]
if (seg == 0)
return -EFAULT;
*nr_segs = seg;
cnt -= iv->iov_len; /* This segment is no good */
break;
}
*count = cnt;
return 0;
}
EXPORT_SYMBOL(generic_segment_checks);
-特にライセンスを区別せずシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*コメント [#e619c6a6]
終了行:
*参照元 [#c270f447]
#backlinks
*説明 [#ofeb965b]
-パス: [[linux-2.6.33/mm/filemap.c]]
-FIXME: これは何?
--説明
**引数 [#g51d9c69]
-const struct iovec *iov
--
--[[linux-2.6.33/iovec]]
-unsigned long *nr_segs
--
-size_t *count
--
-int access_flags
--
**返り値 [#e27d5b13]
-
--
**参考 [#wb3f9297]
*実装 [#u1347f59]
/*
* Performs necessary checks before doing a write
* @iov: io vector request
* @nr_segs: number of segments in the iovec
* @count: number of bytes to write
* @access_flags: type of access: %VERIFY_READ or %VERIF...
*
* Adjust number of segments and amount of bytes to writ...
* properly initialized first). Returns appropriate erro...
* should return or zero in case that write should be al...
*/
int generic_segment_checks(const struct iovec *iov,
unsigned long *nr_segs, size_t *count, int access_fla...
{
unsigned long seg;
size_t cnt = 0;
for (seg = 0; seg < *nr_segs; seg++) {
const struct iovec *iv = &iov[seg];
/*
* If any segment has a negative length, or the cumula...
* length ever wraps negative then return -EINVAL.
*/
cnt += iv->iov_len;
if (unlikely((ssize_t)(cnt|iv->iov_len) < 0))
return -EINVAL;
-
--[[linux-2.6.33/unlikely()]]
if (access_ok(access_flags, iv->iov_base, iv->iov_len))
continue;
-
--[[linux-2.6.33/access_ok()]]
if (seg == 0)
return -EFAULT;
*nr_segs = seg;
cnt -= iv->iov_len; /* This segment is no good */
break;
}
*count = cnt;
return 0;
}
EXPORT_SYMBOL(generic_segment_checks);
-特にライセンスを区別せずシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*コメント [#e619c6a6]
ページ名: