Lines Matching defs:con

1178 int cache_file_name_generate(char *fullname, struct hmdfs_peer *con,
1181 struct hmdfs_sb_info *sbi = con->sbi;
1194 strncpy(cid, con->cid, HMDFS_CFN_CID_SIZE - 1);
1338 * @con: the connection peer
1349 struct file *cache_file_persistent(struct hmdfs_peer *con, struct file *filp,
1354 char *cid = server ? HMDFS_SERVER_CID : (char *)con->cid;
1360 if (!con->sbi->s_dentry_cache)
1363 cfn = find_cfn(con->sbi, cid, relative_path, server);
1372 err = cache_file_name_generate(fullname, con, relative_path, server);
1399 newf = insert_cfn(con->sbi, fullname, relative_path, cid, server);
1979 static void cache_file_find_and_delete(struct hmdfs_peer *con,
1984 cfn = find_cfn(con->sbi, con->cid, relative_path, false);
1992 void cache_file_delete_by_dentry(struct hmdfs_peer *con, struct dentry *dentry)
2001 cache_file_find_and_delete(con, relative_path);
2005 struct file *hmdfs_get_new_dentry_file(struct hmdfs_peer *con,
2009 struct hmdfs_sb_info *sbi = con->sbi;
2018 err = hmdfs_client_start_readdir(con, filp, relative_path, len, header);
2022 con->device_id, err);
2030 void add_cfn_to_item(struct dentry *dentry, struct hmdfs_peer *con,
2036 err = hmdfs_add_cache_list(con->device_id, dentry, file);
2039 con->device_id, err);
2044 int hmdfs_add_file_to_cache(struct dentry *dentry, struct hmdfs_peer *con,
2047 struct hmdfs_sb_info *sbi = con->sbi;
2051 newf = cache_file_persistent(con, file, relative_path, false);
2053 cache_file_find_and_delete(con, relative_path);
2055 return hmdfs_add_cache_list(con->device_id, dentry, newf);
2058 static struct file *read_header_and_revalidate(struct hmdfs_peer *con,
2065 if (read_header(con->sbi, filp, &header) == 0)
2068 return hmdfs_get_new_dentry_file(con, relative_path, p);
2071 void remote_file_revalidate_cfn(struct dentry *dentry, struct hmdfs_peer *con,
2078 file = read_header_and_revalidate(con, cfn->filp, relative_path);
2088 con->device_id);
2090 add_cfn_to_item(dentry, con, cfn);
2097 err = hmdfs_add_file_to_cache(dentry, con, file, relative_path);
2100 con->device_id, err);
2104 void remote_file_revalidate_item(struct dentry *dentry, struct hmdfs_peer *con,
2111 file = read_header_and_revalidate(con, item->filp, relative_path);
2121 con->device_id);
2129 cache_file_find_and_delete(con, relative_path);
2131 err = hmdfs_add_file_to_cache(dentry, con, file, relative_path);
2134 con->device_id, err);
2138 bool get_remote_dentry_file(struct dentry *dentry, struct hmdfs_peer *con)
2142 struct hmdfs_sb_info *sbi = con->sbi;
2148 if (hmdfs_cache_revalidate(READ_ONCE(con->conn_time), con->device_id,
2158 if (hmdfs_cache_revalidate(READ_ONCE(con->conn_time), con->device_id,
2162 item = hmdfs_find_cache_item(con->device_id, dentry);
2164 remote_file_revalidate_item(dentry, con, item, relative_path);
2169 cfn = find_cfn(sbi, con->cid, relative_path, false);
2171 remote_file_revalidate_cfn(dentry, con, cfn, relative_path);
2176 filp = hmdfs_get_new_dentry_file(con, relative_path, NULL);
2182 err = hmdfs_add_file_to_cache(dentry, con, filp, relative_path);
2185 (unsigned long)con->device_id, err);
2192 (unsigned long)con->device_id, err);
2276 void hmdfs_remove_cache_filp(struct hmdfs_peer *con, struct dentry *dentry)
2289 if (con->device_id == item->dev_id) {
2292 cache_file_delete_by_dentry(con, dentry);
2324 void hmdfs_add_remote_cache_list(struct hmdfs_peer *con, const char *dir_path)
2332 err = kern_path(con->sbi->local_dst, 0, &root_path);
2349 /* find duplicate con */
2353 if (item->con->device_id == con->device_id) {
2366 item->con = con;
2422 hmdfs_send_drop_push(item->con, relative_path);
2484 if (item->con->device_id == device_id) {