static struct super_block *get_super(kdev_t dev) { register struct super_block *s; if (dev) { s = super_blocks; while (s < super_blocks + NR_SUPER) if (s->s_dev == dev) { wait_on_super(s); if (s->s_dev == dev) return s; s = super_blocks; } else s++; } return NULL; }
static struct super_block * get_super(kdev_t dev) { struct super_block * s; if (!dev) return NULL; s = 0+super_blocks; while (s < NR_SUPER+super_blocks) if (s->s_dev == dev) { wait_on_super(s); if (s->s_dev == dev) return s; s = 0+super_blocks; } else s++; return NULL; }
void sync_supers(kdev_t dev) { struct super_block * sb; for (sb = super_blocks + 0 ; sb < super_blocks + NR_SUPER ; sb++) { if (!sb->s_dev) continue; if (dev && sb->s_dev != dev) continue; wait_on_super(sb); if (!sb->s_dev || !sb->s_dirt) continue; if (dev && (dev != sb->s_dev)) continue; if (sb->s_op && sb->s_op->write_super) sb->s_op->write_super(sb); } }
struct super_block * get_super(kdev_t dev) { struct super_block * s; if (!dev) return NULL; restart: s = sb_entry(super_blocks.next); while (s != sb_entry(&super_blocks)) if (s->s_dev == dev) { wait_on_super(s); if (s->s_dev == dev) return s; goto restart; } else s = sb_entry(s->s_list.next); return NULL; }
void sync_supers(kdev_t dev) { register struct super_block *sb; register struct super_operations *sop; for (sb = super_blocks; sb < super_blocks + NR_SUPER; sb++) { if ((!sb->s_dev) || (dev && sb->s_dev != dev)) continue; wait_on_super(sb); if (!sb->s_dev || !sb->s_dirt || (dev && (dev != sb->s_dev))) continue; sop = sb->s_op; if (sop && sop->write_super) sop->write_super(sb); } }
/* * Note: check the dirty flag before waiting, so we don't * hold up the sync while mounting a device. (The newly * mounted device won't need syncing.) */ void sync_supers(kdev_t dev) { struct super_block * sb; for (sb = sb_entry(super_blocks.next); sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.next)) { if (!sb->s_dev) continue; if (dev && sb->s_dev != dev) continue; if (!sb->s_dirt) continue; /* N.B. Should lock the superblock while writing */ wait_on_super(sb); if (!sb->s_dev || !sb->s_dirt) continue; if (dev && (dev != sb->s_dev)) continue; if (sb->s_op && sb->s_op->write_super) sb->s_op->write_super(sb); } }
void lock_super(register struct super_block *sb) { wait_on_super(sb); sb->s_lock = 1; }