vfs_inode.c (20f8e032e6dc7053ab803f488e2a8839cd2f69a6) | vfs_inode.c (fceef393a538134f03b778c5d2519e670269342f) |
---|---|
1/* 2 * linux/fs/9p/vfs_inode.c 3 * 4 * This file contains vfs inode ops for the 9P2000 protocol. 5 * 6 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> 7 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov> 8 * --- 437 unchanged lines hidden (view full) --- 446 * v9fs_clear_inode - release an inode 447 * @inode: inode to release 448 * 449 */ 450void v9fs_evict_inode(struct inode *inode) 451{ 452 struct v9fs_inode *v9inode = V9FS_I(inode); 453 | 1/* 2 * linux/fs/9p/vfs_inode.c 3 * 4 * This file contains vfs inode ops for the 9P2000 protocol. 5 * 6 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> 7 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov> 8 * --- 437 unchanged lines hidden (view full) --- 446 * v9fs_clear_inode - release an inode 447 * @inode: inode to release 448 * 449 */ 450void v9fs_evict_inode(struct inode *inode) 451{ 452 struct v9fs_inode *v9inode = V9FS_I(inode); 453 |
454 truncate_inode_pages_final(&inode->i_data); | 454 truncate_inode_pages_final(inode->i_mapping); |
455 clear_inode(inode); | 455 clear_inode(inode); |
456 filemap_fdatawrite(&inode->i_data); | 456 filemap_fdatawrite(inode->i_mapping); |
457 458 v9fs_cache_inode_put_cookie(inode); 459 /* clunk the fid stashed in writeback_fid */ 460 if (v9inode->writeback_fid) { 461 p9_client_clunk(v9inode->writeback_fid); 462 v9inode->writeback_fid = NULL; 463 } 464} --- 753 unchanged lines hidden (view full) --- 1218 memcpy(&i, &path, sizeof(ino_t)); 1219 else 1220 i = (ino_t) (path ^ (path >> 32)); 1221 1222 return i; 1223} 1224 1225/** | 457 458 v9fs_cache_inode_put_cookie(inode); 459 /* clunk the fid stashed in writeback_fid */ 460 if (v9inode->writeback_fid) { 461 p9_client_clunk(v9inode->writeback_fid); 462 v9inode->writeback_fid = NULL; 463 } 464} --- 753 unchanged lines hidden (view full) --- 1218 memcpy(&i, &path, sizeof(ino_t)); 1219 else 1220 i = (ino_t) (path ^ (path >> 32)); 1221 1222 return i; 1223} 1224 1225/** |
1226 * v9fs_vfs_follow_link - follow a symlink path | 1226 * v9fs_vfs_get_link - follow a symlink path |
1227 * @dentry: dentry for symlink | 1227 * @dentry: dentry for symlink |
1228 * @cookie: place to pass the data to put_link() | 1228 * @inode: inode for symlink 1229 * @done: delayed call for when we are done with the return value |
1229 */ 1230 | 1230 */ 1231 |
1231static const char *v9fs_vfs_follow_link(struct dentry *dentry, void **cookie) | 1232static const char *v9fs_vfs_get_link(struct dentry *dentry, 1233 struct inode *inode, 1234 struct delayed_call *done) |
1232{ | 1235{ |
1233 struct v9fs_session_info *v9ses = v9fs_dentry2v9ses(dentry); 1234 struct p9_fid *fid = v9fs_fid_lookup(dentry); | 1236 struct v9fs_session_info *v9ses; 1237 struct p9_fid *fid; |
1235 struct p9_wstat *st; 1236 char *res; 1237 | 1238 struct p9_wstat *st; 1239 char *res; 1240 |
1241 if (!dentry) 1242 return ERR_PTR(-ECHILD); 1243 1244 v9ses = v9fs_dentry2v9ses(dentry); 1245 fid = v9fs_fid_lookup(dentry); |
|
1238 p9_debug(P9_DEBUG_VFS, "%pd\n", dentry); 1239 1240 if (IS_ERR(fid)) 1241 return ERR_CAST(fid); 1242 1243 if (!v9fs_proto_dotu(v9ses)) 1244 return ERR_PTR(-EBADF); 1245 --- 8 unchanged lines hidden (view full) --- 1254 } 1255 res = st->extension; 1256 st->extension = NULL; 1257 if (strlen(res) >= PATH_MAX) 1258 res[PATH_MAX - 1] = '\0'; 1259 1260 p9stat_free(st); 1261 kfree(st); | 1246 p9_debug(P9_DEBUG_VFS, "%pd\n", dentry); 1247 1248 if (IS_ERR(fid)) 1249 return ERR_CAST(fid); 1250 1251 if (!v9fs_proto_dotu(v9ses)) 1252 return ERR_PTR(-EBADF); 1253 --- 8 unchanged lines hidden (view full) --- 1262 } 1263 res = st->extension; 1264 st->extension = NULL; 1265 if (strlen(res) >= PATH_MAX) 1266 res[PATH_MAX - 1] = '\0'; 1267 1268 p9stat_free(st); 1269 kfree(st); |
1262 return *cookie = res; | 1270 set_delayed_call(done, kfree_link, res); 1271 return res; |
1263} 1264 1265/** 1266 * v9fs_vfs_mkspecial - create a special file 1267 * @dir: inode to create special file in 1268 * @dentry: dentry to create 1269 * @perm: mode to create special file 1270 * @extension: 9p2000.u format extension string representing special file --- 176 unchanged lines hidden (view full) --- 1447 1448static const struct inode_operations v9fs_file_inode_operations = { 1449 .getattr = v9fs_vfs_getattr, 1450 .setattr = v9fs_vfs_setattr, 1451}; 1452 1453static const struct inode_operations v9fs_symlink_inode_operations = { 1454 .readlink = generic_readlink, | 1272} 1273 1274/** 1275 * v9fs_vfs_mkspecial - create a special file 1276 * @dir: inode to create special file in 1277 * @dentry: dentry to create 1278 * @perm: mode to create special file 1279 * @extension: 9p2000.u format extension string representing special file --- 176 unchanged lines hidden (view full) --- 1456 1457static const struct inode_operations v9fs_file_inode_operations = { 1458 .getattr = v9fs_vfs_getattr, 1459 .setattr = v9fs_vfs_setattr, 1460}; 1461 1462static const struct inode_operations v9fs_symlink_inode_operations = { 1463 .readlink = generic_readlink, |
1455 .follow_link = v9fs_vfs_follow_link, 1456 .put_link = kfree_put_link, | 1464 .get_link = v9fs_vfs_get_link, |
1457 .getattr = v9fs_vfs_getattr, 1458 .setattr = v9fs_vfs_setattr, 1459}; 1460 | 1465 .getattr = v9fs_vfs_getattr, 1466 .setattr = v9fs_vfs_setattr, 1467}; 1468 |