Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147863
b: refs/heads/master
c: d5aacad
h: refs/heads/master
i:
  147861: 2bbafe3
  147859: 747c6bf
  147855: 3213b31
v: v3
  • Loading branch information
Al Viro committed Jun 12, 2009
1 parent 2f96550 commit b8ec2e1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 337eb00a2c3a421999c39c94ce7e33545ee8baa7
refs/heads/master: d5aacad548db1ff547adf35d0a77eb2a8ed4fe14
25 changes: 25 additions & 0 deletions trunk/fs/libfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <linux/vfs.h>
#include <linux/mutex.h>
#include <linux/exportfs.h>
#include <linux/writeback.h>
#include <linux/buffer_head.h>

#include <asm/uaccess.h>

Expand Down Expand Up @@ -807,6 +809,29 @@ struct dentry *generic_fh_to_parent(struct super_block *sb, struct fid *fid,
}
EXPORT_SYMBOL_GPL(generic_fh_to_parent);

int simple_fsync(struct file *file, struct dentry *dentry, int datasync)
{
struct writeback_control wbc = {
.sync_mode = WB_SYNC_ALL,
.nr_to_write = 0, /* metadata-only; caller takes care of data */
};
struct inode *inode = dentry->d_inode;
int err;
int ret;

ret = sync_mapping_buffers(inode->i_mapping);
if (!(inode->i_state & I_DIRTY))
return ret;
if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
return ret;

err = sync_inode(inode, &wbc);
if (ret == 0)
ret = err;
return ret;
}
EXPORT_SYMBOL(simple_fsync);

EXPORT_SYMBOL(dcache_dir_close);
EXPORT_SYMBOL(dcache_dir_lseek);
EXPORT_SYMBOL(dcache_dir_open);
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2345,6 +2345,8 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
loff_t *ppos, const void *from, size_t available);

extern int simple_fsync(struct file *, struct dentry *, int);

#ifdef CONFIG_MIGRATION
extern int buffer_migrate_page(struct address_space *,
struct page *, struct page *);
Expand Down

0 comments on commit b8ec2e1

Please sign in to comment.