~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to modules/solaris/vmhgfs/docs/hgfs-9-to-10.txt

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-03-20 10:19:00 UTC
  • mfrom: (1.1.4 upstream) (2.4.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090320101900-1o604camiubq2de8
Tags: 2009.03.18-154848-2
Correcting patch system depends (Closes: #520493).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Notes for porting Hgfs from Solaris 9 to 10
 
2
===========================================
 
3
 
 
4
Note that Solaris 10 is a beta and still in development, so these notes may
 
5
become outdated.  They are based on the headers in build 52.
 
6
 
 
7
vnode.h
 
8
-------
 
9
o Now use vn_make_ops() to create vnodeops
 
10
   int vn_make_ops(const char *, const fs_operation_def_t *, vnodeops_t **);
 
11
   void vn_freevnodeops(vnodeops_t *);
 
12
 
 
13
o Now use vfs_makefsops()/vfs_setfsops() to create vfsops
 
14
   (see vfs.h notes)
 
15
 
 
16
o There is a new structure struct fs_operation_def_t:
 
17
  
 
18
   typedef int (*fs_generic_func_p) ();
 
19
   
 
20
   typedef struct fs_operation_def {
 
21
      char *name;                /* name of operation (NUL terminated) */
 
22
      fs_generic_func_p func;    /* function implementing operation */
 
23
   } fs_operation_def_t;
 
24
 
 
25
  The name is likely one of the VOPNAME_* macros.
 
26
 
 
27
o vnodes should only be created by calls to vn_alloc(); they may not be embedded
 
28
  in fs-specific structures; vnodes may change size.  Definitions for related
 
29
  vnode allocation/freeing functions are:
 
30
   vnode_t *vn_alloc(int);
 
31
   void    vn_reinit(vnode_t *);
 
32
   void    vn_free(vnode_t *);
 
33
 
 
34
  Note that the vn_free() function destroys the vnode's mutex so doing so
 
35
  yourself will crash the system.
 
36
 
 
37
o There are a quite a few new vnode manipulation functions; see vnode.h.
 
38
  
 
39
o v_vfsmountedhere member of struct vnode is private, perhaps we shouldn't touch
 
40
  it; it is also protected by vn_vfswlock in vnode.c
 
41
 
 
42
o A number of private members were added to struct vnode -- shouldn't affect us
 
43
 
 
44
o New structure struct caller_context contains PID of caller, system ID, and
 
45
  a caller identifier.  This structure is now passed in as the last argument to:
 
46
   o vop_read
 
47
   o vop_write
 
48
   o vop_setattr
 
49
   o vop_rwlock
 
50
   o vop_rwunlock
 
51
   o vop_space
 
52
 
 
53
o vop_shrlock now takes an additional cred_t * argument as its last argument
 
54
 
 
55
o A new vnodeop was added:
 
56
   int (*vop_vnevent)(vnode_t *, vnevent_t);
 
57
  
 
58
  This likely has to do "something" to the vnode depending on the value of
 
59
  vnevent_t.  It is likely that this is required since the vnode now stores the
 
60
  cached path of the file in its private char *v_path member.  Can we use
 
61
  vnevent_*() for help, or do these call us?  How about the new vn_setpath*(),
 
62
  vn_path(), and vn_copypath() functions?  (We should use the VN_SETPATH() macro
 
63
  instead of calling vn_setpath() directly.)
 
64
 
 
65
o vnevent_t is a new enum with the following definition:
 
66
   typedef enum vnevent {
 
67
      VE_SUPPORT     = 0,        /* Query */
 
68
      VE_RENAME_SRC  = 1,        /* Rename, with vnode as source */
 
69
      VE_RENAME_DEST = 2,        /* Rename, with vnode as target/dest */
 
70
      VE_REMOVE      = 3,        /* Remove of vnode's name */
 
71
      VE_RMDIR       = 4         /* Remove of directory vnode's name */
 
72
   } vnevent_t;
 
73
 
 
74
o A new macro VN_SET_VFS_TYPE_DEV(vp, vfsp, type, dev) was created, but it is
 
75
  trivial.
 
76
 
 
77
o VN_CMP() now calls vn_getops() rather than dereferencing the vnode's vn_ops
 
78
  member.  (We should use this to access that variable too, it seems.)
 
79
 
 
80
o There is no more VN_INIT() macro, but it was trivial anyhow.
 
81
 
 
82
 
 
83
vfs.h
 
84
-----
 
85
o Filesystems now must supply their list of vfs operations using:
 
86
   int vfs_setfsops(int, const fs_operation_def_t *, vfsops_t **);
 
87
 
 
88
o There are also functions for filesystems to make, free, etc vfs operation
 
89
  structures:
 
90
   int  vfs_makefsops(const fs_operation_def_t *, vfsops_t **);
 
91
   void vfs_freevfsops(vfsops_t *);
 
92
   int  vfs_freevfsops_by_type(int);
 
93
   void vfs_setops(vfs_t *, vfsops_t *);
 
94
   vfsops_t *vfs_getops(vfs_t *vfsp);
 
95
   <there are some more: see vfs.h>
 
96
 
 
97
  The names placed in fs_operation_def_t->name are likely one of the VFSNAME_*
 
98
  macros.
 
99
 
 
100
o This isn't relevant to our layer, but the vfs now keeps filesystems in
 
101
  a double linked circular list rather than a singly linked list.  There are
 
102
  also issues with zones: each zone has a list of its own mounts.
 
103
 
 
104
o The vfs_op member of struct vfs should never be directly accessed; use the
 
105
  accessor functions described above.
 
106
 
 
107
o There is a new function in struct vfsops:
 
108
   int (*vfs_vnstate)(vfs_t *, vnode_t *, vntrans_t);
 
109
 
 
110
o vntrans_t is a new enum that is either VNTRANS_EXISTS, VNTRANS_IDLED,
 
111
  VNTRANS_RECLAIMED, or VNTRANS_DESTROYED.
 
112
 
 
113
o The function pointer vsw_init member of struct vfssw now has the definition:
 
114
   int (*vsw_init)(int, char *)
 
115
 
 
116
  Also, the vsw_optproto and vsw_vfsops members are no longer pointers.
 
117
 
 
118
  Since we will not be directly including this structure in our modlfs anymore
 
119
  (see modctl.h notes), these differences probably don't matter.
 
120
 
 
121
o There is a new structure (that will be used in our modlfs now instead of
 
122
  struct vfssw).
 
123
  
 
124
  typedef struct vfsdef_v2 {
 
125
     int       def_version;             /* structure version, must be first */
 
126
     char      *name;                   /* filesystem type name */
 
127
     int       (*init) (int, char *);   /* init routine */
 
128
     int       flags;                   /* fs flags */
 
129
     mntopts_t *optproto;               /* mount options table prototype */
 
130
  } vfsdef_v2;
 
131
 
 
132
  Note that build 58 contains the same structure but it is called vfsdef_v3.
 
133
 
 
134
o There are a few other additional macros and functions that likely won't matter
 
135
  to us.
 
136
  
 
137
modctl.h
 
138
--------
 
139
o struct modlfs now has a struct vfsdef_v3 instead of a struct vfssw
 
140
o other changes don't seem relevant
 
141
 
 
142
devops.h
 
143
--------
 
144
o There are no changes to struct cb_ops, struct dev_ops, or any of the command
 
145
  enums taken by these functions.