- 時間撮記:
- 2011-2-4 下午03:11:11 (14 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c
r35472 r35854 23 23 static void *sf_follow_link(struct dentry *dentry, struct nameidata *nd) 24 24 { 25 26 27 28 29 unsigned long page =get_zeroed_page(GFP_KERNEL);30 25 struct inode *inode = dentry->d_inode; 26 struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb); 27 struct sf_inode_info *sf_i = GET_INODE_INFO(inode); 28 int error = -ENOMEM; 29 char *path = (char*)get_zeroed_page(GFP_KERNEL); 30 int rc; 31 31 32 if (page) 32 if (path) 33 { 34 error = 0; 35 rc = vboxReadLink(&client_handle, &sf_g->map, sf_i->path, PATH_MAX, path); 36 if (RT_FAILURE(rc)) 33 37 { 34 error = 0; 35 rc = vboxReadLink(&client_handle, &sf_g->map, sf_i->path, PATH_MAX, (char *)page); 36 if (RT_FAILURE(rc)) 37 { 38 LogFunc(("vboxReadLink failed, caller=%s, rc=%Rrc\n", 39 __func__, rc)); 40 error = -EPROTO; 41 } 38 LogFunc(("vboxReadLink failed, caller=%s, rc=%Rrc\n", __func__, rc)); 39 free_page((unsigned long)path); 40 error = -EPROTO; 42 41 } 43 nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); 44 return NULL; 42 } 43 nd_set_link(nd, error ? ERR_PTR(error) : path); 44 return NULL; 45 45 } 46 46 47 47 static void sf_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) 48 48 { 49 50 51 49 char *page = nd_get_link(nd); 50 if (!IS_ERR(page)) 51 free_page((unsigned long)page); 52 52 } 53 53 54 54 struct inode_operations sf_lnk_iops = 55 55 { 56 57 58 56 .readlink = generic_readlink, 57 .follow_link = sf_follow_link, 58 .put_link = sf_put_link 59 59 }; 60 60
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器