Diff for /src/sys/vfs/nwfs/nwfs_subr.c between versions 1.5 and 1.6

version 1.5, 2003/08/07 21:54:35 version 1.6, 2004/04/22 17:56:44
Line 53 Line 53
 MALLOC_DEFINE(M_NWFSDATA, "NWFS data", "NWFS private data");  MALLOC_DEFINE(M_NWFSDATA, "NWFS data", "NWFS private data");
   
 static void   static void 
 ncp_extract_file_info(struct nwmount *nmp, struct ncp_rq *rqp, struct nw_entry_info *target) {  ncp_extract_file_info(struct nwmount *nmp, struct ncp_rq *rqp,
                         struct nw_entry_info *target)
   {
         u_char name_len;          u_char name_len;
         const int info_struct_size = sizeof(struct nw_entry_info) - 257;          const int info_struct_size = sizeof(struct nw_entry_info) - 257;
   
Line 68  ncp_extract_file_info(struct nwmount *nm Line 70  ncp_extract_file_info(struct nwmount *nm
   
 static void   static void 
 ncp_update_file_info(struct nwmount *nmp, struct ncp_rq *rqp,   ncp_update_file_info(struct nwmount *nmp, struct ncp_rq *rqp, 
         struct nw_entry_info *target)                       struct nw_entry_info *target)
 {  {
         int info_struct_size = sizeof(struct nw_entry_info) - 257;          int info_struct_size = sizeof(struct nw_entry_info) - 257;
   
Line 77  ncp_update_file_info(struct nwmount *nmp Line 79  ncp_update_file_info(struct nwmount *nmp
 }  }
   
 int  int
 ncp_initsearch(struct vnode *dvp,struct thread *td,struct ucred *cred)  ncp_initsearch(struct vnode *dvp, struct thread *td, struct ucred *cred)
 {  {
         struct nwmount *nmp = VTONWFS(dvp);          struct nwmount *nmp = VTONWFS(dvp);
         struct ncp_conn *conn = NWFSTOCONN(nmp);          struct ncp_conn *conn = NWFSTOCONN(nmp);
Line 103  int Line 105  int
 ncp_search_for_file_or_subdir(struct nwmount *nmp,  ncp_search_for_file_or_subdir(struct nwmount *nmp,
                               struct nw_search_seq *seq,                                struct nw_search_seq *seq,
                               struct nw_entry_info *target,                                struct nw_entry_info *target,
                               struct thread *td,struct ucred *cred)                                struct thread *td, struct ucred *cred)
 {  {
         struct ncp_conn *conn = NWFSTOCONN(nmp);          struct ncp_conn *conn = NWFSTOCONN(nmp);
         int error;          int error;
Line 132  ncp_search_for_file_or_subdir(struct nwm Line 134  ncp_search_for_file_or_subdir(struct nwm
  * directory.   * directory.
  */   */
 int   int 
 ncp_obtain_info(struct nwmount *nmp,  u_int32_t dirent,  ncp_obtain_info(struct nwmount *nmp, u_int32_t dirent,
                 int namelen, char *path, struct nw_entry_info *target,                  int namelen, char *path, struct nw_entry_info *target,
                 struct thread *td,struct ucred *cred)                  struct thread *td, struct ucred *cred)
 {  {
         struct ncp_conn *conn=NWFSTOCONN(nmp);          struct ncp_conn *conn=NWFSTOCONN(nmp);
         int error;          int error;
Line 168  ncp_obtain_info(struct nwmount *nmp,  u_ Line 170  ncp_obtain_info(struct nwmount *nmp,  u_
  */   */
 int  int
 ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap,  ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap,
                 struct thread *td,struct ucred *cred)             struct thread *td, struct ucred *cred)
 {  {
         struct nwmount *nmp;          struct nwmount *nmp;
         struct nwnode *dnp = VTONW(dvp);          struct nwnode *dnp = VTONW(dvp);
Line 213  ConvertToNWfromDWORD(u_int32_t sfd, ncp_ Line 215  ConvertToNWfromDWORD(u_int32_t sfd, ncp_
  * entry that wants to be opened.   * entry that wants to be opened.
  */   */
 int   int 
 ncp_open_create_file_or_subdir(struct nwmount *nmp,struct vnode *dvp,int namelen,  ncp_open_create_file_or_subdir(struct nwmount *nmp, struct vnode *dvp,
             char *name, int open_create_mode, u_int32_t create_attributes,                                 int namelen, char *name, int open_create_mode,
             int desired_acc_rights, struct ncp_open_info *nop,                                 u_int32_t create_attributes,
             struct thread *td,struct ucred *cred)                                 int desired_acc_rights,
                                  struct ncp_open_info *nop,
                                  struct thread *td, struct ucred *cred)
 {  {
                   
         struct ncp_conn *conn=NWFSTOCONN(nmp);          struct ncp_conn *conn=NWFSTOCONN(nmp);
Line 261  ncp_open_create_file_or_subdir(struct nw Line 265  ncp_open_create_file_or_subdir(struct nw
 }  }
   
 int  int
 ncp_close_file(struct ncp_conn *conn, ncp_fh *fh,struct thread *td,struct ucred *cred) {  ncp_close_file(struct ncp_conn *conn, ncp_fh *fh, struct thread *td,
                  struct ucred *cred)
   {
         int error;          int error;
         DECLARE_RQ;          DECLARE_RQ;
   
Line 274  ncp_close_file(struct ncp_conn *conn, nc Line 280  ncp_close_file(struct ncp_conn *conn, nc
 }  }
   
 int  int
 ncp_DeleteNSEntry(struct nwmount *nmp, u_int32_t dirent,  ncp_DeleteNSEntry(struct nwmount *nmp, u_int32_t dirent, int namelen,
                         int namelen,char *name,struct thread *td,struct ucred *cred)                    char *name, struct thread *td, struct ucred *cred)
 {  {
         int error;          int error;
         struct ncp_conn *conn=NWFSTOCONN(nmp);          struct ncp_conn *conn=NWFSTOCONN(nmp);
Line 294  ncp_DeleteNSEntry(struct nwmount *nmp, u Line 300  ncp_DeleteNSEntry(struct nwmount *nmp, u
   
 int   int 
 ncp_nsrename(struct ncp_conn *conn, int volume, int ns, int oldtype,   ncp_nsrename(struct ncp_conn *conn, int volume, int ns, int oldtype, 
         struct ncp_nlstables *nt,               struct ncp_nlstables *nt, nwdirent fdir, char *old_name,
         nwdirent fdir, char *old_name, int oldlen,               int oldlen, nwdirent tdir, char *new_name, int newlen,
         nwdirent tdir, char *new_name, int newlen,               struct thread *td, struct ucred *cred)
         struct thread *td, struct ucred *cred)  
 {  {
         DECLARE_RQ;          DECLARE_RQ;
         int error;          int error;
Line 326  ncp_nsrename(struct ncp_conn *conn, int Line 331  ncp_nsrename(struct ncp_conn *conn, int
   
 int  int
 ncp_modify_file_or_subdir_dos_info(struct nwmount *nmp, struct vnode *vp,   ncp_modify_file_or_subdir_dos_info(struct nwmount *nmp, struct vnode *vp, 
                                 u_int32_t info_mask,                                     u_int32_t info_mask,
                                 struct nw_modify_dos_info *info,                                     struct nw_modify_dos_info *info,
                                 struct thread *td,struct ucred *cred)                                     struct thread *td, struct ucred *cred)
 {  {
         struct nwnode *np=VTONW(vp);          struct nwnode *np=VTONW(vp);
         u_int8_t volnum = nmp->n_volume;          u_int8_t volnum = nmp->n_volume;
Line 351  ncp_modify_file_or_subdir_dos_info(struc Line 356  ncp_modify_file_or_subdir_dos_info(struc
 }  }
   
 int  int
 ncp_setattr(vp, vap, cred, td)  ncp_setattr(struct vnode *vp, struct vattr *vap, struct ucred *cred,
         struct vnode *vp;              struct thread *td)
         struct vattr *vap;  
         struct ucred *cred;  
         struct thread *td;  
 {  {
         struct nwmount *nmp=VTONWFS(vp);          struct nwmount *nmp=VTONWFS(vp);
         struct nwnode *np=VTONW(vp);          struct nwnode *np=VTONW(vp);
Line 399  ncp_setattr(vp, vap, cred, td) Line 401  ncp_setattr(vp, vap, cred, td)
 }  }
   
 int  int
 ncp_get_volume_info_with_number(struct ncp_conn *conn,   ncp_get_volume_info_with_number(struct ncp_conn *conn, int n,
             int n, struct ncp_volume_info *target,                                  struct ncp_volume_info *target,
             struct thread *td,struct ucred *cred) {                                  struct thread *td, struct ucred *cred)
   {
         int error,len;          int error,len;
         DECLARE_RQ;          DECLARE_RQ;
   
Line 429  ncp_get_volume_info_with_number(struct n Line 432  ncp_get_volume_info_with_number(struct n
   
 int  int
 ncp_get_namespaces(struct ncp_conn *conn, u_int32_t volume, int *nsf,  ncp_get_namespaces(struct ncp_conn *conn, u_int32_t volume, int *nsf,
             struct thread *td,struct ucred *cred) {                     struct thread *td, struct ucred *cred)
   {
         int error;          int error;
         u_int8_t ns;          u_int8_t ns;
         u_int16_t nscnt;          u_int16_t nscnt;
Line 452  ncp_get_namespaces(struct ncp_conn *conn Line 456  ncp_get_namespaces(struct ncp_conn *conn
   
 int  int
 ncp_lookup_volume(struct ncp_conn *conn, char *volname,   ncp_lookup_volume(struct ncp_conn *conn, char *volname, 
                 u_char *volNum, u_int32_t *dirEnt,                    u_char *volNum, u_int32_t *dirEnt,
                 struct thread *td,struct ucred *cred)                    struct thread *td, struct ucred *cred)
 {  {
         int error;          int error;
         DECLARE_RQ;          DECLARE_RQ;
Line 534  static u_short lastdtime; Line 538  static u_short lastdtime;
  * file timestamps. The passed in unix time is assumed to be in GMT.   * file timestamps. The passed in unix time is assumed to be in GMT.
  */   */
 void  void
 ncp_unix2dostime(tsp, tzoff, ddp, dtp, dhp)  ncp_unix2dostime(struct timespec *tsp, int tzoff, u_int16_t *ddp,
         struct timespec *tsp;                   u_int16_t *dtp, u_int8_t *dhp)
         int tzoff;  
         u_int16_t *ddp;  
         u_int16_t *dtp;  
         u_int8_t *dhp;  
 {  {
         u_long t;          u_long t;
         u_long days;          u_long days;
Line 615  static u_long  lastseconds; Line 615  static u_long  lastseconds;
  * not be too efficient.   * not be too efficient.
  */   */
 void  void
 ncp_dos2unixtime(dd, dt, dh, tzoff, tsp)  ncp_dos2unixtime(u_int dd, u_int dt, u_int dh, int tzoff, struct timespec *tsp)
         u_int dd;  
         u_int dt;  
         u_int dh;  
         int tzoff;  
         struct timespec *tsp;  
 {  {
         u_long seconds;          u_long seconds;
         u_long month;          u_long month;

Removed from v.1.5  
changed lines
  Added in v.1.6