VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c@ 33439

Last change on this file since 33439 was 33439, checked in by vboxsync, 14 years ago

IPRT, Linux additions, Shared folders: added support for guest shared folder (thanks Brian Campbell)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1#include "vfsmod.h"
2
3static void *sf_follow_link(struct dentry *dentry, struct nameidata *nd)
4{
5 struct inode *inode = dentry->d_inode;
6 struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
7 struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
8 int error = -ENOMEM;
9 unsigned long page = get_zeroed_page(GFP_KERNEL);
10 int rc;
11
12 if (page)
13 {
14 error = 0;
15 rc = vboxReadLink(&client_handle, &sf_g->map, sf_i->path, PATH_MAX, (char *)page);
16 if (RT_FAILURE(rc))
17 {
18 LogFunc(("vboxReadLink failed, caller=%s, rc=%Rrc\n",
19 __func__, rc));
20 error = -EPROTO;
21 }
22 }
23 nd_set_link(nd, error ? ERR_PTR(error) : (char *)page);
24 return NULL;
25}
26
27static void sf_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
28{
29 char *page = nd_get_link(nd);
30 if (!IS_ERR(page))
31 free_page((unsigned long)page);
32}
33
34struct inode_operations sf_lnk_iops =
35{
36 .readlink = generic_readlink,
37 .follow_link = sf_follow_link,
38 .put_link = sf_put_link
39};
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette