Lines Matching defs:con

1179 int cache_file_name_generate(char *fullname, struct hmdfs_peer *con,
1182 struct hmdfs_sb_info *sbi = con->sbi;
1195 strncpy(cid, con->cid, HMDFS_CFN_CID_SIZE - 1);
1339 * @con: the connection peer
1350 struct file *cache_file_persistent(struct hmdfs_peer *con, struct file *filp,
1355 char *cid = server ? HMDFS_SERVER_CID : (char *)con->cid;
1361 if (!con->sbi->s_dentry_cache)
1364 cfn = find_cfn(con->sbi, cid, relative_path, server);
1373 err = cache_file_name_generate(fullname, con, relative_path, server);
1400 newf = insert_cfn(con->sbi, fullname, relative_path, cid, server);
1980 static void cache_file_find_and_delete(struct hmdfs_peer *con,
1985 cfn = find_cfn(con->sbi, con->cid, relative_path, false);
1993 void cache_file_delete_by_dentry(struct hmdfs_peer *con, struct dentry *dentry)
2002 cache_file_find_and_delete(con, relative_path);
2006 struct file *hmdfs_get_new_dentry_file(struct hmdfs_peer *con,
2010 struct hmdfs_sb_info *sbi = con->sbi;
2019 err = hmdfs_client_start_readdir(con, filp, relative_path, len, header);
2023 con->device_id, err);
2031 void add_cfn_to_item(struct dentry *dentry, struct hmdfs_peer *con,
2037 err = hmdfs_add_cache_list(con->device_id, dentry, file);
2040 con->device_id, err);
2045 int hmdfs_add_file_to_cache(struct dentry *dentry, struct hmdfs_peer *con,
2048 struct hmdfs_sb_info *sbi = con->sbi;
2052 newf = cache_file_persistent(con, file, relative_path, false);
2054 cache_file_find_and_delete(con, relative_path);
2056 return hmdfs_add_cache_list(con->device_id, dentry, newf);
2059 static struct file *read_header_and_revalidate(struct hmdfs_peer *con,
2066 if (read_header(con->sbi, filp, &header) == 0)
2069 return hmdfs_get_new_dentry_file(con, relative_path, p);
2072 void remote_file_revalidate_cfn(struct dentry *dentry, struct hmdfs_peer *con,
2079 file = read_header_and_revalidate(con, cfn->filp, relative_path);
2089 con->device_id);
2091 add_cfn_to_item(dentry, con, cfn);
2098 err = hmdfs_add_file_to_cache(dentry, con, file, relative_path);
2101 con->device_id, err);
2105 void remote_file_revalidate_item(struct dentry *dentry, struct hmdfs_peer *con,
2112 file = read_header_and_revalidate(con, item->filp, relative_path);
2122 con->device_id);
2130 cache_file_find_and_delete(con, relative_path);
2132 err = hmdfs_add_file_to_cache(dentry, con, file, relative_path);
2135 con->device_id, err);
2139 bool get_remote_dentry_file(struct dentry *dentry, struct hmdfs_peer *con)
2143 struct hmdfs_sb_info *sbi = con->sbi;
2149 if (hmdfs_cache_revalidate(READ_ONCE(con->conn_time), con->device_id,
2159 if (hmdfs_cache_revalidate(READ_ONCE(con->conn_time), con->device_id,
2163 item = hmdfs_find_cache_item(con->device_id, dentry);
2165 remote_file_revalidate_item(dentry, con, item, relative_path);
2170 cfn = find_cfn(sbi, con->cid, relative_path, false);
2172 remote_file_revalidate_cfn(dentry, con, cfn, relative_path);
2177 filp = hmdfs_get_new_dentry_file(con, relative_path, NULL);
2183 err = hmdfs_add_file_to_cache(dentry, con, filp, relative_path);
2186 (unsigned long)con->device_id, err);
2193 (unsigned long)con->device_id, err);
2277 void hmdfs_remove_cache_filp(struct hmdfs_peer *con, struct dentry *dentry)
2290 if (con->device_id == item->dev_id) {
2293 cache_file_delete_by_dentry(con, dentry);
2325 void hmdfs_add_remote_cache_list(struct hmdfs_peer *con, const char *dir_path)
2333 err = kern_path(con->sbi->local_dst, 0, &root_path);
2350 /* find duplicate con */
2354 if (item->con->device_id == con->device_id) {
2367 item->con = con;
2423 hmdfs_send_drop_push(item->con, relative_path);
2485 if (item->con->device_id == device_id) {