您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sync_dirty_buffer函数代码示例

51自学网 2021-06-03 08:36:37
  C++
这篇教程C++ sync_dirty_buffer函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中sync_dirty_buffer函数的典型用法代码示例。如果您正苦于以下问题:C++ sync_dirty_buffer函数的具体用法?C++ sync_dirty_buffer怎么用?C++ sync_dirty_buffer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了sync_dirty_buffer函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ext2_sync_super

static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es){	es->s_free_blocks_count = cpu_to_le32(ext2_count_free_blocks(sb));	es->s_free_inodes_count = cpu_to_le32(ext2_count_free_inodes(sb));	es->s_wtime = cpu_to_le32(get_seconds());	mark_buffer_dirty(EXT2_SB(sb)->s_sbh);	sync_dirty_buffer(EXT2_SB(sb)->s_sbh);	sb->s_dirt = 0;}
开发者ID:mecke,项目名称:linux-2.6,代码行数:9,


示例2: simplefs_destroy_inode

static void simplefs_destroy_inode(struct inode *vfs_inode) {	struct simple_fs_inode_i *inode = SIMPLEFS_INODE(vfs_inode);	struct simple_fs_sb_i *sb = SIMPLEFS_SB(vfs_inode->i_sb);	if (inode->indirect_block) {		if(!buffer_uptodate(inode->indirect_block))			sync_dirty_buffer(inode->indirect_block);		bforget(inode->indirect_block);	}	kmem_cache_free(sb->inode_cachep,inode);}
开发者ID:pranjas,项目名称:simplefs,代码行数:11,


示例3: ufs_fmp_run

static int ufs_fmp_run(struct device *dev, uint32_t mode, uint8_t *data,			uint32_t len, uint32_t write){	int ret = 0;	struct ufs_hba *hba;	struct ufs_fmp_work *work;	struct Scsi_Host *host;	static struct buffer_head *bh;	work = dev_get_drvdata(dev);	if (!work) {		dev_err(dev, "Fail to get work from platform device/n");		return -ENODEV;	}	host = work->host;	hba = shost_priv(host);	hba->self_test_mode = mode;	bh = __getblk(work->bdev, work->sector, FMP_BLK_SIZE);	if (!bh) {		dev_err(dev, "Fail to get block from bdev/n");		return -ENODEV;	}	hba->self_test_bh = bh;	get_bh(bh);	if (write == WRITE_MODE) {		memcpy(bh->b_data, data, len);		set_buffer_dirty(bh);		sync_dirty_buffer(bh);		if (buffer_req(bh) && !buffer_uptodate(bh)) {			dev_err(dev, "IO error syncing for FMP fips write/n");			ret = -EIO;			goto out;		}		memset(bh->b_data, 0, FMP_BLK_SIZE);	} else {		lock_buffer(bh);		bh->b_end_io = end_buffer_read_sync;		submit_bh(READ_SYNC, bh);		wait_on_buffer(bh);		if (unlikely(!buffer_uptodate(bh))) {			ret = -EIO;			goto out;		}		memcpy(data, bh->b_data, len);	}out:	hba->self_test_mode = 0;	hba->self_test_bh = NULL;	put_bh(bh);	return ret;}
开发者ID:GAXUSXX,项目名称:GaXusKernel2-G935F,代码行数:54,


示例4: dedupfs_sb_sync

void dedupfs_sb_sync(struct super_block *vsb){	struct buffer_head *bh;	struct dedupfs_super_block *sb = DEDUPFS_SB(vsb);	bh = (struct buffer_head*)sb_bread(vsb, 									DEDUPFS_SUPERBLOCK_BLOCK_NUMBER);	bh->b_data = (char *)sb;	mark_buffer_dirty(bh);	sync_dirty_buffer(bh);}
开发者ID:Flynston,项目名称:ProgMonk,代码行数:11,


示例5: simplefs_sb_sync

