亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? xfs_qm_syscalls.c

?? 優(yōu)龍2410linux2.6.8內(nèi)核源代碼
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/* * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Further, this software is distributed without any warranty that it is * free of the rightful claim of any third person regarding infringement * or the like.	 Any license provided herein, whether implied or * otherwise, applies only to this software file.  Patent licenses, if * any, provided herein do not apply to combinations of this program with * other software, or any other product whatsoever. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. * * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, * Mountain View, CA  94043, or: * * http://www.sgi.com * * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */#include "xfs.h"#include "xfs_fs.h"#include "xfs_inum.h"#include "xfs_log.h"#include "xfs_trans.h"#include "xfs_sb.h"#include "xfs_dir.h"#include "xfs_dir2.h"#include "xfs_alloc.h"#include "xfs_dmapi.h"#include "xfs_quota.h"#include "xfs_mount.h"#include "xfs_alloc_btree.h"#include "xfs_bmap_btree.h"#include "xfs_ialloc_btree.h"#include "xfs_btree.h"#include "xfs_ialloc.h"#include "xfs_attr_sf.h"#include "xfs_dir_sf.h"#include "xfs_dir2_sf.h"#include "xfs_dinode.h"#include "xfs_inode.h"#include "xfs_bmap.h"#include "xfs_bit.h"#include "xfs_rtalloc.h"#include "xfs_error.h"#include "xfs_itable.h"#include "xfs_rw.h"#include "xfs_acl.h"#include "xfs_cap.h"#include "xfs_mac.h"#include "xfs_attr.h"#include "xfs_buf_item.h"#include "xfs_utils.h"#include "xfs_qm.h"#ifdef DEBUG# define qdprintk(s, args...)	cmn_err(CE_DEBUG, s, ## args)#else# define qdprintk(s, args...)	do { } while (0)#endifSTATIC int	xfs_qm_scall_trunc_qfiles(xfs_mount_t *, uint);STATIC int	xfs_qm_scall_getquota(xfs_mount_t *, xfs_dqid_t, uint,					fs_disk_quota_t *);STATIC int	xfs_qm_scall_getqstat(xfs_mount_t *, fs_quota_stat_t *);STATIC int	xfs_qm_scall_setqlim(xfs_mount_t *, xfs_dqid_t, uint,					fs_disk_quota_t *);STATIC int	xfs_qm_scall_quotaon(xfs_mount_t *, uint);STATIC int	xfs_qm_scall_quotaoff(xfs_mount_t *, uint, boolean_t);STATIC int	xfs_qm_log_quotaoff(xfs_mount_t *, xfs_qoff_logitem_t **, uint);STATIC int	xfs_qm_log_quotaoff_end(xfs_mount_t *, xfs_qoff_logitem_t *,					uint);STATIC uint	xfs_qm_import_flags(uint);STATIC uint	xfs_qm_export_flags(uint);STATIC uint	xfs_qm_import_qtype_flags(uint);STATIC uint	xfs_qm_export_qtype_flags(uint);STATIC void	xfs_qm_export_dquot(xfs_mount_t *, xfs_disk_dquot_t *,					fs_disk_quota_t *);/* * The main distribution switch of all XFS quotactl system calls. */intxfs_qm_quotactl(	struct bhv_desc *bdp,	int		cmd,	int		id,	xfs_caddr_t	addr){	xfs_mount_t	*mp;	int		error;	struct vfs	*vfsp;	vfsp = bhvtovfs(bdp);	mp = XFS_VFSTOM(vfsp);	if (addr == NULL && cmd != Q_SYNC)		return XFS_ERROR(EINVAL);	if (id < 0 && cmd != Q_SYNC)		return XFS_ERROR(EINVAL);	/*	 * The following commands are valid even when quotaoff.	 */	switch (cmd) {		/*		 * truncate quota files. quota must be off.		 */	      case Q_XQUOTARM:		if (XFS_IS_QUOTA_ON(mp) || addr == NULL)			return XFS_ERROR(EINVAL);		if (vfsp->vfs_flag & VFS_RDONLY)			return XFS_ERROR(EROFS);		return (xfs_qm_scall_trunc_qfiles(mp,			       xfs_qm_import_qtype_flags(*(uint *)addr)));		/*		 * Get quota status information.		 */	      case Q_XGETQSTAT:		return (xfs_qm_scall_getqstat(mp, (fs_quota_stat_t *)addr));		/*		 * QUOTAON for root f/s and quota enforcement on others..		 * Quota accounting for non-root f/s's must be turned on		 * at mount time.		 */	      case Q_XQUOTAON:		if (addr == NULL)			return XFS_ERROR(EINVAL);		if (vfsp->vfs_flag & VFS_RDONLY)			return XFS_ERROR(EROFS);		return (xfs_qm_scall_quotaon(mp,					  xfs_qm_import_flags(*(uint *)addr)));	      case Q_XQUOTAOFF:		if (vfsp->vfs_flag & VFS_RDONLY)			return XFS_ERROR(EROFS);		break;	      default:		break;	}	if (! XFS_IS_QUOTA_ON(mp))		return XFS_ERROR(ESRCH);	switch (cmd) {	      case Q_XQUOTAOFF:		if (vfsp->vfs_flag & VFS_RDONLY)			return XFS_ERROR(EROFS);		error = xfs_qm_scall_quotaoff(mp,					    xfs_qm_import_flags(*(uint *)addr),					    B_FALSE);		break;		/*		 * Defaults to XFS_GETUQUOTA.		 */	      case Q_XGETQUOTA:		error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_USER,					(fs_disk_quota_t *)addr);		break;		/*		 * Set limits, both hard and soft. Defaults to Q_SETUQLIM.		 */	      case Q_XSETQLIM:		if (vfsp->vfs_flag & VFS_RDONLY)			return XFS_ERROR(EROFS);		error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_USER,					     (fs_disk_quota_t *)addr);		break;	       case Q_XSETGQLIM:		if (vfsp->vfs_flag & VFS_RDONLY)			return XFS_ERROR(EROFS);		error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_GROUP,					     (fs_disk_quota_t *)addr);		break;	      case Q_XGETGQUOTA:		error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_GROUP,					(fs_disk_quota_t *)addr);		break;		/*		 * Quotas are entirely undefined after quotaoff in XFS quotas.		 * For instance, there's no way to set limits when quotaoff.		 */	      default:		error = XFS_ERROR(EINVAL);		break;	}	return (error);}/* * Turn off quota accounting and/or enforcement for all udquots and/or * gdquots. Called only at unmount time. * * This assumes that there are no dquots of this file system cached * incore, and modifies the ondisk dquot directly. Therefore, for example, * it is an error to call this twice, without purging the cache. */STATIC intxfs_qm_scall_quotaoff(	xfs_mount_t		*mp,	uint			flags,	boolean_t		force){	uint			dqtype;	unsigned long	s;	int			error;	uint			inactivate_flags;	xfs_qoff_logitem_t	*qoffstart;	int			nculprits;	if (!force && !capable(CAP_SYS_ADMIN))		return XFS_ERROR(EPERM);	/*	 * No file system can have quotas enabled on disk but not in core.	 * Note that quota utilities (like quotaoff) _expect_	 * errno == EEXIST here.	 */	if ((mp->m_qflags & flags) == 0)		return XFS_ERROR(EEXIST);	error = 0;	flags &= (XFS_ALL_QUOTA_ACCT | XFS_ALL_QUOTA_ENFD);	/*	 * We don't want to deal with two quotaoffs messing up each other,	 * so we're going to serialize it. quotaoff isn't exactly a performance	 * critical thing.	 * If quotaoff, then we must be dealing with the root filesystem.	 */	ASSERT(mp->m_quotainfo);	if (mp->m_quotainfo)		mutex_lock(&(XFS_QI_QOFFLOCK(mp)), PINOD);	ASSERT(mp->m_quotainfo);	/*	 * If we're just turning off quota enforcement, change mp and go.	 */	if ((flags & XFS_ALL_QUOTA_ACCT) == 0) {		mp->m_qflags &= ~(flags);		s = XFS_SB_LOCK(mp);		mp->m_sb.sb_qflags = mp->m_qflags;		XFS_SB_UNLOCK(mp, s);		mutex_unlock(&(XFS_QI_QOFFLOCK(mp)));		/* XXX what to do if error ? Revert back to old vals incore ? */		error = xfs_qm_write_sb_changes(mp, XFS_SB_QFLAGS);		return (error);	}	dqtype = 0;	inactivate_flags = 0;	/*	 * If accounting is off, we must turn enforcement off, clear the	 * quota 'CHKD' certificate to make it known that we have to	 * do a quotacheck the next time this quota is turned on.	 */	if (flags & XFS_UQUOTA_ACCT) {		dqtype |= XFS_QMOPT_UQUOTA;		flags |= (XFS_UQUOTA_CHKD | XFS_UQUOTA_ENFD);		inactivate_flags |= XFS_UQUOTA_ACTIVE;	}	if (flags & XFS_GQUOTA_ACCT) {		dqtype |= XFS_QMOPT_GQUOTA;		flags |= (XFS_GQUOTA_CHKD | XFS_GQUOTA_ENFD);		inactivate_flags |= XFS_GQUOTA_ACTIVE;	}	/*	 * Nothing to do?  Don't complain. This happens when we're just	 * turning off quota enforcement.	 */	if ((mp->m_qflags & flags) == 0) {		mutex_unlock(&(XFS_QI_QOFFLOCK(mp)));		return (0);	}	/*	 * Write the LI_QUOTAOFF log record, and do SB changes atomically,	 * and synchronously.	 */	xfs_qm_log_quotaoff(mp, &qoffstart, flags);	/*	 * Next we clear the XFS_MOUNT_*DQ_ACTIVE bit(s) in the mount struct	 * to take care of the race between dqget and quotaoff. We don't take	 * any special locks to reset these bits. All processes need to check	 * these bits *after* taking inode lock(s) to see if the particular	 * quota type is in the process of being turned off. If *ACTIVE, it is	 * guaranteed that all dquot structures and all quotainode ptrs will all	 * stay valid as long as that inode is kept locked.	 *	 * There is no turning back after this.	 */	mp->m_qflags &= ~inactivate_flags;	/*	 * Give back all the dquot reference(s) held by inodes.	 * Here we go thru every single incore inode in this file system, and	 * do a dqrele on the i_udquot/i_gdquot that it may have.	 * Essentially, as long as somebody has an inode locked, this guarantees	 * that quotas will not be turned off. This is handy because in a	 * transaction once we lock the inode(s) and check for quotaon, we can	 * depend on the quota inodes (and other things) being valid as long as	 * we keep the lock(s).	 */	xfs_qm_dqrele_all_inodes(mp, flags);	/*	 * Next we make the changes in the quota flag in the mount struct.	 * This isn't protected by a particular lock directly, because we	 * don't want to take a mrlock everytime we depend on quotas being on.	 */	mp->m_qflags &= ~(flags);	/*	 * Go through all the dquots of this file system and purge them,	 * according to what was turned off. We may not be able to get rid	 * of all dquots, because dquots can have temporary references that	 * are not attached to inodes. eg. xfs_setattr, xfs_create.	 * So, if we couldn't purge all the dquots from the filesystem,	 * we can't get rid of the incore data structures.	 */	while ((nculprits = xfs_qm_dqpurge_all(mp, dqtype|XFS_QMOPT_QUOTAOFF)))		delay(10 * nculprits);	/*	 * Transactions that had started before ACTIVE state bit was cleared	 * could have logged many dquots, so they'd have higher LSNs than	 * the first QUOTAOFF log record does. If we happen to crash when	 * the tail of the log has gone past the QUOTAOFF record, but	 * before the last dquot modification, those dquots __will__	 * recover, and that's not good.	 *	 * So, we have QUOTAOFF start and end logitems; the start	 * logitem won't get overwritten until the end logitem appears...	 */	xfs_qm_log_quotaoff_end(mp, qoffstart, flags);	/*	 * If quotas is completely disabled, close shop.	 */	if ((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_ALL) {		mutex_unlock(&(XFS_QI_QOFFLOCK(mp)));		xfs_qm_destroy_quotainfo(mp);		return (0);	}	/*	 * Release our quotainode references, and vn_purge them,	 * if we don't need them anymore.	 */	if ((dqtype & XFS_QMOPT_UQUOTA) && XFS_QI_UQIP(mp)) {		XFS_PURGE_INODE(XFS_QI_UQIP(mp));		XFS_QI_UQIP(mp) = NULL;	}	if ((dqtype & XFS_QMOPT_GQUOTA) && XFS_QI_GQIP(mp)) {		XFS_PURGE_INODE(XFS_QI_GQIP(mp));		XFS_QI_GQIP(mp) = NULL;	}	mutex_unlock(&(XFS_QI_QOFFLOCK(mp)));	return (error);}STATIC intxfs_qm_scall_trunc_qfiles(	xfs_mount_t	*mp,	uint		flags){	int		error;	xfs_inode_t	*qip;	if (!capable(CAP_SYS_ADMIN))		return XFS_ERROR(EPERM);	error = 0;	if (!XFS_SB_VERSION_HASQUOTA(&mp->m_sb) || flags == 0) {		qdprintk("qtrunc flags=%x m_qflags=%x\n", flags, mp->m_qflags);		return XFS_ERROR(EINVAL);	}	if ((flags & XFS_DQ_USER) && mp->m_sb.sb_uquotino != NULLFSINO) {		error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, 0, &qip, 0);		if (! error) {			(void) xfs_truncate_file(mp, qip);			VN_RELE(XFS_ITOV(qip));		}	}	if ((flags & XFS_DQ_GROUP) && mp->m_sb.sb_gquotino != NULLFSINO) {		error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 0, &qip, 0);		if (! error) {			(void) xfs_truncate_file(mp, qip);			VN_RELE(XFS_ITOV(qip));		}	}	return (error);}/* * Switch on (a given) quota enforcement for a filesystem.  This takes * effect immediately. * (Switching on quota accounting must be done at mount time.) */STATIC intxfs_qm_scall_quotaon(	xfs_mount_t	*mp,	uint		flags){	int		error;	unsigned long s;	uint		qf;	uint		accflags;	__int64_t	sbflags;	if (!capable(CAP_SYS_ADMIN))		return XFS_ERROR(EPERM);	flags &= (XFS_ALL_QUOTA_ACCT | XFS_ALL_QUOTA_ENFD);	/*	 * Switching on quota accounting must be done at mount time.	 */	accflags = flags & XFS_ALL_QUOTA_ACCT;	flags &= ~(XFS_ALL_QUOTA_ACCT);	sbflags = 0;	if (flags == 0) {		qdprintk("quotaon: zero flags, m_qflags=%x\n", mp->m_qflags);		return XFS_ERROR(EINVAL);	}	/* No fs can turn on quotas with a delayed effect */	ASSERT((flags & XFS_ALL_QUOTA_ACCT) == 0);	/*	 * Can't enforce without accounting. We check the superblock	 * qflags here instead of m_qflags because rootfs can have	 * quota acct on ondisk without m_qflags' knowing.	 */	if (((flags & XFS_UQUOTA_ACCT) == 0 &&	    (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 &&	    (flags & XFS_UQUOTA_ENFD))	    ||	    ((flags & XFS_GQUOTA_ACCT) == 0 &&	    (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 &&	    (flags & XFS_GQUOTA_ENFD))) {		qdprintk("Can't enforce without acct, flags=%x sbflags=%x\n",			flags, mp->m_sb.sb_qflags);		return XFS_ERROR(EINVAL);	}	/*	 * If everything's upto-date incore, then don't waste time.	 */	if ((mp->m_qflags & flags) == flags)		return XFS_ERROR(EEXIST);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日产精品1区| 欧美国产一区视频在线观看| 九九**精品视频免费播放| 久久精子c满五个校花| 色av成人天堂桃色av| 亚洲一区二区成人在线观看| 日韩欧美的一区| av电影在线观看不卡| 午夜欧美电影在线观看| 久久久久久久久岛国免费| 国产成人精品1024| 婷婷一区二区三区| 国产精品久久一级| 日韩限制级电影在线观看| 成人网页在线观看| 日本欧美一区二区| 久久婷婷成人综合色| 在线观看日韩精品| 国产精品77777| 日本不卡不码高清免费观看| 亚洲三级小视频| 欧美精品一区二区不卡 | 人禽交欧美网站| 国产欧美日韩亚州综合| 69堂成人精品免费视频| av电影在线观看不卡| 国产一区二区导航在线播放| 一级日本不卡的影视| 欧美白人最猛性xxxxx69交| 在线精品视频免费播放| 成人avav在线| 成人综合在线网站| 久久国产日韩欧美精品| 亚洲国产日韩在线一区模特| 欧美韩国日本一区| 欧美va亚洲va香蕉在线| 在线不卡欧美精品一区二区三区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 日韩免费成人网| 欧美日韩国产a| 在线免费观看日韩欧美| 91亚洲国产成人精品一区二区三| 国产成人在线色| 蜜桃av噜噜一区| 日韩国产高清影视| 亚洲电影在线播放| 一区二区三区成人| 亚洲精品中文在线观看| 国产欧美一区二区在线观看| 久久久亚洲高清| 国产色产综合色产在线视频| 久久蜜桃av一区二区天堂| 日韩欧美一级二级三级久久久| 欧美三区在线观看| 欧美唯美清纯偷拍| 91激情在线视频| 99久久精品免费观看| 99综合电影在线视频| 97精品电影院| 在线免费观看日本欧美| 欧美人体做爰大胆视频| 欧美偷拍一区二区| 欧美精品粉嫩高潮一区二区| 欧美日韩国产a| 欧美一二区视频| 日韩欧美一二三| 久久久www免费人成精品| 久久精品男人天堂av| 国产精品成人午夜| 亚洲精品国产无天堂网2021| 亚洲人成在线播放网站岛国| 一区二区在线观看不卡| 日日摸夜夜添夜夜添国产精品 | 高潮精品一区videoshd| av男人天堂一区| 欧美日韩一区小说| 91精品麻豆日日躁夜夜躁| 欧美日韩国产a| 精品日韩成人av| 国产精品久久三区| 亚洲国产精品久久人人爱蜜臀| 性久久久久久久久| 久久国产麻豆精品| 久久精品国产成人一区二区三区| 久久99最新地址| 99re热这里只有精品视频| 欧美伊人久久久久久午夜久久久久| 欧美色欧美亚洲另类二区| 欧美va亚洲va在线观看蝴蝶网| 国产欧美一区二区精品性色| 亚洲精品v日韩精品| 免费欧美日韩国产三级电影| 国产成人鲁色资源国产91色综| 97国产一区二区| 欧美一区二区三区免费| 亚洲黄色尤物视频| 国产成人精品1024| 欧美一二三四区在线| 亚洲一区中文日韩| 成人99免费视频| 日韩欧美成人一区| 亚洲二区在线视频| 91污片在线观看| 国产欧美一区二区三区鸳鸯浴| 婷婷成人激情在线网| 97久久久精品综合88久久| 精品国产免费久久| 日本成人中文字幕在线视频| 一本到三区不卡视频| 国产精品欧美综合在线| 国产一区二区毛片| 精品人在线二区三区| 天天操天天色综合| 欧洲精品一区二区三区在线观看| 国产欧美精品一区aⅴ影院| 麻豆精品在线播放| 6080国产精品一区二区| 一区二区三区国产豹纹内裤在线| 成人激情免费电影网址| 国产欧美日韩在线看| 国产传媒日韩欧美成人| 久久久久久久久99精品| 国产一区二区不卡老阿姨| 日韩片之四级片| 青青草国产成人av片免费| 欧美色电影在线| 亚洲h精品动漫在线观看| 在线观看视频91| 亚洲国产欧美在线| 欧美日韩一区二区电影| 午夜精品久久久久久久久| 精品视频一区二区不卡| 亚瑟在线精品视频| 91精品国产福利| 日韩不卡手机在线v区| 欧美精品视频www在线观看| 午夜精品在线看| 欧美日韩激情一区二区| 午夜精品福利一区二区三区av| 91成人网在线| 亚洲成人激情av| 欧美日韩视频专区在线播放| 亚洲国产一区视频| 精品视频色一区| 美腿丝袜亚洲一区| 久久久久久久综合狠狠综合| 国产高清精品网站| 18欧美乱大交hd1984| 91九色最新地址| 日韩二区三区四区| 精品蜜桃在线看| 国产精品一区二区久激情瑜伽| 国产精品久99| 91国在线观看| 男男视频亚洲欧美| 久久精品男人天堂av| 91热门视频在线观看| 亚洲一区二区视频在线| 在线成人av网站| 国产激情一区二区三区四区| 中文字幕在线一区二区三区| 91国产丝袜在线播放| 美女mm1313爽爽久久久蜜臀| 精品福利一二区| caoporm超碰国产精品| 亚洲国产精品一区二区www在线| 日韩免费看的电影| av午夜一区麻豆| 日韩极品在线观看| 国产肉丝袜一区二区| 91黄色激情网站| 裸体歌舞表演一区二区| 国产欧美日韩另类一区| 欧美亚洲国产bt| 国产在线乱码一区二区三区| 亚洲丝袜制服诱惑| 日韩一级完整毛片| av一区二区久久| 蜜桃久久久久久久| 亚洲理论在线观看| 精品国内二区三区| 欧美性感一类影片在线播放| 国产一区二区0| 性感美女久久精品| 国产精品人成在线观看免费| 91麻豆精品国产自产在线观看一区 | 91丝袜美腿高跟国产极品老师 | 欧美日韩国产一级| 国产主播一区二区| 亚洲一级二级在线| 久久久国产精品午夜一区ai换脸| 在线观看一区不卡| 国产在线播精品第三| 亚洲一二三级电影| 国产日韩欧美一区二区三区综合 | 中文字幕不卡的av| 91精品国产丝袜白色高跟鞋| 337p粉嫩大胆噜噜噜噜噜91av| 99精品热视频| 激情av综合网|