pr_debug("ftl_cs: waiting for transfer "
"unit to be prepared...\n");
if (part->mbd.mtd->sync)
- part->mbd.mtd->sync(part->mbd.mtd);
+ mtd_sync(part->mbd.mtd);
} else {
static int ne = 0;
if (++ne < 5)
if (!--mtdblk->count) {
/* It was the last usage. Free the cache */
if (mbd->mtd->sync)
- mbd->mtd->sync(mbd->mtd);
+ mtd_sync(mbd->mtd);
vfree(mtdblk->cache_data);
}
mutex_unlock(&mtdblk->cache_mutex);
if (dev->mtd->sync)
- dev->mtd->sync(dev->mtd);
+ mtd_sync(dev->mtd);
return 0;
}
/* Only sync if opened RW */
if ((file->f_mode & FMODE_WRITE) && mtd->sync)
- mtd->sync(mtd);
+ mtd_sync(mtd);
iput(mfi->ino);
for (i = 0; i < concat->num_subdev; i++) {
struct mtd_info *subdev = concat->subdev[i];
- subdev->sync(subdev);
+ mtd_sync(subdev);
}
}
static void part_sync(struct mtd_info *mtd)
{
struct mtd_part *part = PART(mtd);
- part->master->sync(part->master);
+ mtd_sync(part->master);
}
static int part_suspend(struct mtd_info *mtd)
struct mtdswap_dev *d = MTDSWAP_MBD_TO_MTDSWAP(dev);
if (d->mtd->sync)
- d->mtd->sync(d->mtd);
+ mtd_sync(d->mtd);
return 0;
}
/* we have a race if sync doesn't exist */
if (part->mbd.mtd->sync)
- part->mbd.mtd->sync(part->mbd.mtd);
+ mtd_sync(part->mbd.mtd);
score = 0x7fffffff; /* MAX_INT */
best_block = -1;
return -ENODEV;
if (ubi->mtd->sync)
- ubi->mtd->sync(ubi->mtd);
+ mtd_sync(ubi->mtd);
ubi_put_device(ubi);
return 0;
kfree(c->inocache_list);
jffs2_clear_xattr_subsystem(c);
if (c->mtd->sync)
- c->mtd->sync(c->mtd);
+ mtd_sync(c->mtd);
D1(printk(KERN_DEBUG "jffs2_put_super returning\n"));
}
struct mtd_info *mtd = logfs_super(sb)->s_mtd;
if (mtd->sync)
- mtd->sync(mtd);
+ mtd_sync(mtd);
}
static int logfs_mtd_readpage(void *_sb, struct page *page)
size_t len);
int (*writev) (struct mtd_info *mtd, const struct kvec *vecs,
unsigned long count, loff_t to, size_t *retlen);
+ void (*sync) (struct mtd_info *mtd);
/* Backing device capabilities for this device
* - provides mmap capabilities
*/
struct backing_dev_info *backing_dev_info;
- /* Sync */
- void (*sync) (struct mtd_info *mtd);
-
/* Chip-supported device locking */
int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
return mtd->writev(mtd, vecs, count, to, retlen);
}
+static inline void mtd_sync(struct mtd_info *mtd)
+{
+ mtd->sync(mtd);
+}
+
static inline struct mtd_info *dev_to_mtd(struct device *dev)
{
return dev ? dev_get_drvdata(dev) : NULL;