* disk (and so userspace sees correct data afterwards). * The reference to vfsmnt we are still holding protects us from * umount (we don't have it only when quotas are turned on/off for * journal replay but in that case we are guarded by the fs anyway). */ 
* disk (and so userspace sees correct data afterwards). */ 
int vfs_quota_off(struct super_block *sb, int type){	int cnt;	struct quota_info *dqopt = sb_dqopt(sb);	struct inode *toputinode[MAXQUOTAS];	struct vfsmount *toputmnt[MAXQUOTAS];	/* We need to serialize quota_off() for device */	down(&dqopt->dqonoff_sem);	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {		toputinode[cnt] = NULL;		toputmnt[cnt] = NULL;		if (type != -1 && cnt != type)			continue;		if (!sb_has_quota_enabled(sb, cnt))			continue;		reset_enable_flags(dqopt, cnt);		/* Note: these are blocking operations */		drop_dquot_ref(sb, cnt);		invalidate_dquots(sb, cnt);		/*		 * Now all dquots should be invalidated, all writes done so we should be only		 * users of the info. No locks needed.		 */		if (info_dirty(&dqopt->info[cnt]))			sb->dq_op->write_info(sb, cnt);		if (dqopt->ops[cnt]->free_file_info)			dqopt->ops[cnt]->free_file_info(sb, cnt);		put_quota_format(dqopt->info[cnt].dqi_format);		toputinode[cnt] = dqopt->files[cnt];		toputmnt[cnt] = dqopt->mnt[cnt];		dqopt->files[cnt] = NULL;		dqopt->mnt[cnt] = NULL;		dqopt->info[cnt].dqi_flags = 0;		dqopt->info[cnt].dqi_igrace = 0;		dqopt->info[cnt].dqi_bgrace = 0;		dqopt->ops[cnt] = NULL;	}	up(&dqopt->dqonoff_sem);	/* Sync the superblock so that buffers with quota data are written to	 * disk (and so userspace sees correct data afterwards).	 * The reference to vfsmnt we are still holding protects us from	 * umount (we don't have it only when quotas are turned on/off for	 * journal replay but in that case we are guarded by the fs anyway). */	if (sb->s_op->sync_fs)		sb->s_op->sync_fs(sb, 1);	sync_blockdev(sb->s_bdev);	/* Now the quota files are just ordinary files and we can set the	 * inode flags back. Moreover we discard the pagecache so that	 * userspace sees the writes we did bypassing the pagecache. We	 * must also discard the blockdev buffers so that we see the	 * changes done by userspace on the next quotaon() */	for (cnt = 0; cnt < MAXQUOTAS; cnt++)		if (toputinode[cnt]) {			down(&dqopt->dqonoff_sem);			/* If quota was reenabled in the meantime, we have			 * nothing to do */			if (!sb_has_quota_enabled(sb, cnt)) {				down(&toputinode[cnt]->i_sem);				toputinode[cnt]->i_flags &= ~(S_IMMUTABLE |				  S_NOATIME | S_NOQUOTA);				truncate_inode_pages(&toputinode[cnt]->i_data, 0);				up(&toputinode[cnt]->i_sem);				mark_inode_dirty(toputinode[cnt]);				iput(toputinode[cnt]);			}			up(&dqopt->dqonoff_sem);			/* We don't hold the reference when we turned on quotas			 * just for the journal replay... */			if (toputmnt[cnt])				mntput(toputmnt[cnt]);		}	if (sb->s_bdev)		invalidate_bdev(sb->s_bdev, 0);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7b7b1ace2d9d06d76bce7481a045c22ed75e35dd/dquot.c/clean/fs/dquot.c