linux-2.6.33/vfs_fsync_range()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#b4d1de1b]
#backlinks
*説明 [#rc4e0286]
-パス: [[linux-2.6.33/fs/sync.c]]
-FIXME: これは何?
--説明
**引数 [#dd1c151b]
-struct file *file
--
--[[linux-2.6.33/file]]
-struct dentry *dentry
--
--[[linux-2.6.33/dentry]]
-loff_t start
--
-loff_t end
--
-int datasync
--
**返り値 [#k560a484]
-
--
**参考 [#w27d8720]
*実装 [#jc0a4d5c]
/**
* vfs_fsync_range - helper to sync a range of data & me...
* @file: file to sync
* @dentry: dentry of @file
* @start: offset in bytes of the beginning of data ran...
* @end: offset in bytes of the end of data range (incl...
* @datasync: perform only datasync
*
* Write back data in range @start..@end and metadata fo...
* @datasync is set only metadata needed to access modif...
* written.
*
* In case this function is called from nfsd @file may b...
* only @dentry is set. This can only happen when the f...
* implements the export_operations API.
*/
int vfs_fsync_range(struct file *file, struct dentry *de...
loff_t end, int datasync)
{
const struct file_operations *fop;
struct address_space *mapping;
int err, ret;
-
--[[linux-2.6.33/file_operations]]
-
--[[linux-2.6.33/address_space]]
/*
* Get mapping and operations from the file in case we ...
* as file, or get the default values for them in case we
* don't have a struct file available. Damn nfsd..
*/
if (file) {
mapping = file->f_mapping;
fop = file->f_op;
} else {
mapping = dentry->d_inode->i_mapping;
fop = dentry->d_inode->i_fop;
}
if (!fop || !fop->fsync) {
ret = -EINVAL;
goto out;
}
-
--[[linux-2.6.33/EINVAL]]
ret = filemap_write_and_wait_range(mapping, start, end);
-
--[[linux-2.6.33/filemap_write_and_wait_range()]]
/*
* We need to protect against concurrent writers, which...
* livelocks in fsync_buffers_list().
*/
mutex_lock(&mapping->host->i_mutex);
err = fop->fsync(file, dentry, datasync);
if (!ret)
ret = err;
mutex_unlock(&mapping->host->i_mutex);
out:
return ret;
}
EXPORT_SYMBOL(vfs_fsync_range);
-
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*コメント [#u215222c]
終了行:
*参照元 [#b4d1de1b]
#backlinks
*説明 [#rc4e0286]
-パス: [[linux-2.6.33/fs/sync.c]]
-FIXME: これは何?
--説明
**引数 [#dd1c151b]
-struct file *file
--
--[[linux-2.6.33/file]]
-struct dentry *dentry
--
--[[linux-2.6.33/dentry]]
-loff_t start
--
-loff_t end
--
-int datasync
--
**返り値 [#k560a484]
-
--
**参考 [#w27d8720]
*実装 [#jc0a4d5c]
/**
* vfs_fsync_range - helper to sync a range of data & me...
* @file: file to sync
* @dentry: dentry of @file
* @start: offset in bytes of the beginning of data ran...
* @end: offset in bytes of the end of data range (incl...
* @datasync: perform only datasync
*
* Write back data in range @start..@end and metadata fo...
* @datasync is set only metadata needed to access modif...
* written.
*
* In case this function is called from nfsd @file may b...
* only @dentry is set. This can only happen when the f...
* implements the export_operations API.
*/
int vfs_fsync_range(struct file *file, struct dentry *de...
loff_t end, int datasync)
{
const struct file_operations *fop;
struct address_space *mapping;
int err, ret;
-
--[[linux-2.6.33/file_operations]]
-
--[[linux-2.6.33/address_space]]
/*
* Get mapping and operations from the file in case we ...
* as file, or get the default values for them in case we
* don't have a struct file available. Damn nfsd..
*/
if (file) {
mapping = file->f_mapping;
fop = file->f_op;
} else {
mapping = dentry->d_inode->i_mapping;
fop = dentry->d_inode->i_fop;
}
if (!fop || !fop->fsync) {
ret = -EINVAL;
goto out;
}
-
--[[linux-2.6.33/EINVAL]]
ret = filemap_write_and_wait_range(mapping, start, end);
-
--[[linux-2.6.33/filemap_write_and_wait_range()]]
/*
* We need to protect against concurrent writers, which...
* livelocks in fsync_buffers_list().
*/
mutex_lock(&mapping->host->i_mutex);
err = fop->fsync(file, dentry, datasync);
if (!ret)
ret = err;
mutex_unlock(&mapping->host->i_mutex);
out:
return ret;
}
EXPORT_SYMBOL(vfs_fsync_range);
-
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*コメント [#u215222c]
ページ名: