/* * Flush all dirty pages, and check for write errors. * */ static int nfs_file_flush(struct file *file) { struct inode *inode = file->f_dentry->d_inode; int status; dfprintk(VFS, "nfs: flush(%x/%ld)\n", inode->i_dev, inode->i_ino); status = nfs_wb_file(inode, file); if (!status) { status = file->f_error; file->f_error = 0; } return status; }
/* * Flush any dirty pages for this process, and check for write errors. * The return status from this call provides a reliable indication of * whether any write errors occurred for this process. */ static int nfs_fsync(struct file *file, struct dentry *dentry, int datasync) { struct inode *inode = dentry->d_inode; int status; dfprintk(VFS, "nfs: fsync(%x/%ld)\n", inode->i_dev, inode->i_ino); lock_kernel(); status = nfs_wb_file(inode, file); if (!status) { status = file->f_error; file->f_error = 0; } unlock_kernel(); return status; }
/* * Flush all dirty pages, and check for write errors. * */ static int nfs_file_flush(struct file *file) { struct inode *inode = file->f_dentry->d_inode; int status; dfprintk(VFS, "nfs: flush(%x/%ld)\n", inode->i_dev, inode->i_ino); /* Make sure all async reads have been sent off. We don't bother * waiting on them though... */ if (file->f_mode & FMODE_READ) nfs_pagein_inode(inode, 0, 0); status = nfs_wb_file(inode, file); if (!status) { status = file->f_error; file->f_error = 0; } return status; }