static int au_procfs_plm_write_si(struct file *file, unsigned long id) { int err; struct super_block *sb; struct au_sbinfo *sbinfo; err = -EBUSY; if (unlikely(file->private_data)) goto out; sb = NULL; /* don't use au_sbilist_lock() here */ spin_lock(&au_sbilist.spin); list_for_each_entry(sbinfo, &au_sbilist.head, si_list) if (id == sysaufs_si_id(sbinfo)) { kobject_get(&sbinfo->si_kobj); sb = sbinfo->si_sb; break; } spin_unlock(&au_sbilist.spin); err = -EINVAL; if (unlikely(!sb)) goto out; err = au_plink_maint_enter(sb); if (!err) /* keep kobject_get() */ file->private_data = sbinfo; else kobject_put(&sbinfo->si_kobj); out: return err; }
static void sysrq_sb(struct super_block *sb) { char *plevel; struct au_sbinfo *sbinfo; struct file *file; plevel = au_plevel; au_plevel = KERN_WARNING; au_debug(1); sbinfo = au_sbi(sb); pr_warning("si=%lx\n", sysaufs_si_id(sbinfo)); pr_warning(AUFS_NAME ": superblock\n"); au_dpri_sb(sb); pr_warning(AUFS_NAME ": root dentry\n"); au_dpri_dentry(sb->s_root); pr_warning(AUFS_NAME ": root inode\n"); au_dpri_inode(sb->s_root->d_inode); #if 0 struct inode *i; pr_warning(AUFS_NAME ": isolated inode\n"); list_for_each_entry(i, &sb->s_inodes, i_sb_list) if (list_empty(&i->i_dentry)) au_dpri_inode(i); #endif pr_warning(AUFS_NAME ": files\n"); list_for_each_entry(file, &sb->s_files, f_u.fu_list) if (!special_file(file->f_dentry->d_inode->i_mode)) au_dpri_file(file); au_plevel = plevel; au_debug(0); }
int sysaufs_si_init(struct au_sbinfo *sbinfo) { int err; sbinfo->si_kobj.kset = sysaufs_kset; /* cf. sysaufs_name() */ err = kobject_init_and_add (&sbinfo->si_kobj, &au_sbi_ktype, /*&sysaufs_kset->kobj*/NULL, SysaufsSiNamePrefix "%lx", sysaufs_si_id(sbinfo)); dbgaufs_si_null(sbinfo); if (!err) { err = dbgaufs_si_init(sbinfo); if (unlikely(err)) kobject_put(&sbinfo->si_kobj); } return err; }