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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? journal.c

?? ocfs1.4.1 oracle分布式文件系統
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* -*- mode: c; c-basic-offset: 8; -*- * vim: noexpandtab sw=8 ts=8 sts=0: * * journal.c * * Defines functions of journalling api * * Copyright (C) 2003, 2004 Oracle.  All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 021110-1307, USA. */#include <linux/fs.h>#include <linux/types.h>#include <linux/slab.h>#include <linux/highmem.h>#include <linux/kthread.h>#define MLOG_MASK_PREFIX ML_JOURNAL#include <cluster/masklog.h>#include "ocfs2.h"#include "alloc.h"#include "dir.h"#include "dlmglue.h"#include "extent_map.h"#include "heartbeat.h"#include "inode.h"#include "journal.h"#include "localalloc.h"#include "slot_map.h"#include "super.h"#include "sysfile.h"#include "buffer_head_io.h"DEFINE_SPINLOCK(trans_inc_lock);static int ocfs2_force_read_journal(struct inode *inode);static int ocfs2_recover_node(struct ocfs2_super *osb,			      int node_num);static int __ocfs2_recovery_thread(void *arg);static int ocfs2_commit_cache(struct ocfs2_super *osb);static int ocfs2_wait_on_mount(struct ocfs2_super *osb);static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,				      int dirty, int replayed);static int ocfs2_trylock_journal(struct ocfs2_super *osb,				 int slot_num);static int ocfs2_recover_orphans(struct ocfs2_super *osb,				 int slot);static int ocfs2_commit_thread(void *arg);static int ocfs2_commit_cache(struct ocfs2_super *osb){	int status = 0;	unsigned int flushed;	unsigned long old_id;	struct ocfs2_journal *journal = NULL;	mlog_entry_void();	journal = osb->journal;	/* Flush all pending commits and checkpoint the journal. */	down_write(&journal->j_trans_barrier);	if (atomic_read(&journal->j_num_trans) == 0) {		up_write(&journal->j_trans_barrier);		mlog(0, "No transactions for me to flush!\n");		goto finally;	}	journal_lock_updates(journal->j_journal);	status = journal_flush(journal->j_journal);	journal_unlock_updates(journal->j_journal);	if (status < 0) {		up_write(&journal->j_trans_barrier);		mlog_errno(status);		goto finally;	}	old_id = ocfs2_inc_trans_id(journal);	flushed = atomic_read(&journal->j_num_trans);	atomic_set(&journal->j_num_trans, 0);	up_write(&journal->j_trans_barrier);	mlog(0, "commit_thread: flushed transaction %lu (%u handles)\n",	     journal->j_trans_id, flushed);	ocfs2_wake_downconvert_thread(osb);	wake_up(&journal->j_checkpointed);finally:	mlog_exit(status);	return status;}/* pass it NULL and it will allocate a new handle object for you.  If * you pass it a handle however, it may still return error, in which * case it has free'd the passed handle for you. */handle_t *ocfs2_start_trans(struct ocfs2_super *osb, int max_buffs){	journal_t *journal = osb->journal->j_journal;	handle_t *handle;	BUG_ON(!osb || !osb->journal->j_journal);	if (ocfs2_is_hard_readonly(osb))		return ERR_PTR(-EROFS);	BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE);	BUG_ON(max_buffs <= 0);	/* JBD might support this, but our journalling code doesn't yet. */	if (journal_current_handle()) {		mlog(ML_ERROR, "Recursive transaction attempted!\n");		BUG();	}	down_read(&osb->journal->j_trans_barrier);	handle = journal_start(journal, max_buffs);	if (IS_ERR(handle)) {		up_read(&osb->journal->j_trans_barrier);		mlog_errno(PTR_ERR(handle));		if (is_journal_aborted(journal)) {			ocfs2_abort(osb->sb, "Detected aborted journal");			handle = ERR_PTR(-EROFS);		}	} else {		if (!ocfs2_mount_local(osb))			atomic_inc(&(osb->journal->j_num_trans));	}	return handle;}int ocfs2_commit_trans(struct ocfs2_super *osb,		       handle_t *handle){	int ret;	struct ocfs2_journal *journal = osb->journal;	BUG_ON(!handle);	ret = journal_stop(handle);	if (ret < 0)		mlog_errno(ret);	up_read(&journal->j_trans_barrier);	return ret;}/* * 'nblocks' is what you want to add to the current * transaction. extend_trans will either extend the current handle by * nblocks, or commit it and start a new one with nblocks credits. * * This might call journal_restart() which will commit dirty buffers * and then restart the transaction. Before calling * ocfs2_extend_trans(), any changed blocks should have been * dirtied. After calling it, all blocks which need to be changed must * go through another set of journal_access/journal_dirty calls. * * WARNING: This will not release any semaphores or disk locks taken * during the transaction, so make sure they were taken *before* * start_trans or we'll have ordering deadlocks. * * WARNING2: Note that we do *not* drop j_trans_barrier here. This is * good because transaction ids haven't yet been recorded on the * cluster locks associated with this handle. */int ocfs2_extend_trans(handle_t *handle, int nblocks){	int status;	BUG_ON(!handle);	BUG_ON(!nblocks);	mlog_entry_void();	mlog(0, "Trying to extend transaction by %d blocks\n", nblocks);#ifdef CONFIG_OCFS2_DEBUG_FS	status = 1;#else	status = journal_extend(handle, nblocks);	if (status < 0) {		mlog_errno(status);		goto bail;	}#endif	if (status > 0) {		mlog(0, "journal_extend failed, trying journal_restart\n");		status = journal_restart(handle, nblocks);		if (status < 0) {			mlog_errno(status);			goto bail;		}	}	status = 0;bail:	mlog_exit(status);	return status;}int ocfs2_journal_access(handle_t *handle,			 struct inode *inode,			 struct buffer_head *bh,			 int type){	int status;	BUG_ON(!inode);	BUG_ON(!handle);	BUG_ON(!bh);	mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = "#ifdef B_SIZE_IS_U32		   "%u\n",#else		   "%zu\n",#endif		   (unsigned long long)bh->b_blocknr, type,		   (type == OCFS2_JOURNAL_ACCESS_CREATE) ?		   "OCFS2_JOURNAL_ACCESS_CREATE" :		   "OCFS2_JOURNAL_ACCESS_WRITE",		   bh->b_size);	/* we can safely remove this assertion after testing. */	if (!buffer_uptodate(bh)) {		mlog(ML_ERROR, "giving me a buffer that's not uptodate!\n");		mlog(ML_ERROR, "b_blocknr=%llu\n",		     (unsigned long long)bh->b_blocknr);		BUG();	}	/* Set the current transaction information on the inode so	 * that the locking code knows whether it can drop it's locks	 * on this inode or not. We're protected from the commit	 * thread updating the current transaction id until	 * ocfs2_commit_trans() because ocfs2_start_trans() took	 * j_trans_barrier for us. */	ocfs2_set_inode_lock_trans(OCFS2_SB(inode->i_sb)->journal, inode);	mutex_lock(&OCFS2_I(inode)->ip_io_mutex);	switch (type) {	case OCFS2_JOURNAL_ACCESS_CREATE:	case OCFS2_JOURNAL_ACCESS_WRITE:		status = journal_get_write_access(handle, bh);		break;	case OCFS2_JOURNAL_ACCESS_UNDO:		status = journal_get_undo_access(handle, bh);		break;	default:		status = -EINVAL;		mlog(ML_ERROR, "Uknown access type!\n");	}	mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);	if (status < 0)		mlog(ML_ERROR, "Error %d getting %d access to buffer!\n",		     status, type);	mlog_exit(status);	return status;}int ocfs2_journal_dirty(handle_t *handle,			struct buffer_head *bh){	int status;	mlog_entry("(bh->b_blocknr=%llu)\n",		   (unsigned long long)bh->b_blocknr);	status = journal_dirty_metadata(handle, bh);	if (status < 0)		mlog(ML_ERROR, "Could not dirty metadata buffer. "		     "(bh->b_blocknr=%llu)\n",		     (unsigned long long)bh->b_blocknr);	mlog_exit(status);	return status;}int ocfs2_journal_dirty_data(handle_t *handle,			     struct buffer_head *bh){	int err = journal_dirty_data(handle, bh);	if (err)		mlog_errno(err);	/* TODO: When we can handle it, abort the handle and go RO on	 * error here. */	return err;}#define OCFS2_DEFAULT_COMMIT_INTERVAL 	(HZ * JBD_DEFAULT_MAX_COMMIT_AGE)void ocfs2_set_journal_params(struct ocfs2_super *osb){	journal_t *journal = osb->journal->j_journal;	unsigned long commit_interval = OCFS2_DEFAULT_COMMIT_INTERVAL;	if (osb->osb_commit_interval)		commit_interval = osb->osb_commit_interval;	spin_lock(&journal->j_state_lock);	journal->j_commit_interval = commit_interval;	if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER)		journal->j_flags |= JFS_BARRIER;	else		journal->j_flags &= ~JFS_BARRIER;	spin_unlock(&journal->j_state_lock);}int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty){	int status = -1;	struct inode *inode = NULL; /* the journal inode */	journal_t *j_journal = NULL;	struct ocfs2_dinode *di = NULL;	struct buffer_head *bh = NULL;	struct ocfs2_super *osb;	int inode_lock = 0;	mlog_entry_void();	BUG_ON(!journal);	osb = journal->j_osb;	/* already have the inode for our journal */	inode = ocfs2_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,					    osb->slot_num);	if (inode == NULL) {		status = -EACCES;		mlog_errno(status);		goto done;	}	if (is_bad_inode(inode)) {		mlog(ML_ERROR, "access error (bad inode)\n");		iput(inode);		inode = NULL;		status = -EACCES;		goto done;	}	SET_INODE_JOURNAL(inode);	OCFS2_I(inode)->ip_open_count++;	/* Skip recovery waits here - journal inode metadata never	 * changes in a live cluster so it can be considered an	 * exception to the rule. */	status = ocfs2_inode_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY);	if (status < 0) {		if (status != -ERESTARTSYS)			mlog(ML_ERROR, "Could not get lock on journal!\n");		goto done;	}	inode_lock = 1;	di = (struct ocfs2_dinode *)bh->b_data;	if (inode->i_size <  OCFS2_MIN_JOURNAL_SIZE) {		mlog(ML_ERROR, "Journal file size (%lld) is too small!\n",		     inode->i_size);		status = -EINVAL;		goto done;	}	mlog(0, "inode->i_size = %lld\n", inode->i_size);	mlog(0, "inode->i_blocks = %llu\n",			(unsigned long long)inode->i_blocks);	mlog(0, "inode->ip_clusters = %u\n", OCFS2_I(inode)->ip_clusters);	/* call the kernels journal init function now */	j_journal = journal_init_inode(inode);	if (j_journal == NULL) {		mlog(ML_ERROR, "Linux journal layer error\n");		status = -EINVAL;		goto done;	}	mlog(0, "Returned from journal_init_inode\n");	mlog(0, "j_journal->j_maxlen = %u\n", j_journal->j_maxlen);	*dirty = (le32_to_cpu(di->id1.journal1.ij_flags) &		  OCFS2_JOURNAL_DIRTY_FL);	journal->j_journal = j_journal;	journal->j_inode = inode;	journal->j_bh = bh;	ocfs2_set_journal_params(osb);	journal->j_state = OCFS2_JOURNAL_LOADED;	status = 0;done:	if (status < 0) {		if (inode_lock)			ocfs2_inode_unlock(inode, 1);		if (bh != NULL)			brelse(bh);		if (inode) {			OCFS2_I(inode)->ip_open_count--;			iput(inode);		}	}	mlog_exit(status);	return status;}static void ocfs2_bump_recovery_generation(struct ocfs2_dinode *di){	le32_add_cpu(&(di->id1.journal1.ij_recovery_generation), 1);}static u32 ocfs2_get_recovery_generation(struct ocfs2_dinode *di){	return le32_to_cpu(di->id1.journal1.ij_recovery_generation);}static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,				      int dirty, int replayed){	int status;	unsigned int flags;	struct ocfs2_journal *journal = osb->journal;	struct buffer_head *bh = journal->j_bh;	struct ocfs2_dinode *fe;	mlog_entry_void();	fe = (struct ocfs2_dinode *)bh->b_data;	if (!OCFS2_IS_VALID_DINODE(fe)) {		/* This is called from startup/shutdown which will		 * handle the errors in a specific manner, so no need		 * to call ocfs2_error() here. */		mlog(ML_ERROR, "Journal dinode %llu  has invalid "		     "signature: %.*s",		     (unsigned long long)le64_to_cpu(fe->i_blkno), 7,		     fe->i_signature);		status = -EIO;		goto out;	}	flags = le32_to_cpu(fe->id1.journal1.ij_flags);	if (dirty)		flags |= OCFS2_JOURNAL_DIRTY_FL;	else		flags &= ~OCFS2_JOURNAL_DIRTY_FL;	fe->id1.journal1.ij_flags = cpu_to_le32(flags);	if (replayed)		ocfs2_bump_recovery_generation(fe);	status = ocfs2_write_block(osb, bh, journal->j_inode);	if (status < 0)		mlog_errno(status);out:	mlog_exit(status);	return status;}/* * If the journal has been kmalloc'd it needs to be freed after this * call. */void ocfs2_journal_shutdown(struct ocfs2_super *osb){	struct ocfs2_journal *journal = NULL;	int status = 0;	struct inode *inode = NULL;	int num_running_trans = 0;	mlog_entry_void();	BUG_ON(!osb);	journal = osb->journal;	if (!journal)		goto done;	inode = journal->j_inode;	if (journal->j_state != OCFS2_JOURNAL_LOADED)		goto done;	/* need to inc inode use count as journal_destroy will iput. */	if (!igrab(inode))		BUG();	num_running_trans = atomic_read(&(osb->journal->j_num_trans));	if (num_running_trans > 0)		mlog(0, "Shutting down journal: must wait on %d "		     "running transactions!\n",		     num_running_trans);	/* Do a commit_cache here. It will flush our journal, *and*	 * release any locks that are still held.	 * set the SHUTDOWN flag and release the trans lock.	 * the commit thread will take the trans lock for us below. */	journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN;	/* The OCFS2_JOURNAL_IN_SHUTDOWN will signal to commit_cache to not	 * drop the trans_lock (which we want to hold until we	 * completely destroy the journal. */	if (osb->commit_task) {		/* Wait for the commit thread */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩不卡在线| 国产日韩欧美精品一区| 欧美一区二区三区四区久久 | 欧美一区二区免费观在线| 91精品国产高清一区二区三区蜜臀| 欧美成人vr18sexvr| 亚洲欧洲精品成人久久奇米网| 亚洲一区电影777| 精品在线观看免费| 91美女蜜桃在线| 欧美日韩在线三级| 亚洲精品在线三区| 一区二区三区免费观看| 日韩国产高清影视| 不卡的av在线| 日韩精品一区二区三区在线| 亚洲亚洲人成综合网络| av中文一区二区三区| 国产无一区二区| 精品中文字幕一区二区| 欧美年轻男男videosbes| 国产精品萝li| 成人黄色片在线观看| 久久先锋影音av| 狠狠色丁香久久婷婷综合_中| 91麻豆精品国产| 蜜臀av亚洲一区中文字幕| 欧美性生交片4| 亚洲高清视频的网址| 91国产福利在线| 亚洲国产日产av| 欧美日韩不卡一区| 免费成人深夜小野草| 在线播放亚洲一区| 视频一区在线视频| 欧美一区二区免费| 寂寞少妇一区二区三区| 久久中文字幕电影| 国产一区二区调教| 欧美激情在线观看视频免费| 国产成人免费视频网站| 国产精品嫩草影院com| 不卡一区在线观看| 一级日本不卡的影视| 欧美日韩国产中文| 久久黄色级2电影| 国产清纯白嫩初高生在线观看91| 国产99久久久国产精品潘金| 国产精品拍天天在线| 一本到三区不卡视频| 亚洲国产欧美在线| 欧美va在线播放| 国产成人在线电影| 亚洲精品午夜久久久| 91.com在线观看| 国产精品99精品久久免费| 国产精品电影院| 精品视频资源站| 国产一区二区三区日韩| 亚洲欧洲韩国日本视频| 欧美探花视频资源| 国产原创一区二区| 亚洲精品国产精华液| 精品免费日韩av| 成人av片在线观看| 免费观看30秒视频久久| 国产日韩欧美在线一区| 欧美日韩在线不卡| 国产91精品一区二区麻豆网站 | 天天操天天干天天综合网| 日韩一区二区在线观看视频播放| 国产suv精品一区二区三区| 亚洲一区二区三区中文字幕 | 美女www一区二区| 亚洲色图欧洲色图婷婷| 精品日韩欧美在线| 欧美影片第一页| 成人综合激情网| 麻豆高清免费国产一区| 亚洲色图在线视频| 国产日韩欧美一区二区三区乱码 | 国产亚洲综合在线| 精品视频在线免费看| 成人免费视频免费观看| 日本视频在线一区| 亚洲美女免费视频| 国产精品麻豆视频| 久久精品免费在线观看| 91麻豆精品国产综合久久久久久| 色综合天天天天做夜夜夜夜做| 国内精品久久久久影院一蜜桃| 一区二区三区中文字幕精品精品| 国产亚洲欧美日韩在线一区| 欧美一区二区三区免费大片| 91豆麻精品91久久久久久| 国产成人av一区二区三区在线| 日本不卡的三区四区五区| 一区二区三区四区不卡视频| 久久久久国产精品免费免费搜索 | 欧美在线不卡视频| av成人老司机| 国产精品18久久久久久久久久久久 | 日本成人在线一区| 亚洲精品自拍动漫在线| 亚洲日本一区二区| 自拍av一区二区三区| 亚洲欧洲日韩一区二区三区| 国产亚洲成年网址在线观看| 欧美成人精品福利| 精品乱码亚洲一区二区不卡| 欧美一区二区三区影视| 91精品国产综合久久国产大片| 欧美日韩视频在线第一区| 欧美日韩成人在线| 3d成人动漫网站| 欧美一区二区三区在线看| 欧美一级日韩一级| 欧美一级精品在线| 精品国产污污免费网站入口 | 亚洲老妇xxxxxx| 亚洲激情自拍视频| 亚洲福中文字幕伊人影院| 亚洲一级二级三级在线免费观看| 一区二区三区在线视频免费 | 国产精品美女久久久久久久久久久 | 成人h精品动漫一区二区三区| 国产xxx精品视频大全| 成人理论电影网| 91免费在线视频观看| 色播五月激情综合网| 欧美日韩一区二区三区四区五区| 欧美久久一二区| 久久综合色综合88| 国产精品久久久久一区二区三区共| ㊣最新国产の精品bt伙计久久| 又紧又大又爽精品一区二区| 亚洲成人av一区二区| 麻豆精品在线播放| 99国产精品国产精品久久| 欧美三级中文字| 2024国产精品| 亚洲色图20p| 日韩精彩视频在线观看| 国产成人午夜视频| 91免费观看在线| 9191成人精品久久| 国产精品国产三级国产普通话蜜臀| 亚洲精品视频免费看| 日本麻豆一区二区三区视频| 成人中文字幕电影| 欧美二区在线观看| 欧美国产日产图区| 人妖欧美一区二区| 成人免费看视频| 日韩一区二区三区四区| 成人免费一区二区三区视频| 蜜芽一区二区三区| 91亚洲永久精品| wwwwww.欧美系列| 婷婷亚洲久悠悠色悠在线播放| 大陆成人av片| 69堂成人精品免费视频| 国产精品亲子伦对白| 老司机免费视频一区二区| voyeur盗摄精品| 久久夜色精品一区| 亚洲午夜精品网| 99久久精品一区二区| 精品国产乱码久久久久久久久 | 在线观看区一区二| 国产视频一区在线播放| 日韩中文字幕一区二区三区| 成人app网站| 久久免费视频一区| 秋霞午夜av一区二区三区| 色婷婷综合久色| 国产精品久久久久永久免费观看 | 99精品国产一区二区三区不卡| 日韩一区二区三区电影| 亚洲综合成人在线视频| 国产高清不卡一区| 日韩精品在线看片z| 亚洲成人一区二区| 色婷婷综合久久久中文字幕| 国产精品美女久久久久久久久久久| 久久精品国产在热久久| 91精品国产综合久久香蕉麻豆| 亚洲欧美视频一区| 色综合久久中文综合久久牛| 国产精品美女久久久久av爽李琼 | 日本va欧美va欧美va精品| 在线观看免费成人| 亚洲色图清纯唯美| 不卡一区在线观看| 国产精品久久99| 91丨九色porny丨蝌蚪| 国产精品国产三级国产普通话99 | 美日韩一区二区| 日韩欧美一级在线播放| 久久国产麻豆精品|