void simplefs_sb_sync(struct super_block *vsb){	struct buffer_head *bh;	struct simplefs_super_block *sb = SIMPLEFS_SB(vsb);	bh = (struct buffer_head *)sb_bread(vsb,					    SIMPLEFS_SUPERBLOCK_BLOCK_NUMBER);	bh->b_data = (char *)sb;	mark_buffer_dirty(bh);	sync_dirty_buffer(bh);	brelse(bh);}
开发者ID:Lakshmipathi,项目名称:simplefs,代码行数:12,


示例6: simplefs_sync_metadata_buffer

static void simplefs_sync_metadata_buffer(struct bufffer_head **bh_table){	struct buffer_head **walker = *bh_table;	while(walker) {			struct buffer_head *bh = *walker;		do		{			if(!buffer_uptodate(bh))				sync_dirty_buffer(bh);			bh=bh->b_this_page;		}while(bh->b_this_page != *walker);		walker++;	}}
开发者ID:pranjas,项目名称:simplefs,代码行数:14,


示例7: __ext4bf_handle_dirty_metadata

int __ext4bf_handle_dirty_metadata(const char *where, unsigned int line,				 handle_t *handle, struct inode *inode,				 struct buffer_head *bh){	int err = 0;	if (ext4bf_handle_valid(handle)) {#ifdef DCHECKSUM        /* ext4bf: handle cases where it is a data block. */        if (bh && bh->b_blocktype == B_BLOCKTYPE_DATA) {#endif#ifdef PARTJ            if (!buffer_new(bh))                err = jbdbf_journal_dirty_metadata(handle, bh);            else#endif#ifdef DCHECKSUM                jbdbf_journal_dirty_data(handle, bh);        } else#endif            err = jbdbf_journal_dirty_metadata(handle, bh);        if (err) {            /* Errors can only happen if there is a bug */            handle->h_err = err;			__ext4bf_journal_stop(where, line, handle);		}	} else {		if (inode)			mark_buffer_dirty_inode(bh, inode);		else			mark_buffer_dirty(bh);		if (inode && inode_needs_sync(inode)) {			sync_dirty_buffer(bh);			if (buffer_req(bh) && !buffer_uptodate(bh)) {				struct ext4bf_super_block *es;				es = EXT4_SB(inode->i_sb)->s_es;				es->s_last_error_block =					cpu_to_le64(bh->b_blocknr);				ext4bf_error_inode(inode, where, line,						 bh->b_blocknr,					"IO error syncing itable block");				err = -EIO;			}		}	}	return err;}
开发者ID:lightstor,项目名称:optfs,代码行数:50,


示例8: mark_dirty

static void mark_dirty(struct super_block *s, int remount){	if (hpfs_sb(s)->sb_chkdsk && (remount || !(s->s_flags & MS_RDONLY))) {		struct buffer_head *bh;		struct hpfs_spare_block *sb;		if ((sb = hpfs_map_sector(s, 17, &bh, 0))) {			sb->dirty = 1;			sb->old_wrote = 0;			mark_buffer_dirty(bh);			sync_dirty_buffer(bh);			brelse(bh);		}	}}
开发者ID:perkarom,项目名称:SGS3-Sourcedrops,代码行数:14,


示例9: unmark_dirty

static void unmark_dirty(struct super_block *s){	struct buffer_head *bh;	struct hpfs_spare_block *sb;	if (s->s_flags & MS_RDONLY) return;	sync_blockdev(s->s_bdev);	if ((sb = hpfs_map_sector(s, 17, &bh, 0))) {		sb->dirty = hpfs_sb(s)->sb_chkdsk > 1 - hpfs_sb(s)->sb_was_error;		sb->old_wrote = hpfs_sb(s)->sb_chkdsk >= 2 && !hpfs_sb(s)->sb_was_error;		mark_buffer_dirty(bh);		sync_dirty_buffer(bh);		brelse(bh);	}}
开发者ID:perkarom,项目名称:SGS3-Sourcedrops,代码行数:14,


示例10: f2fs_commit_super

int f2fs_commit_super(struct f2fs_sb_info *sbi){	struct buffer_head *sbh = sbi->raw_super_buf;	sector_t block = sbh->b_blocknr;	int err;	/* write back-up superblock first */	sbh->b_blocknr = block ? 0 : 1;	mark_buffer_dirty(sbh);	err = sync_dirty_buffer(sbh);	sbh->b_blocknr = block;	if (err)		goto out;	/* write current valid superblock */	mark_buffer_dirty(sbh);	err = sync_dirty_buffer(sbh);out:	clear_buffer_write_io_error(sbh);	set_buffer_uptodate(sbh);	return err;}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:23,


示例11: ext2_sync_super

void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es,		     int wait){	ext2_clear_super_error(sb);	spin_lock(&EXT2_SB(sb)->s_lock);	es->s_free_blocks_count = cpu_to_le32(ext2_count_free_blocks(sb));	es->s_free_inodes_count = cpu_to_le32(ext2_count_free_inodes(sb));	es->s_wtime = cpu_to_le32(get_seconds());	/* unlock before we do IO */	spin_unlock(&EXT2_SB(sb)->s_lock);	mark_buffer_dirty(EXT2_SB(sb)->s_sbh);	if (wait)		sync_dirty_buffer(EXT2_SB(sb)->s_sbh);}
开发者ID:mdamt,项目名称:linux,代码行数:14,


示例12: affs_commit_super

static voidaffs_commit_super(struct super_block *sb, int wait, int clean){	struct affs_sb_info *sbi = AFFS_SB(sb);	struct buffer_head *bh = sbi->s_root_bh;	struct affs_root_tail *tail = AFFS_ROOT_TAIL(sb, bh);	tail->bm_flag = cpu_to_be32(clean);	secs_to_datestamp(get_seconds(), &tail->disk_change);	affs_fix_checksum(sb, bh);	mark_buffer_dirty(bh);	if (wait)		sync_dirty_buffer(bh);}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:14,


示例13: hellofs_write

/* TODO We didn't use address_space/pagecache here.   If we hook file_operations.write = do_sync_write,   and file_operations.aio_write = generic_file_aio_write,   we will use write to pagecache instead. */ssize_t hellofs_write(struct file *filp, const char __user *buf, size_t len,                      loff_t *ppos) {    struct super_block *sb;    struct inode *inode;    struct hellofs_inode *hellofs_inode;    struct buffer_head *bh;    struct hellofs_superblock *hellofs_sb;    char *buffer;    int ret;    inode = filp->f_path.dentry->d_inode;    sb = inode->i_sb;    hellofs_inode = HELLOFS_INODE(inode);    hellofs_sb = HELLOFS_SB(sb);    ret = generic_write_checks(filp, ppos, &len, 0);    if (ret) {        return ret;    }    bh = sb_bread(sb, hellofs_inode->data_block_no);    if (!bh) {        printk(KERN_ERR "Failed to read data block %llu/n",               hellofs_inode->data_block_no);        return 0;    }    buffer = (char *)bh->b_data + *ppos;    if (copy_from_user(buffer, buf, len)) {        brelse(bh);        printk(KERN_ERR               "Error copying file content from userspace buffer "               "to kernel space/n");        return -EFAULT;    }    *ppos += len;    mark_buffer_dirty(bh);    sync_dirty_buffer(bh);    brelse(bh);    hellofs_inode->file_size = max((size_t)(hellofs_inode->file_size),                                   (size_t)(*ppos));    hellofs_save_hellofs_inode(sb, hellofs_inode);    /* TODO We didn't update file size here. To be frank I don't know how. */    return len;}
开发者ID:accelazh,项目名称:hellofs,代码行数:53,


示例14: journal_update_superblock

/** * void journal_update_superblock() - Update journal sb on disk. * @journal: The journal to update. * @wait: Set to '0' if you don't want to wait for IO completion. * * Update a journal's dynamic superblock fields and write it to disk, * optionally waiting for the IO to complete. */void journal_update_superblock(journal_t *journal, int wait){    journal_superblock_t *sb = journal->j_superblock;    struct buffer_head *bh = journal->j_sb_buffer;    /*     * As a special case, if the on-disk copy is already marked as needing     * no recovery (s_start == 0) and there are no outstanding transactions     * in the filesystem, then we can safely defer the superblock update     * until the next commit by setting JFS_FLUSHED.  This avoids     * attempting a write to a potential-readonly device.     */    if (sb->s_start == 0 && journal->j_tail_sequence ==            journal->j_transaction_sequence) {        jbd_debug(1,"JBD: Skipping superblock update on recovered sb "                  "(start %ld, seq %d, errno %d)/n",                  journal->j_tail, journal->j_tail_sequence,                  journal->j_errno);        goto out;    }    jbd_lock(&journal->j_state_lock);    jbd_debug(1,"JBD: updating superblock (start %ld, seq %d, errno %d)/n",              journal->j_tail, journal->j_tail_sequence, journal->j_errno);    sb->s_sequence = cpu_to_be32(journal->j_tail_sequence);    sb->s_start    = cpu_to_be32(journal->j_tail);    sb->s_errno    = cpu_to_be32(journal->j_errno);    jbd_unlock(&journal->j_state_lock);    BUFFER_TRACE(bh, "marking dirty");    mark_buffer_dirty(bh);    if (wait)        sync_dirty_buffer(bh);    else        ll_rw_block(SWRITE, 1, &bh);out:    /* If we have just flushed the log (by marking s_start==0), then     * any future commit will have to be careful to update the     * superblock again to re-record the true start of the log. */    jbd_lock(&journal->j_state_lock);    if (sb->s_start)        journal->j_flags &= ~JFS_FLUSHED;    else        journal->j_flags |= JFS_FLUSHED;    jbd_unlock(&journal->j_state_lock);}
开发者ID:Axure,项目名称:Ext3Fsd,代码行数:57,


示例15: __sysv_write_inode

static int __sysv_write_inode(struct inode *inode, int wait){	struct super_block * sb = inode->i_sb;	struct sysv_sb_info * sbi = SYSV_SB(sb);	struct buffer_head * bh;	struct sysv_inode * raw_inode;	struct sysv_inode_info * si;	unsigned int ino, block;	int err = 0;	ino = inode->i_ino;	if (!ino || ino > sbi->s_ninodes) {		printk("Bad inode number on dev %s: %d is out of range/n",		       inode->i_sb->s_id, ino);		return -EIO;	}	raw_inode = sysv_raw_inode(sb, ino, &bh);	if (!raw_inode) {		printk("unable to read i-node block/n");		return -EIO;	}	raw_inode->i_mode = cpu_to_fs16(sbi, inode->i_mode);	raw_inode->i_uid = cpu_to_fs16(sbi, fs_high2lowuid(inode->i_uid));	raw_inode->i_gid = cpu_to_fs16(sbi, fs_high2lowgid(inode->i_gid));	raw_inode->i_nlink = cpu_to_fs16(sbi, inode->i_nlink);	raw_inode->i_size = cpu_to_fs32(sbi, inode->i_size);	raw_inode->i_atime = cpu_to_fs32(sbi, inode->i_atime.tv_sec);	raw_inode->i_mtime = cpu_to_fs32(sbi, inode->i_mtime.tv_sec);	raw_inode->i_ctime = cpu_to_fs32(sbi, inode->i_ctime.tv_sec);	si = SYSV_I(inode);	if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode))		si->i_data[0] = cpu_to_fs32(sbi, old_encode_dev(inode->i_rdev));	for (block = 0; block < 10+1+1+1; block++)		write3byte(sbi, (u8 *)&si->i_data[block],			&raw_inode->i_data[3*block]);	mark_buffer_dirty(bh);	if (wait) {                sync_dirty_buffer(bh);                if (buffer_req(bh) && !buffer_uptodate(bh)) {                        printk ("IO error syncing sysv inode [%s:%08x]/n",                                sb->s_id, ino);                        err = -EIO;                }        }	brelse(bh);	return 0;}
开发者ID:adyjl,项目名称:DORIMANX_LG_STOCK_LP_KERNEL,代码行数:49,


