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

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

?? inode.c

?? elinux jffs初始版本 具體了解JFFS的文件系統(tǒng)!
?? C
字號(hào):
/* *  inode.c * *  Copyright (C) 1995, 1996 by Volker Lendecke * */#include <linux/module.h>#include <linux/config.h>#include <asm/system.h>#include <asm/segment.h>#include <linux/sched.h>#include <linux/ncp_fs.h>#include <linux/kernel.h>#include <linux/mm.h>#include <linux/string.h>#include <linux/stat.h>#include <linux/errno.h>#include <linux/locks.h>#include <linux/fcntl.h>#include <linux/malloc.h>#ifdef CONFIG_KERNELD#include <linux/kerneld.h>#endif#include "ncplib_kernel.h"extern int close_fp(struct file *filp);static void ncp_put_inode(struct inode *);static void ncp_read_inode(struct inode *);static void ncp_put_super(struct super_block *);static void ncp_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);static int ncp_notify_change(struct inode *inode, struct iattr *attr);static struct super_operations ncp_sops = {	ncp_read_inode,         /* read inode */	ncp_notify_change,	/* notify change */	NULL,			/* write inode */	ncp_put_inode,		/* put inode */	ncp_put_super,		/* put superblock */	NULL,			/* write superblock */	ncp_statfs,		/* stat filesystem */	NULL};/* ncp_read_inode: Called from iget, it only traverses the allocated   ncp_inode_info's and initializes the inode from the data found   there.  It does not allocate or deallocate anything. */static voidncp_read_inode(struct inode *inode){        /* Our task should be extremely simple here. We only have to           look up the information somebody else (ncp_iget) put into           the inode tree. The address of this information is the           inode->i_ino. Just to make sure everything went well, we           check it's there. */        struct ncp_inode_info *inode_info = ncp_find_inode(inode);	if (inode_info == NULL)	{		/* Ok, now we're in trouble. The inode info is not there. What		   should we do now??? */		printk("ncp_read_inode: inode info not found\n");		return;	}        inode_info->state = NCP_INODE_VALID;        NCP_INOP(inode) = inode_info;	inode_info->inode = inode;        if (NCP_ISTRUCT(inode)->attributes & aDIR)	{                inode->i_mode = NCP_SERVER(inode)->m.dir_mode;		/* for directories dataStreamSize seems to be some		   Object ID ??? */		inode->i_size = 512;	}	else	{                inode->i_mode = NCP_SERVER(inode)->m.file_mode;		inode->i_size = NCP_ISTRUCT(inode)->dataStreamSize;	}        DDPRINTK("ncp_read_inode: inode->i_mode = %u\n", inode->i_mode);        inode->i_nlink   = 1;        inode->i_uid     = NCP_SERVER(inode)->m.uid;        inode->i_gid     = NCP_SERVER(inode)->m.gid;        inode->i_blksize = 512;        inode->i_rdev    = 0;        if ((inode->i_blksize != 0) && (inode->i_size != 0))	{                inode->i_blocks =                        (inode->i_size - 1) / inode->i_blksize + 1;	}        else	{                inode->i_blocks = 0;	}	inode->i_mtime = ncp_date_dos2unix(NCP_ISTRUCT(inode)->modifyTime,					   NCP_ISTRUCT(inode)->modifyDate);	inode->i_ctime = ncp_date_dos2unix(NCP_ISTRUCT(inode)->creationTime,					   NCP_ISTRUCT(inode)->creationDate);	inode->i_atime = ncp_date_dos2unix(0,					   NCP_ISTRUCT(inode)->lastAccessDate);        if (S_ISREG(inode->i_mode))	{                inode->i_op = &ncp_file_inode_operations;	}        else if (S_ISDIR(inode->i_mode))	{                inode->i_op = &ncp_dir_inode_operations;	}        else	{                inode->i_op = NULL;	}}/* * Defer release of inode_info and file_info structures until the inode * has been cleared.  This avoids a race condition allowing the inode to  * be put back in use before being cleared. Also, temporarily increment * i_count after clear_inode() so that the inode can't be reused. */static voidncp_put_inode(struct inode *inode){	struct super_block	*sb	= inode->i_sb;	struct ncp_server	*server	= NCP_SERVER(inode);	struct ncp_inode_info	*iinfo	= NCP_INOP(inode);        struct nw_file_info	*finfo	= NCP_FINFO(inode);	/*	 * This operation may block, so we lock before checking the count.	 */	lock_super(sb);	if (inode->i_count > 1) {printk("ncp_put_inode: inode in use device %s, inode %ld, count=%ld\n", kdevname(inode->i_dev), inode->i_ino, inode->i_count);		goto unlock;	}		DDPRINTK("ncp_put_inode: put %s\n",		 finfo->i.entryName);	/*	 * This operation should never block.	 */        if (S_ISDIR(inode->i_mode))	{                DDPRINTK("ncp_put_inode: put directory %ld\n",			 inode->i_ino);                ncp_invalid_dir_cache(inode);        }                	clear_inode(inode);	/*	 * After clearing the inode i_count will be 0 in 2.0.xx kernels.	 * To keep the inode from being reused as free if we block while	 * closing the file, increment i_count temporarily.	 */	inode->i_count++;	if (finfo->opened != 0)	{		if (ncp_close_file(server, finfo->file_handle) != 0)		{			/* We can't do anything but complain. */			printk("ncp_put_inode: could not close %s\n",		 		finfo->i.entryName);		}	}	ncp_free_inode_info(iinfo);	inode->i_count--;		unlock:	unlock_super(sb);}struct super_block *ncp_read_super(struct super_block *sb, void *raw_data, int silent){	struct ncp_mount_data *data = (struct ncp_mount_data *) raw_data;        struct ncp_server *server;	struct file *ncp_filp;	struct file *wdog_filp;	struct file *msg_filp;	kdev_t dev = sb->s_dev;	int error;	if (data == NULL)	{		printk("ncp_read_super: missing data argument\n");		sb->s_dev = 0;		return NULL;	}	if (data->version != NCP_MOUNT_VERSION)	{		printk("ncp warning: mount version %s than kernel\n",		       (data->version < NCP_MOUNT_VERSION) ?                       "older" : "newer");		sb->s_dev = 0;		return NULL;	}	if (   (data->ncp_fd >= NR_OPEN)	    || ((ncp_filp = current->files->fd[data->ncp_fd]) == NULL)	    || (!S_ISSOCK(ncp_filp->f_inode->i_mode)))	{		printk("ncp_read_super: invalid ncp socket\n");		sb->s_dev = 0;		return NULL;	}	if (   (data->wdog_fd >= NR_OPEN)	    || ((wdog_filp = current->files->fd[data->wdog_fd]) == NULL)	    || (!S_ISSOCK(wdog_filp->f_inode->i_mode)))	{		printk("ncp_read_super: invalid wdog socket\n");		sb->s_dev = 0;		return NULL;	}	if (   (data->message_fd >= NR_OPEN)	    || ((msg_filp = current->files->fd[data->message_fd]) == NULL)	    || (!S_ISSOCK(msg_filp->f_inode->i_mode)))	{		printk("ncp_read_super: invalid wdog socket\n");		sb->s_dev = 0;		return NULL;	}        /* We must malloc our own super-block info */        server = (struct ncp_server *)ncp_kmalloc(sizeof(struct ncp_server),                                                   GFP_KERNEL);        if (server == NULL)	{                printk("ncp_read_super: could not alloc ncp_server\n");                return NULL;        }	ncp_filp->f_count += 1;	wdog_filp->f_count += 1;	msg_filp->f_count += 1;	lock_super(sb);        NCP_SBP(sb) = server;        	sb->s_blocksize = 1024; /* Eh...  Is this correct? */	sb->s_blocksize_bits = 10;	sb->s_magic = NCP_SUPER_MAGIC;	sb->s_dev = dev;	sb->s_op = &ncp_sops;	server->ncp_filp    = ncp_filp;	server->wdog_filp   = wdog_filp;	server->msg_filp    = msg_filp;	server->lock        = 0;	server->wait        = NULL;        server->packet      = NULL;	server->buffer_size = 0;	server->conn_status = 0;        server->m = *data;	server->m.file_mode = (server->m.file_mode &			       (S_IRWXU|S_IRWXG|S_IRWXO)) | S_IFREG;	server->m.dir_mode  = (server->m.dir_mode &			       (S_IRWXU|S_IRWXG|S_IRWXO)) | S_IFDIR;	/* protect against invalid mount points */	server->m.mount_point[sizeof(server->m.mount_point)-1] = '\0';	server->packet_size = NCP_PACKET_SIZE;	server->packet      = ncp_kmalloc(NCP_PACKET_SIZE, GFP_KERNEL);	if (server->packet == NULL)	{		printk("ncpfs: could not alloc packet\n");		error = -ENOMEM;		unlock_super(sb);		goto fail;	}           /*         * Make the connection to the server         */	if (ncp_catch_watchdog(server) != 0)	{		printk("ncp_read_super: Could not catch watchdog\n");		error = -EINVAL;		unlock_super(sb);		goto fail;	}	if (ncp_catch_message(server) != 0)	{		printk("ncp_read_super: Could not catch messages\n");		ncp_dont_catch_watchdog(server);		error = -EINVAL;		unlock_super(sb);		goto fail;	}	ncp_lock_server(server);	error = ncp_connect(server);	ncp_unlock_server(server);	unlock_super(sb);	if (error < 0)	{		sb->s_dev = 0;		printk("ncp_read_super: Failed connection, bailing out "                       "(error = %d).\n", -error);                ncp_kfree_s(server->packet, server->packet_size);		ncp_dont_catch_watchdog(server);                goto fail;	}        DPRINTK("ncp_read_super: NCP_SBP(sb) = %x\n", (int)NCP_SBP(sb));	ncp_init_root(server);	if (!(sb->s_mounted = iget(sb, ncp_info_ino(server, &(server->root)))))	{		sb->s_dev = 0;		printk("ncp_read_super: get root inode failed\n");                goto disconnect;	}	if (ncp_negotiate_buffersize(server, NCP_DEFAULT_BUFSIZE,				     &(server->buffer_size)) != 0)	{		sb->s_dev = 0;		printk("ncp_read_super: could not get bufsize\n");		goto disconnect;	}	DPRINTK("ncpfs: bufsize = %d\n", server->buffer_size);        MOD_INC_USE_COUNT;	return sb; disconnect:	ncp_lock_server(server);	ncp_disconnect(server);	ncp_unlock_server(server);	ncp_kfree_s(server->packet, server->packet_size);	ncp_dont_catch_watchdog(server); fail:	ncp_filp->f_count -= 1;	wdog_filp->f_count -= 1;	msg_filp->f_count -= 1;        ncp_kfree_s(NCP_SBP(sb), sizeof(struct ncp_server));        return NULL;}static voidncp_put_super(struct super_block *sb){        struct ncp_server *server = NCP_SBP(sb);	lock_super(sb);	ncp_lock_server(server);        ncp_disconnect(server);	ncp_unlock_server(server);	close_fp(server->ncp_filp);	ncp_dont_catch_watchdog(server);	close_fp(server->wdog_filp);	close_fp(server->msg_filp);        ncp_free_all_inodes(server);        ncp_kfree_s(server->packet, server->packet_size);	sb->s_dev = 0;        ncp_kfree_s(NCP_SBP(sb), sizeof(struct ncp_server));	NCP_SBP(sb) = NULL;	unlock_super(sb);        MOD_DEC_USE_COUNT;}/* This routine is called from an interrupt in ncp_msg_data_ready. So * we have to be careful NOT to sleep here! */voidncp_trigger_message(struct ncp_server *server){#ifdef CONFIG_KERNELD	char command[ sizeof(server->m.mount_point)		     + sizeof(NCP_MSG_COMMAND) + 2];#endif	if (server == NULL)	{		printk("ncp_trigger_message: invalid server!\n");		return;	}	DPRINTK("ncp_trigger_message: on %s\n",		server->m.mount_point);#ifdef CONFIG_KERNELD	strcpy(command, NCP_MSG_COMMAND);	strcat(command, " ");	strcat(command, server->m.mount_point);	DPRINTK("ksystem: %s\n", command);	ksystem(command, KERNELD_NOWAIT);#endif}static void ncp_statfs(struct super_block *sb, struct statfs *buf, int bufsiz){	struct statfs tmp;		/* We cannot say how much disk space is left on a mounted           NetWare Server, because free space is distributed over           volumes, and the current user might have disk quotas. So           free space is not that simple to determine. Our decision           here is to err conservatively. */	tmp.f_type = NCP_SUPER_MAGIC;	tmp.f_bsize = 512;	tmp.f_blocks = 0;	tmp.f_bfree = 0;	tmp.f_bavail = 0;	tmp.f_files = -1;	tmp.f_ffree = -1;	tmp.f_namelen = 12;	memcpy_tofs(buf, &tmp, bufsiz);}static intncp_notify_change(struct inode *inode, struct iattr *attr){	int result = 0;	int info_mask;	struct nw_modify_dos_info info;	if (!ncp_conn_valid(NCP_SERVER(inode)))	{		return -EIO;	}	if ((result = inode_change_ok(inode, attr)) < 0)		return result;	if (((attr->ia_valid & ATTR_UID) && 	     (attr->ia_uid != NCP_SERVER(inode)->m.uid)))		return -EPERM;	if (((attr->ia_valid & ATTR_GID) && 	     (attr->ia_uid != NCP_SERVER(inode)->m.gid)))                return -EPERM;	if (((attr->ia_valid & ATTR_MODE) &&	     (attr->ia_mode &	      ~(S_IFREG | S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO))))		return -EPERM;	info_mask = 0;	memset(&info, 0, sizeof(info));	if ((attr->ia_valid & ATTR_CTIME) != 0)	{		info_mask |= (DM_CREATE_TIME|DM_CREATE_DATE);		ncp_date_unix2dos(attr->ia_ctime,				  &(info.creationTime), &(info.creationDate));	}		if ((attr->ia_valid & ATTR_MTIME) != 0)	{		info_mask |= (DM_MODIFY_TIME|DM_MODIFY_DATE);		ncp_date_unix2dos(attr->ia_mtime,				  &(info.modifyTime), &(info.modifyDate));	}		if ((attr->ia_valid & ATTR_ATIME) != 0)	{		__u16 dummy;		info_mask |= (DM_LAST_ACCESS_DATE);		ncp_date_unix2dos(attr->ia_ctime,				  &(dummy), &(info.lastAccessDate));	}	if (info_mask != 0)	{		if ((result =		     ncp_modify_file_or_subdir_dos_info(NCP_SERVER(inode),							NCP_ISTRUCT(inode),							info_mask,							&info)) != 0)		{			result = -EACCES;			if (info_mask == (DM_CREATE_TIME|DM_CREATE_DATE))			{				/* NetWare seems not to allow this. I                                   do not know why. So, just tell the                                   user everything went fine. This is                                   a terrible hack, but I do not know                                   how to do this correctly. */				result = 0;			}		}	}        if ((attr->ia_valid & ATTR_SIZE) != 0)	{		int written;		DPRINTK("ncpfs: trying to change size of %s to %ld\n",			NCP_ISTRUCT(inode)->entryName, attr->ia_size);		if ((result = ncp_make_open(inode, O_RDWR)) < 0)		{			return -EACCES;		}		ncp_write(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle,			  attr->ia_size, 0, "", &written);		/* According to ndir, the changes only take effect after		   closing the file */		ncp_close_file(NCP_SERVER(inode),			       NCP_FINFO(inode)->file_handle);		NCP_FINFO(inode)->opened = 0;		result = 0;	}        ncp_invalid_dir_cache(NCP_INOP(inode)->dir->inode);	return result;}		#ifdef DEBUG_NCP_MALLOCint ncp_malloced;int ncp_current_malloced;#endifstatic struct file_system_type ncp_fs_type = {        ncp_read_super, "ncpfs", 0, NULL        };int init_ncp_fs(void){        return register_filesystem(&ncp_fs_type);}#ifdef MODULEintinit_module( void){	int status;        DPRINTK("ncpfs: init_module called\n");#ifdef DEBUG_NCP_MALLOC        ncp_malloced = 0;        ncp_current_malloced = 0;#endif        ncp_init_dir_cache();	if ((status = init_ncp_fs()) == 0)		register_symtab(0);	return status;}voidcleanup_module(void){        DPRINTK("ncpfs: cleanup_module called\n");        ncp_free_dir_cache();        unregister_filesystem(&ncp_fs_type);#ifdef DEBUG_NCP_MALLOC        printk("ncp_malloced: %d\n", ncp_malloced);        printk("ncp_current_malloced: %d\n", ncp_current_malloced);#endif}#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品男人天堂av| 亚洲摸摸操操av| 91国产成人在线| 国产一区二区成人久久免费影院 | 亚洲第一搞黄网站| 国产欧美精品一区| 91精品免费在线观看| 99视频在线精品| 国产精品综合一区二区三区| 天天综合网天天综合色| 亚洲女同一区二区| 国产网站一区二区三区| 日韩精品一区在线| 欧美日韩中文字幕一区| 99久久精品国产观看| 国产精品一区专区| 狠狠色狠狠色综合| 同产精品九九九| 亚洲欧美日本在线| 中文字幕日韩精品一区| 国产亚洲精品资源在线26u| 欧美一级精品大片| 91精品国产综合久久精品麻豆| 91美女片黄在线| 成av人片一区二区| 成人aaaa免费全部观看| 成人性生交大片免费看在线播放| 久久国产欧美日韩精品| 青青青伊人色综合久久| 亚洲成a人片在线观看中文| |精品福利一区二区三区| 中文字幕av不卡| 国产精品二三区| 国产精品国产三级国产| 国产精品视频一二三区 | 亚洲国产一区二区三区| 亚洲欧美偷拍三级| 亚洲欧美日韩中文播放| 日韩一区中文字幕| 玉米视频成人免费看| 亚洲日本护士毛茸茸| 综合久久国产九一剧情麻豆| 自拍视频在线观看一区二区| 亚洲免费三区一区二区| 亚洲在线一区二区三区| 香蕉av福利精品导航| 日产国产欧美视频一区精品| 青青草国产精品亚洲专区无| 美女爽到高潮91| 国产精品综合一区二区| 成人免费不卡视频| 色悠悠久久综合| 欧美视频一区二区三区在线观看| 欧美日韩大陆在线| 精品免费日韩av| 欧美极品另类videosde| 综合av第一页| 午夜精品久久久久久久久久 | 日韩精品一二三四| 蜜桃av一区二区在线观看| 国产一区二区视频在线播放| 丁香桃色午夜亚洲一区二区三区| 成人免费福利片| 欧美午夜影院一区| 精品国偷自产国产一区| 久久久久久综合| 国产精品免费丝袜| 亚洲精品国产无天堂网2021| 五月天亚洲婷婷| 国产99一区视频免费| 欧美性xxxxxxxx| 日韩精品一区二区三区中文不卡| 欧美激情一二三区| 午夜视频在线观看一区| 国产伦精品一区二区三区免费迷| av亚洲精华国产精华精华| 欧美日韩一区二区三区视频| 欧美成人精品1314www| 国产精品久久久久影院老司| 亚洲国产精品久久一线不卡| 国产一区二区三区高清播放| 日本高清视频一区二区| 欧美成人艳星乳罩| 一区二区三区中文字幕电影 | 久久久亚洲午夜电影| 一区二区三区国产精品| 九九九精品视频| 色天使色偷偷av一区二区| 久久免费午夜影院| 亚洲小说春色综合另类电影| 国产成人啪免费观看软件| 欧美手机在线视频| 国产精品女主播av| 免费观看91视频大全| 色久优优欧美色久优优| 国产亚洲婷婷免费| 日韩精品乱码免费| 91极品视觉盛宴| 久久久影视传媒| 免费日本视频一区| 欧美三级欧美一级| 亚洲欧美日韩一区二区| 国产九色sp调教91| 日韩一级黄色片| 亚洲香肠在线观看| av动漫一区二区| 久久天天做天天爱综合色| 日韩精品色哟哟| 在线看不卡av| 亚洲欧洲日产国码二区| 国产一区二区三区不卡在线观看 | www国产成人免费观看视频 深夜成人网| 亚洲激情图片一区| www.日韩av| 亚洲国产精品精华液2区45| 国产综合色视频| 日韩欧美www| 美女视频第一区二区三区免费观看网站| 91女厕偷拍女厕偷拍高清| 国产精品看片你懂得| 国产盗摄精品一区二区三区在线| 精品三级av在线| 久久国产精品色| 欧美一级片在线看| 亚洲va天堂va国产va久| 色欧美片视频在线观看| 中文字幕一区二区不卡| aaa欧美日韩| 国产精品理伦片| 99久久综合色| 亚洲同性gay激情无套| 成人av免费在线播放| 国产精品久久久久久久久图文区| 国产美女视频91| 国产婷婷色一区二区三区四区| 激情偷乱视频一区二区三区| 26uuu欧美日本| 精品一区二区久久| 久久综合色天天久久综合图片| 九九精品一区二区| 精品sm捆绑视频| 高清不卡在线观看av| 国产精品色噜噜| 99久久综合色| 亚洲综合成人在线| 欧美理论在线播放| 久久精品免费看| 亚洲精品在线三区| 国产一区二区精品久久91| 国产欧美日韩综合| 99久久精品国产一区| 亚洲综合视频在线观看| 欧美日韩1区2区| 狠狠色丁香婷婷综合| 精品国产乱码久久久久久浪潮| 国产精品一区免费在线观看| 亚洲欧洲一区二区在线播放| 欧美主播一区二区三区美女| 亚洲国产精品自拍| 日韩视频免费直播| 国产成人8x视频一区二区| 亚洲男人的天堂在线aⅴ视频| 欧美日韩一区二区在线观看| 全部av―极品视觉盛宴亚洲| 国产日韩欧美精品综合| 色综合一区二区三区| 日日噜噜夜夜狠狠视频欧美人| 日韩午夜av一区| 99这里都是精品| 午夜精品久久久久久久久久| 久久女同性恋中文字幕| 99麻豆久久久国产精品免费| 日韩成人精品在线| 久久久99精品久久| 欧美撒尿777hd撒尿| 国产在线不卡一区| 一区二区视频免费在线观看| 欧美大尺度电影在线| kk眼镜猥琐国模调教系列一区二区| 亚洲午夜在线观看视频在线| 久久新电视剧免费观看| 91美女在线看| 久88久久88久久久| 一区二区三区四区高清精品免费观看| 91精品啪在线观看国产60岁| av午夜一区麻豆| 国产中文一区二区三区| 一区二区三区四区不卡视频| 精品久久久久一区二区国产| 色综合久久精品| 国产馆精品极品| 日韩在线a电影| 亚洲图片另类小说| 2020日本不卡一区二区视频| 欧美三日本三级三级在线播放| 成人深夜在线观看| 久久91精品国产91久久小草| 亚洲在线观看免费视频| 国产精品狼人久久影院观看方式| 日韩精品影音先锋|