当前位置: 首页>>代码示例>>C++>>正文


C++ EXFAT_SB函数代码示例

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


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

示例1: bdev_read

s32 bdev_read(struct super_block *sb, u32 secno, struct buffer_head **bh, u32 num_secs, s32 read)
{
	BD_INFO_T *p_bd = &(EXFAT_SB(sb)->bd_info);
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);
#ifdef CONFIG_EXFAT_KERNEL_DEBUG
	struct exfat_sb_info *sbi = EXFAT_SB(sb);
	long flags = sbi->debug_flags;

	if (flags & EXFAT_DEBUGFLAGS_ERROR_RW)
		return FFS_MEDIAERR;
#endif /* CONFIG_EXFAT_KERNEL_DEBUG */

	if (!p_bd->opened)
		return FFS_MEDIAERR;

	if (*bh)
		__brelse(*bh);

	if (read)
		*bh = __bread(sb->s_bdev, secno, num_secs << p_bd->sector_size_bits);
	else
		*bh = __getblk(sb->s_bdev, secno, num_secs << p_bd->sector_size_bits);

	if (*bh)
		return FFS_SUCCESS;

	WARN(!p_fs->dev_ejected,
		"[EXFAT] No bh, device seems wrong or to be ejected.\n");

	return FFS_MEDIAERR;
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:31,代码来源:exfat_blkdev.c

示例2: nls_upper

UINT16 nls_upper(struct super_block *sb, UINT16 a)
{
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);

	if (EXFAT_SB(sb)->options.casesensitive)
		return(a);
	if ((p_fs->vol_utbl)[get_col_index(a)] != NULL)
		return (p_fs->vol_utbl)[get_col_index(a)][get_row_index(a)];
	else
		return a;
}
开发者ID:1N4148,项目名称:android_kernel_samsung_golden,代码行数:11,代码来源:exfat_nls.c

示例3: bdev_write

s32 bdev_write(struct super_block *sb, u32 secno, struct buffer_head *bh, u32 num_secs, s32 sync)
{
	s32 count;
	struct buffer_head *bh2;
	BD_INFO_T *p_bd = &(EXFAT_SB(sb)->bd_info);
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);
#ifdef CONFIG_EXFAT_KERNEL_DEBUG
	struct exfat_sb_info *sbi = EXFAT_SB(sb);
	long flags = sbi->debug_flags;

	if (flags & EXFAT_DEBUGFLAGS_ERROR_RW)
		return FFS_MEDIAERR;
#endif /* CONFIG_EXFAT_KERNEL_DEBUG */

	if (!p_bd->opened)
		return FFS_MEDIAERR;

	if (secno == bh->b_blocknr) {
		lock_buffer(bh);
		set_buffer_uptodate(bh);
		mark_buffer_dirty(bh);
		unlock_buffer(bh);
		if (sync && (sync_dirty_buffer(bh) != 0))
			return FFS_MEDIAERR;
	} else {
		count = num_secs << p_bd->sector_size_bits;

		bh2 = __getblk(sb->s_bdev, secno, count);

		if (bh2 == NULL)
			goto no_bh;

		lock_buffer(bh2);
		memcpy(bh2->b_data, bh->b_data, count);
		set_buffer_uptodate(bh2);
		mark_buffer_dirty(bh2);
		unlock_buffer(bh2);
		if (sync && (sync_dirty_buffer(bh2) != 0)) {
			__brelse(bh2);
			goto no_bh;
		}
		__brelse(bh2);
	}

	return FFS_SUCCESS;

no_bh:
	WARN(!p_fs->dev_ejected,
		"[EXFAT] No bh, device seems wrong or to be ejected.\n");

	return FFS_MEDIAERR;
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:52,代码来源:exfat_blkdev.c

示例4: bdev_sync

INT32 bdev_sync(struct super_block *sb)
{
BD_INFO_T *p_bd = &(EXFAT_SB(sb)->bd_info);
#if EXFAT_CONFIG_KERNEL_DEBUG
struct exfat_sb_info *sbi = EXFAT_SB(sb);
long flags = sbi->debug_flags;

if (flags & EXFAT_DEBUGFLAGS_ERROR_RW)        return (FFS_MEDIAERR);
#endif /* EXFAT_CONFIG_KERNEL_DEBUG */

if (!p_bd->opened) return(FFS_MEDIAERR);

return sync_blockdev(sb->s_bdev);
}
开发者ID:android-armv7a-belalang-tempur,项目名称:Android_SpeedKernel_3.4,代码行数:14,代码来源:exfat_blkdev.c

示例5: nls_uniname_to_cstring