示例16: adfs_fplus_sync

static intadfs_fplus_sync(struct adfs_dir *dir){	int err = 0;	int i;	for (i = dir->nr_buffers - 1; i >= 0; i--) {		struct buffer_head *bh = dir->bh[i];		sync_dirty_buffer(bh);		if (buffer_req(bh) && !buffer_uptodate(bh))			err = -EIO;	}	return err;}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:15,


示例17: __ext4_handle_dirty_metadata

int __ext4_handle_dirty_metadata(const char *where, unsigned int line,				 handle_t *handle, struct inode *inode,				 struct buffer_head *bh){	int err = 0;	might_sleep();	set_buffer_meta(bh);	set_buffer_prio(bh);	if (ext4_handle_valid(handle)) {		err = jbd2_journal_dirty_metadata(handle, bh);		/* Errors can only happen if there is a bug */		if (WARN_ON_ONCE(err)) {			ext4_journal_abort_handle(where, line, __func__, bh,						  handle, err);			ext4_error_inode(inode, where, line,					 bh->b_blocknr,					 "journal_dirty_metadata failed: "					 "handle type %u started at line %u, "					 "credits %u/%u, errcode %d",					 handle->h_type,					 handle->h_line_no,					 handle->h_requested_credits,					 handle->h_buffer_credits, err);		}	} else {		if (inode)			mark_buffer_dirty_inode(bh, inode);		else			mark_buffer_dirty(bh);		if (inode && inode_needs_sync(inode)) {			sync_dirty_buffer(bh);			if (buffer_req(bh) && !buffer_uptodate(bh)) {				struct ext4_super_block *es;				es = EXT4_SB(inode->i_sb)->s_es;				es->s_last_error_block =					cpu_to_le64(bh->b_blocknr);				ext4_error_inode(inode, where, line,						 bh->b_blocknr,					"IO error syncing itable block");				err = -EIO;			}		}	}	return err;}
开发者ID:jgroen,项目名称:rtt_tests,代码行数:48,


