Пример #1
0
TEST_F(PutFileTest, VersionOutdated)
{
    std::string path = "/not_empty_dir_00/existed_file_10";
    std::string rpath = _dataRoot 
        + PATH_SEPARATOR_STRING
        + BUCKET_NAME(VALID_BUCKET_ID)
        + PATH_SEPARATOR_STRING
        + USER_NAME(VALID_USER_ID)
        + path;

    int rt = 0;

    FileAttr attr;

    rt = ::open(rpath.c_str(), O_RDWR);
    ASSERT_NE(-1, rt);

    int fd = rt;

    ASSERT_EQ(sizeof(FileAttr), ::read(fd, &attr, sizeof(FileAttr)));

    attr.m_Version = 5;

    ASSERT_NE(-1, ::lseek(fd, 0, SEEK_SET));

    ASSERT_EQ(sizeof(FileAttr), ::write(fd, &attr, sizeof(FileAttr)));

    ::close(fd);

    putFile(VALID_USER_ID, path,
            &PutFileTest::cbVersionOutdated, 3);
    putFile(VALID_USER_ID, path,
            &PutFileTest::cbVersionOutdated, 8);
}
Пример #2
0
buddywin_t
	*bgetanywin(conn_t *conn, const char *buddy) {
	buddywin_t	*bwin = conn->curbwin;

	assert(buddy != NULL);
	if (bwin == NULL)
		return(NULL);
	do {
		if (firetalk_compare_nicks(conn->conn, buddy, bwin->winname) == FE_SUCCESS)
			return(bwin);
		if ((bwin->et == BUDDY) && (firetalk_compare_nicks(conn->conn, buddy, USER_NAME(bwin->e.buddy)) == FE_SUCCESS))
			return(bwin);
	} while ((bwin = bwin->next) != conn->curbwin);

	return(NULL);
}
	efficiency = tegra_emc_bw_efficiency;
	if (total_bw && efficiency && (efficiency < 100)) {
		total_bw = total_bw / efficiency;
		total_bw = (total_bw < max_rate / 100) ?
				(total_bw * 100) : max_rate;
	}
	return max(total_bw, iso_bw);
}

#ifdef CONFIG_DEBUG_FS

#define USER_NAME(module) \
[EMC_USER_##module] = #module

static const char *emc_user_names[EMC_USER_NUM] = {
	USER_NAME(DC1),
	USER_NAME(DC2),
	USER_NAME(VI),
	USER_NAME(MSENC),
	USER_NAME(2D),
	USER_NAME(3D),
	USER_NAME(BB),
};

static int emc_usage_table_show(struct seq_file *s, void *data)
{
	int i, j;

	seq_printf(s, "EMC USAGE\t\tISO SHARE %% @ last bw %lu\n", last_iso_bw);

	for (i = 0; i < TEGRA_EMC_ISO_USE_CASES_MAX_NUM; i++) {