void nls_uniname_to_cstring(struct super_block *sb, u8 *p_cstring, UNI_NAME_T *p_uniname)
{
	int i, j, len;
	u8 buf[MAX_CHARSET_SIZE];
	u16 *uniname = p_uniname->name;
	struct nls_table *nls = EXFAT_SB(sb)->nls_io;

	if (nls == NULL) {
		len = utf16s_to_utf8s(uniname, MAX_NAME_LENGTH, UTF16_HOST_ENDIAN, p_cstring, MAX_NAME_LENGTH);
		p_cstring[len] = 0;
		return;
	}

	i = 0;
	while (i < (MAX_NAME_LENGTH-1)) {
		if (*uniname == (u16) '\0')
			break;

		len = convert_uni_to_ch(nls, buf, *uniname, NULL);

		if (len > 1) {
			for (j = 0; j < len; j++)
				*p_cstring++ = (char) *(buf+j);
		} else { /* len == 1 */
			*p_cstring++ = (char) *buf;
		}

		uniname++;
		i++;
	}

	*p_cstring = '\0';
} /* end of nls_uniname_to_cstring */
开发者ID:Civil,项目名称:exfat-nofuse,代码行数:33,代码来源:exfat_nls.c

示例6: nls_uniname_to_cstring

void nls_uniname_to_cstring(struct super_block *sb, UINT8 *p_cstring, UNI_NAME_T *p_uniname)
{
	INT32 i, j, len;
	UINT8 buf[MAX_CHARSET_SIZE];
	UINT16 *uniname = p_uniname->name;
	struct nls_table *nls = EXFAT_SB(sb)->nls_io;

	i = 0;
	while (i < (MAX_NAME_LENGTH-1)) {
		if (*uniname == (UINT16) '\0') break;

		len = convert_uni_to_ch(nls, buf, *uniname, NULL);

		if (len > 1) {
			for (j = 0; j < len; j++)
				*p_cstring++ = (INT8) *(buf+j);
		} else {
			*p_cstring++ = (INT8) *buf;
		}

		uniname++;
		i++;
	}

	*p_cstring = '\0';
}
开发者ID:1N4148,项目名称:android_kernel_samsung_golden,代码行数:26,代码来源:exfat_nls.c

示例7: exfat_get_cluster

/*
 * Caller must be guarantee it have no race with truncate().  I.e. the
 * range of "iclusnr" and "iclusnr + len" must not be truncated.
 */
int exfat_get_cluster(struct inode *inode, u32 iclusnr, u32 clus_len,
		      struct exfat_clus_map *cmap)
{
	struct super_block *sb = inode->i_sb;
	struct exfat_sb_info *sbi = EXFAT_SB(sb);
	struct exfat_inode_info *exi = EXFAT_I(inode);
	struct exfat_cache_id cid;
	struct exfat_ent fatent;
	u32 clusnr;
	int err = 0, found_target;

	DEBUG0_ON(!exi->clusnr);