示例18: updateSuper

/* *	updateSuper() * * update synchronously superblock if it is mounted read-write. */int updateSuper(struct super_block *sb, uint state){	struct jfs_superblock *j_sb;	struct jfs_sb_info *sbi = JFS_SBI(sb);	struct buffer_head *bh;	int rc;	if (sbi->flag & JFS_NOINTEGRITY) {		if (state == FM_DIRTY) {			sbi->p_state = state;			return 0;		} else if (state == FM_MOUNT) {			sbi->p_state = sbi->state;			state = FM_DIRTY;		} else if (state == FM_CLEAN) {			state = sbi->p_state;		} else			jfs_err("updateSuper: bad state");	} else if (sbi->state == FM_DIRTY)		return 0;		if ((rc = readSuper(sb, &bh)))		return rc;	j_sb = (struct jfs_superblock *)bh->b_data;	j_sb->s_state = cpu_to_le32(state);	sbi->state = state;	if (state == FM_MOUNT) {		/* record log's dev_t and mount serial number */		j_sb->s_logdev = cpu_to_le32(new_encode_dev(sbi->log->bdev->bd_dev));		j_sb->s_logserial = cpu_to_le32(sbi->log->serial);	} else if (state == FM_CLEAN) {		/*		 * If this volume is shared with OS/2, OS/2 will need to		 * recalculate DASD usage, since we don't deal with it.		 */		if (j_sb->s_flag & cpu_to_le32(JFS_DASD_ENABLED))			j_sb->s_flag |= cpu_to_le32(JFS_DASD_PRIME);	}	mark_buffer_dirty(bh);	sync_dirty_buffer(bh);	brelse(bh);	return 0;}
开发者ID:OpenHMR,项目名称:Open-HMR600,代码行数:53,


