/*
* YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
- * Copyright (C) 2002-2011 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
+ * Copyright (C) 2002-2018 Aleph One Ltd.
*
* Created by Charles Manning <charles@aleph1.co.uk>
* Acknowledgements:
{
struct inode *iptr;
struct yaffs_obj *obj;
+ struct yaffs_dev *dev = yaffs_super_to_dev(sb);
+ spin_lock(&sb->s_inode_list_lock);
list_for_each_entry(iptr, &sb->s_inodes, i_sb_list) {
+ spin_lock(&inode->i_lock);
+ if (iptr->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) {
+ spin_unlock(&inode->i_lock);
+ continue;
+ }
+
+ __iget(iptr);
+ spin_unlock(&inode->i_lock);
+ spin_unlock(&sb->s_inode_list_lock);
+
obj = yaffs_inode_to_obj(iptr);
if (obj) {
yaffs_trace(YAFFS_TRACE_OS,
"flushing obj %d", obj->obj_id);
yaffs_flush_file(obj, 1, 0, 0);
}
+
+ yaffs_gross_unlock(dev);
+ iput(iptr);
+ yaffs_gross_lock(dev);
+
+ spin_lock(&sb->s_inode_list_lock);
}
+ spin_unlock(&sb->s_inode_list_lock);
}
static void yaffs_flush_super(struct super_block *sb, int do_checkpoint)