	if (exi->data_flag == EXFAT_DATA_CONTIGUOUS) {
		DEBUG_ON(clus_len >
		  (i_size_read(inode) + (sbi->clus_size - 1)) >> sbi->clus_bits,
			 "clus_len %u, i_size %lld, clus_size %lu\n",
			 clus_len, i_size_read(inode), sbi->clus_size);
		/* FIXME: should check clus_len limit from i_size? */
		cmap->iclusnr = iclusnr;
		cmap->clusnr = exi->clusnr + iclusnr;
		cmap->len = clus_len;
		printk("%s: contig: iclusnr %u, clusnr %u, len %u\n", __func__,
		       cmap->iclusnr, cmap->clusnr, cmap->len);
		return 0;
	}
开发者ID:Forest1971,项目名称:legacy_android_kernel_exynos4210,代码行数:30,代码来源:cluster.c

示例8: bdev_close

INT32 bdev_close(struct super_block *sb)
{
BD_INFO_T *p_bd = &(EXFAT_SB(sb)->bd_info);

if (!p_bd->opened) return(FFS_SUCCESS);

p_bd->opened = FALSE;
return(FFS_SUCCESS);
}
开发者ID:android-armv7a-belalang-tempur,项目名称:Android_SpeedKernel_3.4,代码行数:9,代码来源:exfat_blkdev.c

示例9: nls_cstring_to_uniname

void nls_cstring_to_uniname(struct super_block *sb, UNI_NAME_T *p_uniname, UINT8 *p_cstring, INT32 *p_lossy)
{
	INT32 i, j, lossy = FALSE;
	UINT8 *end_of_name;
	UINT8 upname[MAX_NAME_LENGTH * 2];
	UINT16 *uniname = p_uniname->name;
	struct nls_table *nls = EXFAT_SB(sb)->nls_io;


	/* strip all trailing spaces */
	end_of_name = p_cstring + STRLEN((INT8 *) p_cstring);

	while (*(--end_of_name) == ' ') {
		if (end_of_name < p_cstring) break;
	}
	*(++end_of_name) = '\0';

	if (STRCMP((INT8 *) p_cstring, ".") && STRCMP((INT8 *) p_cstring, "..")) {

		/* strip all trailing periods */
		while (*(--end_of_name) == '.') {
			if (end_of_name < p_cstring) break;
		}
		*(++end_of_name) = '\0';
	}

	if (*p_cstring == '\0')
		lossy = TRUE;

	i = j = 0;
	while (j < (MAX_NAME_LENGTH-1)) {
		if (*(p_cstring+i) == '\0') break;

		i += convert_ch_to_uni(nls, uniname, (UINT8 *)(p_cstring+i), &lossy);

		if ((*uniname < 0x0020) || WSTRCHR(bad_uni_chars, *uniname))
			lossy = TRUE;

		SET16_A(upname + j * 2, nls_upper(sb, *uniname));

		uniname++;
		j++;
	}

	if (*(p_cstring+i) != '\0')
		lossy = TRUE;
	*uniname = (UINT16) '\0';

	p_uniname->name_len = j;
	p_uniname->name_hash = calc_checksum_2byte((void *) upname, j<<1, 0, CS_DEFAULT);

	if (p_lossy != NULL)
		*p_lossy = lossy;
} /* end of nls_cstring_to_uniname */
开发者ID:HuaweiHonor4C,项目名称:kernel_hi6210sft_mm,代码行数:54,代码来源:exfat_nls.c

示例10: nls_dosname_to_uniname

void nls_dosname_to_uniname(struct super_block *sb, UNI_NAME_T *p_uniname, DOS_NAME_T *p_dosname)
{
	int i = 0, j, n = 0;
	u8 buf[DOS_NAME_LENGTH+2];
	u8 *dosname = p_dosname->name;
	u16 *uniname = p_uniname->name;
	struct nls_table *nls = EXFAT_SB(sb)->nls_disk;

	if (*dosname == 0x05) {
		*buf = 0xE5;
		i++;
		n++;
	}

	for (; i < 8; i++, n++) {
		if (*(dosname+i) == ' ')
			break;

		if ((*(dosname+i) >= 'A') && (*(dosname+i) <= 'Z') && (p_dosname->name_case & 0x08))
			*(buf+n) = *(dosname+i) + ('a' - 'A');
		else
			*(buf+n) = *(dosname+i);
	}
	if (*(dosname+8) != ' ') {
		*(buf+n) = '.';
		n++;
	}

	for (i = 8; i < DOS_NAME_LENGTH; i++, n++) {
		if (*(dosname+i) == ' ')
			break;

		if ((*(dosname+i) >= 'A') && (*(dosname+i) <= 'Z') && (p_dosname->name_case & 0x10))
			*(buf+n) = *(dosname+i) + ('a' - 'A');
		else
			*(buf+n) = *(dosname+i);
	}
	*(buf+n) = '\0';

	i = j = 0;
	while (j < (MAX_NAME_LENGTH-1)) {
		if (*(buf+i) == '\0')
			break;

		i += convert_ch_to_uni(nls, uniname, (buf+i), NULL);

		uniname++;
		j++;
	}

	*uniname = (u16) '\0';
} /* end of nls_dosname_to_uniname */
开发者ID:Civil,项目名称:exfat-nofuse,代码行数:52,代码来源:exfat_nls.c

示例11: FsReleaseCache

INT32 FsReleaseCache(struct super_block *sb)
{
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);

	sm_P(&(fs_struct[p_fs->drv].v_sem));

	FAT_release_all(sb);
	buf_release_all(sb);

	sm_V(&(fs_struct[p_fs->drv].v_sem));

	return 0;
}
开发者ID:GAXUSXX,项目名称:G935FGaXusKernel2,代码行数:13,代码来源:exfat_api.c

示例12: FsSyncVol

INT32 FsSyncVol(struct super_block *sb, INT32 do_sync)
{
	INT32 err;
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);

	sm_P(&(fs_struct[p_fs->drv].v_sem));

	err = ffsSyncVol(sb, do_sync);

	sm_V(&(fs_struct[p_fs->drv].v_sem));

	return(err);
}
开发者ID:GAXUSXX,项目名称:G935FGaXusKernel2,代码行数:13,代码来源:exfat_api.c

示例13: FsReadStat

INT32 FsReadStat(struct inode *inode, DIR_ENTRY_T *info)
{
	INT32 err;
	struct super_block *sb = inode->i_sb;
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);

	sm_P(&(fs_struct[p_fs->drv].v_sem));

	err = ffsGetStat(inode, info);

	sm_V(&(fs_struct[p_fs->drv].v_sem));

	return(err);
}
开发者ID:GAXUSXX,项目名称:G935FGaXusKernel2,代码行数:14,代码来源:exfat_api.c

示例14: FsSetAttr

INT32 FsSetAttr(struct inode *inode, UINT32 attr)
{
	INT32 err;
	struct super_block *sb = inode->i_sb;
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);

	sm_P(&(fs_struct[p_fs->drv].v_sem));

	err = ffsSetAttr(inode, attr);

	sm_V(&(fs_struct[p_fs->drv].v_sem));

	return(err);
}
开发者ID:GAXUSXX,项目名称:G935FGaXusKernel2,代码行数:14,代码来源:exfat_api.c

示例15: FsSyncVol

/* FsSyncVol : synchronize a file system volume */
int FsSyncVol(struct super_block *sb, int do_sync)
{
	int err;
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);

	/* acquire the lock for file system critical section */
	sm_P(&p_fs->v_sem);

	err = ffsSyncVol(sb, do_sync);

	/* release the lock for file system critical section */
	sm_V(&p_fs->v_sem);

	return err;
} /* end of FsSyncVol */
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:16,代码来源:exfat_api.c


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