示例19: locfs_write

ssize_t locfs_write(struct file *filp,                       const char __user *buf,                       size_t len,                      loff_t *ppos) {    struct super_block *sb;    struct inode *inode;    struct locfs_inode *locfs_inode;    struct buffer_head *bh;    struct locfs_super_block *locfs_sb;    char *buffer;    // Get inode from dentry cache    inode = filp->f_path.dentry->d_inode;    sb = inode->i_sb;    locfs_inode = LOCFS_INODE(inode);    locfs_sb = LOCFS_SB(sb);    bh = sb_bread(sb, locfs_inode->data_block_no);    if (!bh) {        printk(KERN_ERR "Failed to read data block %llu/n",               locfs_inode->data_block_no);        return 0;    }    buffer = (char *)bh->b_data + *ppos;    if (copy_from_user(buffer, buf, len)) {        brelse(bh);        printk(KERN_ERR               "Error while copying file content from userspace buffer "               "to kernel space/n");        return -EFAULT;    }    *ppos += len;    mark_buffer_dirty(bh);    sync_dirty_buffer(bh);    brelse(bh);    // Update the inode and save it back    locfs_inode->file_size = max((size_t)(locfs_inode->file_size),                                   (size_t)(*ppos));    locfs_save_locfs_inode(sb, locfs_inode);    return len;}
开发者ID:RobChrystie,项目名称:LocationBasedFilesystem,代码行数:46,


示例20: TESTFS_SB

struct inode *testfs_new_inode(struct inode *dir, int mode){	struct super_block *sb = dir->i_sb;	struct testfs_sb_info *tsbi = TESTFS_SB(sb);	struct testfs_inode_info *tsi;	struct buffer_head *bitmap_bh = NULL;	struct inode *inode;	unsigned int ino = 0;	inode = new_inode(sb);	if(!inode)	{		testfs_debug("Could not allocate inode from inode cache/n");		return ERR_PTR(-ENOMEM);	}	tsi = TESTFS_I(inode);	bitmap_bh = read_inode_bitmap(sb);	ino = testfs_find_free_inode(bitmap_bh->b_data, sb);	if(!ino)	{		testfs_debug("Could not find any free inode. File system full/n");		return ERR_PTR(-ENOSPC);	}	testfs_debug("Allocated new inode (%u)/n",ino);	testfs_set_inode_bit(bitmap_bh->b_data, ino);	inode->i_ino = ino;	inode->i_mode = mode;	inode->i_gid = current->fsgid;	inode->i_uid = current->fsuid;	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;	testfs_debug("Successfully allocated inodes..../n");	memset(tsi->i_data, 0 ,sizeof(tsi->i_data));	tsi->i_data[0] = ino;	tsi->state = TESTFS_INODE_ALLOCATED;	tsbi->s_free_inodes--;	sb->s_dirt = 1;	insert_inode_hash(inode);	mark_inode_dirty(inode);	mark_buffer_dirty(bitmap_bh);	sync_dirty_buffer(bitmap_bh);	testfs_debug("returning now/n");	return inode;}
开发者ID:cfsxdave,项目名称:testfs,代码行数:45,


示例21: wtfs_sync_super

/* * write back super block information to disk * * @vsb: the VFS super block structure * @wait: whether to wait for the super block to be synced to disk * * return: 0 on success, error code otherwise */int wtfs_sync_super(struct super_block * vsb, int wait){	struct wtfs_sb_info * sbi = WTFS_SB_INFO(vsb);	struct wtfs_super_block * sb = NULL;	struct buffer_head * bh = NULL;	int ret = -EIO;	if ((bh = sb_bread(vsb, WTFS_RB_SUPER)) == NULL) {		wtfs_error("unable to read the super block/n");		goto error;	}	sb = (struct wtfs_super_block *)bh->b_data;	sb->version = cpu_to_wtfs64(sbi->version);	sb->magic = cpu_to_wtfs64(sbi->magic);	sb->block_size = cpu_to_wtfs64(sbi->block_size);	sb->block_count = cpu_to_wtfs64(sbi->block_count);	sb->inode_table_first = cpu_to_wtfs64(sbi->inode_table_first);	sb->inode_table_count = cpu_to_wtfs64(sbi->inode_table_count);	sb->block_bitmap_first = cpu_to_wtfs64(sbi->block_bitmap_first);	sb->block_bitmap_count = cpu_to_wtfs64(sbi->block_bitmap_count);	sb->inode_bitmap_first = cpu_to_wtfs64(sbi->inode_bitmap_first);	sb->inode_bitmap_count = cpu_to_wtfs64(sbi->inode_bitmap_count);	sb->inode_count = cpu_to_wtfs64(sbi->inode_count);	sb->free_block_count = cpu_to_wtfs64(sbi->free_block_count);	mark_buffer_dirty(bh);	if (wait) {		sync_dirty_buffer(bh);		if (buffer_req(bh) && !buffer_uptodate(bh)) {			wtfs_error("super block sync failed/n");			goto error;		}	}	brelse(bh);	return 0;error:	if (bh != NULL) {		brelse(bh);	}	return ret;}
开发者ID:chaosdefinition,项目名称:wtfs,代码行数:52,


示例22: updateSuper

int updateSuper(struct super_block *sb, uint state){	struct jfs_superblock *j_sb;	struct jfs_sb_info *sbi = JFS_SBI(sb);	struct buffer_head *bh;	int rc;	if (sbi->flag & JFS_NOINTEGRITY) {		if (state == FM_DIRTY) {			sbi->p_state = state;			return 0;		} else if (state == FM_MOUNT) {			sbi->p_state = sbi->state;			state = FM_DIRTY;		} else if (state == FM_CLEAN) {			state = sbi->p_state;		} else			jfs_err("updateSuper: bad state");	} else if (sbi->state == FM_DIRTY)		return 0;	if ((rc = readSuper(sb, &bh)))		return rc;	j_sb = (struct jfs_superblock *)bh->b_data;	j_sb->s_state = cpu_to_le32(state);	sbi->state = state;	if (state == FM_MOUNT) {				j_sb->s_logdev = cpu_to_le32(new_encode_dev(sbi->log->bdev->bd_dev));		j_sb->s_logserial = cpu_to_le32(sbi->log->serial);	} else if (state == FM_CLEAN) {		if (j_sb->s_flag & cpu_to_le32(JFS_DASD_ENABLED))			j_sb->s_flag |= cpu_to_le32(JFS_DASD_PRIME);	}	mark_buffer_dirty(bh);	sync_dirty_buffer(bh);	brelse(bh);	return 0;}
开发者ID:ra0710,项目名称:PsycoKernel,代码行数:44,


示例23: simplefs_write_inode

static int simplefs_write_inode(struct inode *inode, struct writeback_control *wbc) {	int err = 0;	struct buffer_head *bh;	struct simplefs_inode *raw_inode;	printk(KERN_INFO "simplefs_write_inode: %ld/n", inode->i_ino);	if (!(raw_inode = simplefs_iget_raw(inode->i_sb, inode->i_ino, &bh)))		return -EIO;	raw_inode->i_mode = inode->i_mode;	raw_inode->i_nlink = inode->i_nlink;	raw_inode->i_size = inode->i_size;	raw_inode->i_time = inode->i_mtime.tv_sec;	mark_buffer_dirty(bh);	if (wbc->sync_mode == WB_SYNC_ALL && buffer_dirty(bh)) {		sync_dirty_buffer(bh);	}	brelse(bh);	return err;}
开发者ID:pipul,项目名称:simplefs,代码行数:19,


示例24: sysv_sync_inode

int sysv_sync_inode(struct inode * inode){        int err = 0;        struct buffer_head *bh;        bh = sysv_update_inode(inode);        if (bh && buffer_dirty(bh)) {                sync_dirty_buffer(bh);                if (buffer_req(bh) && !buffer_uptodate(bh)) {                        printk ("IO error syncing sysv inode [%s:%08lx]/n",                                inode->i_sb->s_id, inode->i_ino);                        err = -1;                }        }        else if (!bh)                err = -1;        brelse (bh);        return err;}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:19,


示例25: me2fsSyncSuper

/*==================================================================================	Function	:me2fsSyncSuper	Input		:struct super_block *sb				 < vfs super block >				 struct ext2_super_block *esb				 < buffer cache address of ext2 super block >				 int wait				 < blocking flag >	Output		:void	Return		:void	Description	:synchronize super block==================================================================================*/static void me2fsSyncSuper( struct super_block *sb,							struct ext2_super_block *esb,							int wait ){	struct me2fs_sb_info	*msi;	msi = ME2FS_SB( sb );	clearSuperError( sb );	spin_lock( &msi->s_lock );	esb->s_free_blocks_count = cpu_to_le32( me2fsCountFreeBlocks( sb ) );	esb->s_free_inodes_count = cpu_to_le32( me2fsCountFreeInodes( sb ) );	/* unlock before i/o														*/	spin_unlock( &msi->s_lock );	mark_buffer_dirty( msi->s_sbh );	if( wait )	{		sync_dirty_buffer( msi->s_sbh );	}}
开发者ID:KnightSch,项目名称:Learning-Ext2-Filesystem,代码行数:35,


示例26: __ext4_handle_dirty_metadata

int __ext4_handle_dirty_metadata(const char *where, unsigned int line,				 handle_t *handle, struct inode *inode,				 struct buffer_head *bh){	int err = 0;	might_sleep();	set_buffer_meta(bh);	set_buffer_prio(bh);	if (ext4_handle_valid(handle)) {		err = jbd2_journal_dirty_metadata(handle, bh);		if (err) {			/* Errors can only happen if there is a bug */			handle->h_err = err;			__ext4_journal_stop(where, line, handle);		}	} else {		if (inode)			mark_buffer_dirty_inode(bh, inode);		else			mark_buffer_dirty(bh);		if (inode && inode_needs_sync(inode)) {			sync_dirty_buffer(bh);			if (buffer_req(bh) && !buffer_uptodate(bh)) {				struct ext4_super_block *es;				es = EXT4_SB(inode->i_sb)->s_es;				es->s_last_error_block =					cpu_to_le64(bh->b_blocknr);				ext4_error_inode(inode, where, line,						 bh->b_blocknr,					"IO error syncing itable block");				err = -EIO;			}		}	}	return err;}
开发者ID:AD5GB,项目名称:wicked_kernel_lge_hammerhead,代码行数:39,


示例27: minix_write_inode

static int minix_write_inode(struct inode *inode, struct writeback_control *wbc){	int err = 0;	struct buffer_head *bh;	if (INODE_VERSION(inode) == MINIX_V1)		bh = V1_minix_update_inode(inode);	else		bh = V2_minix_update_inode(inode);	if (!bh)		return -EIO;	if (wbc->sync_mode == WB_SYNC_ALL && buffer_dirty(bh)) {		sync_dirty_buffer(bh);		if (buffer_req(bh) && !buffer_uptodate(bh)) {			printk("IO error syncing minix inode [%s:%08lx]/n",				inode->i_sb->s_id, inode->i_ino);			err = -EIO;		}	}	brelse (bh);	return err;}
开发者ID:AeroGirl,项目名称:VAR-SOM-AM33-SDK7-Kernel,代码行数:22,


示例28: sfs_write_inode

int sfs_write_inode(struct inode *inode, struct writeback_control *wbc){	int err = 0;	struct buffer_head *bh;	pr_debug("Enter: sfs_write_inode (ino = %ld)/n", inode->i_ino);	bh = sfs_update_inode(inode);	if (!bh)		return -EIO;		if (wbc->sync_mode == WB_SYNC_ALL && buffer_dirty(bh)) {		sync_dirty_buffer(bh);		if (buffer_req(bh) && !buffer_uptodate(bh)) {			pr_debug("IO error syncing sfs inode 0x%lx/n", 				inode->i_ino);			err = -EIO;		}	}	pr_debug("Leave: sfs_write_inode (ino = %ld)/n", inode->i_ino);	brelse(bh);	return err;}
开发者ID:nosway,项目名称:sfs,代码行数:22,



注:本文中的sync_dirty_buffer函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ sync_filesystems函数代码示例
C++ syncSoundSettings函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。