*参照元 [#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 & metadata to disk * @file: file to sync * @dentry: dentry of @file * @start: offset in bytes of the beginning of data range to sync * @end: offset in bytes of the end of data range (inclusive) * @datasync: perform only datasync * * Write back data in range @start..@end and metadata for @file to disk. If * @datasync is set only metadata needed to access modified file data is * written. * * In case this function is called from nfsd @file may be %NULL and * only @dentry is set. This can only happen when the filesystem * implements the export_operations API. */ int vfs_fsync_range(struct file *file, struct dentry *dentry, loff_t start, 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 have * 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 could cause * 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]