1 From rgoldwyn@suse.de Tue Jun 10 15:41:39 2008
2 From: Goldwyn Rodrigues <rgoldwyn@suse.de>
3 Date: Tue Jun 10 14:22:41 IST 2008
4 Subject: Convert novfs to open soure coding standards
5 Message-ID: <1213088555.4964.9.camel@baloo.junglebook>
8 Convert novfs to open source coding standards. Summary -
9 - convert structures from typedefs to structures
10 - change function names
11 - remove unused functions
12 - use correct structures in function prototypes instead of void
14 - return immediately on error (such as ENOMEM), instead of
15 creating enclosing in if..else code blocks for better
18 Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22 fs/novfs/commands.h | 818 ++++++--------
23 fs/novfs/daemon.c | 1031 ++++++------------
24 fs/novfs/file.c | 894 ++++++++-------
25 fs/novfs/inode.c | 2950 ++++++++++++++++++----------------------------------
26 fs/novfs/nwcapi.c | 2888 ++++++++++++++++++++++----------------------------
27 fs/novfs/nwcapi.h | 1019 +----------------
28 fs/novfs/proc.c | 85 -
29 fs/novfs/profile.c | 169 +-
30 fs/novfs/scope.c | 362 +++---
31 fs/novfs/vfs.h | 406 +++----
32 10 files changed, 4133 insertions(+), 6489 deletions(-)
34 --- a/fs/novfs/commands.h
35 +++ b/fs/novfs/commands.h
41 -typedef void *NWHANDLE;
44 -/*typedef struct _ncl_string
48 unsigned char *buffer;
49 @@ -138,206 +134,127 @@ typedef void *NWHANDLE;
51 } NclString, *PNclString;
53 -typedef struct _ncl_string {
56 unsigned char *buffer;
60 -} NclString, *PNclString;
62 -typedef struct _nwd_string {
69 -} NwdString, *PNwdString;
71 -typedef struct _COMMAND_REQUEST_HEADER {
72 +struct novfs_command_request_header {
73 unsigned int CommandType;
74 unsigned long SequenceNumber;
75 - struct schandle SessionId;
76 -} COMMAND_REQUEST_HEADER, *PCOMMAND_REQUEST_HEADER;
77 + struct novfs_schandle SessionId;
81 -typedef struct _COMMAND_REPLY_HEADER {
82 +struct novfs_command_reply_header {
83 unsigned long Sequence_Number;
84 unsigned int ErrorCode;
86 -} COMMAND_REPLY_HEADER, *PCOMMAND_REPLY_HEADER;
89 -typedef struct _CLOSE_REQUEST {
90 - COMMAND_REQUEST_HEADER Command;
91 - NWHANDLE FileHandle;
92 -} CLOSE_REQUEST, *PCLOSE_REQUEST;
94 -typedef struct _CLOSE_REPLY {
95 - COMMAND_REPLY_HEADER Reply;
96 -} CLOSE_REPLY, *PCLOSE_REPLY;
98 -typedef struct _DELETE_FILE_REQUEST {
99 - COMMAND_REQUEST_HEADER Command;
100 +struct novfs_delete_file_request {
101 + struct novfs_command_request_header Command;
102 unsigned int isDirectory;
103 unsigned int pathlength;
104 unsigned char path[1];
105 -} DELETE_FILE_REQUEST, *PDELETE_FILE_REQUEST;
108 -typedef struct _DELETE_FILE_REPLY {
109 - COMMAND_REPLY_HEADER Reply;
110 -} DELETE_FILE_REPLY, *PDELETE_FILE_REPLY;
112 -typedef struct _FLUSH_REQUEST {
113 - COMMAND_REQUEST_HEADER Command;
114 - NWHANDLE FileHandle;
115 -} FLUSH_REQUEST, *PFLUSH_REQUEST;
117 -typedef struct _FLUSH_REPLY {
118 - COMMAND_REPLY_HEADER Reply;
119 -} FLUSH_REPLY, *PFLUSH_REPLY;
121 -typedef struct _GET_FILEINFO_REQUEST {
122 - COMMAND_REQUEST_HEADER Command;
123 - NWHANDLE FileHandle;
124 -} GET_FILEINFO_REQUEST, *PGET_FILEINFO_REQUEST;
126 -typedef struct _GET_FILEINFO_REPLY {
127 - COMMAND_REPLY_HEADER Reply;
128 -} GET_FILEINFO_REPLY, *PGET_FILEINFO_REPLY;
130 -typedef struct _GET_CONNECTED_SERVER_LIST_REQUEST {
131 - COMMAND_REQUEST_HEADER Command;
132 -} GET_CONNECTED_SERVER_LIST_REQUEST, *PGET_CONNECTED_SERVER_LIST_REQUEST;
133 +struct novfs_delete_file_reply {
134 + struct novfs_command_reply_header Reply;
137 +struct novfs_get_connected_server_list {
138 + struct novfs_command_request_header Command;
141 -typedef struct _GET_CONNECTED_SERVER_LIST_REPLY {
142 - COMMAND_REPLY_HEADER Reply;
143 +struct novfs_get_connected_server_list_reply {
144 + struct novfs_command_reply_header Reply;
145 unsigned char List[1];
146 -} GET_CONNECTED_SERVER_LIST_REPLY, *PGET_CONNECTED_SERVER_LIST_REPLY;
149 +struct novfs_get_connected_server_list_request_ex {
150 + struct novfs_command_request_header Command;
153 -typedef struct _GET_CONNECTED_SERVER_LIST_REQUEST_EX {
154 - COMMAND_REQUEST_HEADER Command;
155 -} GET_CONNECTED_SERVER_LIST_REQUEST_EX, *PGET_CONNECTED_SERVER_LIST_REQUEST_EX;
156 +struct novfs_get_connected_server_list_reply_ex {
158 -typedef struct _GET_CONNECTED_SERVER_LIST_REPLY_EX {
159 - COMMAND_REPLY_HEADER Reply;
160 + struct novfs_command_reply_header Reply;
161 unsigned int bufferLen;
162 unsigned char List[1];
164 -} GET_CONNECTED_SERVER_LIST_REPLY_EX, *PGET_CONNECTED_SERVER_LIST_REPLY_EX;
167 -typedef struct _GET_SERVER_VOLUME_LIST_REQUEST {
168 - COMMAND_REQUEST_HEADER Command;
169 +struct novfs_get_server_volume_list {
170 + struct novfs_command_request_header Command;
172 unsigned char Name[1];
173 -} GET_SERVER_VOLUME_LIST_REQUEST, *PGET_SERVER_VOLUME_LIST_REQUEST;
176 -typedef struct _GET_SERVER_VOLUME_LIST_REPLY {
177 - COMMAND_REPLY_HEADER Reply;
178 +struct novfs_get_server_volume_list_reply {
179 + struct novfs_command_reply_header Reply;
180 unsigned char List[1];
181 -} GET_SERVER_VOLUME_LIST_REPLY, *PGET_SERVER_VOLUME_LIST_REPLY;
183 -typedef struct _OPEN_CONNECTION_BY_ADDR_REQUEST {
184 - COMMAND_REQUEST_HEADER Command;
185 - unsigned int address;
187 -} OPEN_CONNECTION_BY_ADDR_REQUEST, *POPEN_CONNECTION_BY_ADDR_REQUEST;
189 -typedef struct _OPEN_CONNECTION_BY_ADDR_REPLY {
190 - COMMAND_REPLY_HEADER Reply;
191 - unsigned char serverName[64];
192 - unsigned char treeName[64];
193 - NWHANDLE connHandle;
195 -} OPEN_CONNECTION_BY_ADDR_REPLY, *POPEN_CONNECTION_BY_ADDR_REPLY;
197 -typedef struct _OPEN_CONNECTION_BY_NAME_REQUEST {
198 - COMMAND_REQUEST_HEADER Command;
199 - unsigned int NameLen;
200 - unsigned char Name[1];
202 -} OPEN_CONNECTION_BY_NAME_REQUEST, *POPEN_CONNECTION_BY_NAME_REQUEST;
205 -typedef struct _OPEN_CONNECTION_BY_NAME_REPLY {
206 - COMMAND_REPLY_HEADER Reply;
207 - unsigned char treeName[64];
208 - NWHANDLE connHandle;
210 -} OPEN_CONNECTION_BY_NAME_REPLY, *POPEN_CONNECTION_BY_NAME_REPLY;
213 -typedef struct _LOGIN_IDENTITY_REQUEST
215 - COMMAND_REQUEST_HEADER Command;
216 - unsigned int treeFlags;
217 - unsigned char treeName[64];
218 - unsigned int serverFlags;
219 - unsigned char serverName[64];
220 - unsigned int userFlags;
221 - unsigned char userName[512];
222 - unsigned int passwordFlags;
223 - unsigned char password[128];
225 -} LOGIN_IDENTITY_REQUEST, *PLOGIN_IDENTITY_REQUEST;
227 -typedef struct _LOGIN_IDENTITY_REPLY
229 - COMMAND_REPLY_HEADER Reply;
230 - unsigned char serverName[64];
231 - unsigned char treeName[64];
232 - NWHANDLE connHandle;
234 -} LOGIN_IDENTITY_REPLY, *PLOGIN_IDENTITY_REPLY;
237 -typedef struct _VERIFY_FILE_REQUEST {
238 - COMMAND_REQUEST_HEADER Command;
239 +struct novfs_verify_file_request {
240 + struct novfs_command_request_header Command;
241 unsigned int pathLen;
242 unsigned char path[1];
244 -} VERIFY_FILE_REQUEST, *PVERIFY_FILE_REQUEST;
247 -typedef struct _VERIFY_FILE_REPLY {
248 - COMMAND_REPLY_HEADER Reply;
249 +struct novfs_verify_file_reply {
250 + struct novfs_command_reply_header Reply;
251 unsigned int lastAccessTime;
252 unsigned int modifyTime;
253 unsigned int createTime;
254 unsigned long long fileSize;
255 unsigned int fileMode;
257 -} VERIFY_FILE_REPLY, *PVERIFY_FILE_REPLY;
260 -typedef struct _BEGIN_ENUMERATE_DIRECTORY_REQUEST {
261 - COMMAND_REQUEST_HEADER Command;
262 +struct novfs_begin_enumerate_directory_request {
263 + struct novfs_command_request_header Command;
264 unsigned int pathLen;
265 unsigned char path[1];
267 -} BEGIN_ENUMERATE_DIRECTORY_REQUEST, *PBEGIN_ENUMERATE_DIRECTORY_REQUEST;
270 -typedef struct _BEGIN_ENUMERATE_DIRECTORY_REPLY {
271 - COMMAND_REPLY_HEADER Reply;
272 - HANDLE enumerateHandle;
273 +struct novfs_begin_enumerate_directory_reply {
274 + struct novfs_command_reply_header Reply;
275 + void *enumerateHandle;
277 -} BEGIN_ENUMERATE_DIRECTORY_REPLY, *PBEGIN_ENUMERATE_DIRECTORY_REPLY;
280 -typedef struct _END_ENUMERATE_DIRECTORY_REQUEST {
281 - COMMAND_REQUEST_HEADER Command;
282 - HANDLE enumerateHandle;
283 +struct novfs_end_enumerate_directory_request {
284 + struct novfs_command_request_header Command;
285 + void *enumerateHandle;
287 -} END_ENUMERATE_DIRECTORY_REQUEST, *PEND_ENUMERATE_DIRECTORY_REQUEST;
290 -typedef struct _END_ENUMERATE_DIRECTORY_REPLY {
291 - COMMAND_REPLY_HEADER Reply;
292 +struct novfs_end_enumerate_directory_reply {
293 + struct novfs_command_reply_header Reply;
295 -} END_ENUMERATE_DIRECTORY_REPLY, *PEND_ENUMERATE_DIRECTORY_REPLY;
298 -typedef struct _ENUMERATE_DIRECTORY_REQUEST {
299 - COMMAND_REQUEST_HEADER Command;
300 - HANDLE enumerateHandle;
301 +struct novfs_enumerate_directory_request {
302 + struct novfs_command_request_header Command;
303 + void *enumerateHandle;
304 unsigned int pathLen;
305 unsigned char path[1];
307 -} ENUMERATE_DIRECTORY_REQUEST, *PENUMERATE_DIRECTORY_REQUEST;
310 -typedef struct _ENUMERATE_DIRECTORY_REPLY {
311 - COMMAND_REPLY_HEADER Reply;
312 - HANDLE enumerateHandle;
313 +struct novfs_enumerate_directory_reply {
314 + struct novfs_command_reply_header Reply;
315 + void *enumerateHandle;
316 unsigned int lastAccessTime;
317 unsigned int modifyTime;
318 unsigned int createTime;
319 @@ -346,17 +263,17 @@ typedef struct _ENUMERATE_DIRECTORY_REPL
320 unsigned int nameLen;
321 unsigned char name[1];
323 -} ENUMERATE_DIRECTORY_REPLY, *PENUMERATE_DIRECTORY_REPLY;
326 -typedef struct _ENUMERATE_DIRECTORY_EX_REQUEST {
327 - COMMAND_REQUEST_HEADER Command;
328 - HANDLE enumerateHandle;
329 +struct novfs_enumerate_directory_ex_request {
330 + struct novfs_command_request_header Command;
331 + void *enumerateHandle;
332 unsigned int pathLen;
333 unsigned char path[1];
335 -} ENUMERATE_DIRECTORY_EX_REQUEST, *PENUMERATE_DIRECTORY_EX_REQUEST;
338 -typedef struct _ENUMERATE_DIRECTORY_EX_DATA {
339 +struct novfs_enumerate_directory_ex_data {
341 unsigned int lastAccessTime;
342 unsigned int modifyTime;
343 @@ -366,143 +283,130 @@ typedef struct _ENUMERATE_DIRECTORY_EX_D
344 unsigned int nameLen;
345 unsigned char name[1];
347 -} ENUMERATE_DIRECTORY_EX_DATA, *PENUMERATE_DIRECTORY_EX_DATA;
350 -typedef struct _ENUMERATE_DIRECTORY_EX_REPLY {
351 - COMMAND_REPLY_HEADER Reply;
352 - HANDLE enumerateHandle;
353 +struct novfs_enumerate_directory_ex_reply {
354 + struct novfs_command_reply_header Reply;
355 + void *enumerateHandle;
356 unsigned int enumCount;
358 -} ENUMERATE_DIRECTORY_EX_REPLY, *PENUMERATE_DIRECTORY_EX_REPLY;
361 -typedef struct _OPEN_FILE_REQUEST {
362 - COMMAND_REQUEST_HEADER Command;
363 +struct novfs_open_file_request {
364 + struct novfs_command_request_header Command;
365 unsigned int access; /* File Access */
366 unsigned int mode; /* Sharing Mode */
367 unsigned int disp; /* Create Disposition */
368 unsigned int pathLen;
369 unsigned char path[1];
371 -} OPEN_FILE_REQUEST, *POPEN_FILE_REQUEST;
374 -typedef struct _OPEN_FILE_REPLY {
375 - COMMAND_REPLY_HEADER Reply;
377 +struct novfs_open_file_reply {
378 + struct novfs_command_reply_header Reply;
380 unsigned int lastAccessTime;
381 unsigned int modifyTime;
382 unsigned int createTime;
383 unsigned int attributes;
386 -} OPEN_FILE_REPLY, *POPEN_FILE_REPLY;
389 -typedef struct _CREATE_FILE_REQUEST {
390 +struct novfs_create_file_request {
392 - COMMAND_REQUEST_HEADER Command;
393 + struct novfs_command_request_header Command;
394 unsigned int pathlength;
395 unsigned char path[1];
397 -} CREATE_FILE_REQUEST, *PCREATE_FILE_REQUEST;
400 -typedef struct _CREATE_FILE_REPLY {
401 - COMMAND_REPLY_HEADER Reply;
402 +struct novfs_create_file_reply {
403 + struct novfs_command_reply_header Reply;
405 -} CREATE_FILE_REPLY, *PCREATE_FILE_REPLY;
408 -typedef struct _CLOSE_FILE_REQUEST {
409 - COMMAND_REQUEST_HEADER Command;
411 +struct novfs_close_file_request {
412 + struct novfs_command_request_header Command;
415 -} CLOSE_FILE_REQUEST, *PCLOSE_FILE_REQUEST;
418 -typedef struct _CLOSE_FILE_REPLY {
419 - COMMAND_REPLY_HEADER Reply;
420 +struct novfs_close_file_reply {
421 + struct novfs_command_reply_header Reply;
423 -} CLOSE_FILE_REPLY, *PCLOSE_FILE_REPLY;
426 -typedef struct _READ_FILE_REQUEST {
427 - COMMAND_REQUEST_HEADER Command;
429 +struct novfs_read_file_request {
430 + struct novfs_command_request_header Command;
435 -} READ_FILE_REQUEST, *PREAD_FILE_REQUEST;
438 -typedef struct _READ_FILE_REPLY {
439 - COMMAND_REPLY_HEADER Reply;
440 +struct novfs_read_file_reply {
441 + struct novfs_command_reply_header Reply;
442 unsigned long long bytesRead;
443 unsigned char data[1];
445 -} READ_FILE_REPLY, *PREAD_FILE_REPLY;
448 -typedef struct _WRITE_FILE_REQUEST {
449 - COMMAND_REQUEST_HEADER Command;
451 +struct novfs_write_file_request {
452 + struct novfs_command_request_header Command;
456 unsigned char data[1];
458 -} WRITE_FILE_REQUEST, *PWRITE_FILE_REQUEST;
461 -typedef struct _WRITE_FILE_REPLY {
462 - COMMAND_REPLY_HEADER Reply;
463 +struct novfs_write_file_reply {
464 + struct novfs_command_reply_header Reply;
465 unsigned long long bytesWritten;
466 -} WRITE_FILE_REPLY, *PWRITE_FILE_REPLY;
469 -typedef struct _READ_STREAM_REQUEST {
470 - COMMAND_REQUEST_HEADER Command;
472 +struct novfs_read_stream_request {
473 + struct novfs_command_request_header Command;
475 unsigned char handle[6];
478 -} READ_STREAM_REQUEST, *PREAD_STREAM_REQUEST;
481 -typedef struct _READ_STREAM_REPLY {
482 - COMMAND_REPLY_HEADER Reply;
483 +struct novfs_read_stream_reply {
484 + struct novfs_command_reply_header Reply;
486 unsigned char data[1];
487 -} READ_STREAM_REPLY, *PREAD_STREAM_REPLY;
490 -typedef struct _WRITE_STREAM_REQUEST {
491 - COMMAND_REQUEST_HEADER Command;
493 +struct novfs_write_stream_request {
494 + struct novfs_command_request_header Command;
496 unsigned char handle[6];
499 unsigned char data[1];
500 -} WRITE_STREAM_REQUEST, *PWRITE_STREAM_REQUEST;
503 -typedef struct _WRITE_STREAM_REPLY {
504 - COMMAND_REPLY_HEADER Reply;
505 +struct novfs_write_stream_reply {
506 + struct novfs_command_reply_header Reply;
508 -} WRITE_STREAM_REPLY, *PWRITE_STREAM_REPLY;
511 -typedef struct _CLOSE_STREAM_REQUEST {
512 - COMMAND_REQUEST_HEADER Command;
514 +struct novfs_close_stream_request {
515 + struct novfs_command_request_header Command;
517 unsigned char handle[6];
518 -} CLOSE_STREAM_REQUEST, *PCLOSE_STREAM_REQUEST;
521 -typedef struct _CLOSE_STREAM_REPLY {
522 - COMMAND_REPLY_HEADER Reply;
523 +struct novfs_close_stream_reply {
524 + struct novfs_command_reply_header Reply;
526 -} CLOSE_STREAM_REPLY, *PCLOSE_STREAM_REPLY;
529 -typedef struct _CREATE_DIRECTORY_REQUEST {
531 - COMMAND_REQUEST_HEADER Command;
532 - unsigned int pathlength;
533 - unsigned char path[1];
535 -} CREATE_DIRECTORY_REQUEST, *PCREATE_DIRECTORY_REQUEST;
537 -typedef struct _CREATE_DIRECTORY_REPLY {
538 - COMMAND_REPLY_HEADER Reply;
540 -} CREATE_DIRECTORY_REPLY, *PCREATE_DIRECTORY_REPLY;
542 -typedef struct _LOGIN_USER_REQUEST {
543 - COMMAND_REQUEST_HEADER Command;
544 +struct novfs_login_user_request {
545 + struct novfs_command_request_header Command;
546 unsigned int srvNameType;
547 unsigned int serverLength;
548 unsigned int serverOffset;
549 @@ -513,46 +417,47 @@ typedef struct _LOGIN_USER_REQUEST {
550 unsigned int passwordLength;
551 unsigned int passwordOffset;
553 -} LOGIN_USER_REQUEST, *PLOGIN_USER_REQUEST;
556 -typedef struct _LOGIN_USER_REPLY {
557 - COMMAND_REPLY_HEADER Reply;
558 +struct novfs_login_user_reply {
559 + struct novfs_command_reply_header Reply;
560 unsigned int connectionHandle;
561 - HANDLE loginIdentity;
562 + void *loginIdentity;
564 -} LOGIN_USER_REPLY, *PLOGIN_USER_REPLY;
567 -typedef struct _LOGOUT_REQUEST {
568 - COMMAND_REQUEST_HEADER Command;
569 +struct novfs_logout_request {
570 + struct novfs_command_request_header Command;
572 unsigned char Name[1];
574 -} LOGOUT_REQUEST, *PLOGOUT_REQUEST;
577 -typedef struct _LOGOUT_REPLY {
578 - COMMAND_REPLY_HEADER Reply;
579 +struct novfs_logout_reply {
580 + struct novfs_command_reply_header Reply;
582 -} LOGOUT_REPLY, *PLOGOUT_REPLY;
585 -typedef struct _CREATE_CONTEXT_REQUEST {
586 - COMMAND_REQUEST_HEADER Command;
587 +struct novfs_create_context_request {
588 + struct novfs_command_request_header Command;
590 -} CREATE_CONTEXT_REQUEST, *PCREATE_CONTEXT_REQUEST;
593 -typedef struct _CREATE_CONTEXT_REPLY {
594 - COMMAND_REPLY_HEADER Reply;
595 - struct schandle SessionId;
596 -} CREATE_CONTEXT_REPLY, *PCREATE_CONTEXT_REPLY;
597 +struct novfs_create_context_reply {
598 + struct novfs_command_reply_header Reply;
599 + struct novfs_schandle SessionId;
601 -typedef struct _DESTROY_CONTEXT_REQUEST {
602 - COMMAND_REQUEST_HEADER Command;
605 -} DESTROY_CONTEXT_REQUEST, *PDESTROY_CONTEXT_REQUEST;
606 +struct novfs_destroy_context_request {
607 + struct novfs_command_request_header Command;
609 -typedef struct _DESTROY_CONTEXT_REPLY {
610 - COMMAND_REPLY_HEADER Reply;
613 -} DESTROY_CONTEXT_REPLY, *PDESTROY_CONTEXT_REPLY;
614 +struct novfs_destroy_context_reply {
615 + struct novfs_command_reply_header Reply;
620 * Attribute flags. These should be or-ed together to figure out what
621 @@ -572,7 +477,7 @@ typedef struct _DESTROY_CONTEXT_REPLY {
622 #define ATTR_ATTR_FLAG 1024
625 -typedef struct _LNX_FILE_INFO {
626 +struct novfs_lnx_file_info {
627 unsigned int ia_valid;
628 unsigned int ia_mode;
630 @@ -582,126 +487,124 @@ typedef struct _LNX_FILE_INFO {
633 unsigned int ia_attr_flags;
636 -} LX_FILE_INFO, *PLX_FILE_INFO;
638 -typedef struct _SET_FILE_INFO_REQUEST {
639 - COMMAND_REQUEST_HEADER Command;
640 - LX_FILE_INFO fileInfo;
641 +struct novfs_set_file_info_request {
642 + struct novfs_command_request_header Command;
643 + struct novfs_lnx_file_info fileInfo;
644 unsigned int pathlength;
648 -} SET_FILE_INFO_REQUEST, *PSET_FILE_INFO_REQUEST;
650 -typedef struct _SET_FILE_INFO_REPLY {
651 - COMMAND_REPLY_HEADER Reply;
652 +struct novfs_set_file_info_reply {
653 + struct novfs_command_reply_header Reply;
655 -} SET_FILE_INFO_REPLY, *PSET_FILE_INFO_REPLY;
658 -typedef struct _TRUNCATE_FILE_REQUEST {
659 - COMMAND_REQUEST_HEADER Command;
660 +struct novfs_truncate_file_request {
661 + struct novfs_command_request_header Command;
662 unsigned int pathLen;
665 -} TRUNCATE_FILE_REQUEST, *PTRUNCATE_FILE_REQUEST;
668 -typedef struct _TRUNCATE_FILE_REPLY {
669 - COMMAND_REPLY_HEADER Reply;
670 +struct novfs_truncate_file_reply {
671 + struct novfs_command_reply_header Reply;
673 -} TRUNCATE_FILE_REPLY, *PTRUNCATE_FILE_REPLY;
676 -typedef struct _GETPWUID_REQUEST {
677 - COMMAND_REQUEST_HEADER Command;
678 +struct novfs_getpwuid_request {
679 + struct novfs_command_request_header Command;
681 -} GETPWUID_REQUEST, *PGETPWUID_REQUEST;
684 -typedef struct _GETPWUID_REPLY {
685 - COMMAND_REPLY_HEADER Reply;
686 +struct novfs_getpwuid_reply {
687 + struct novfs_command_reply_header Reply;
688 unsigned char UserName[1];
689 -} GETPWUID_REPLY, *PGETPWUID_REPLY;
692 -typedef struct _GET_VERSION_REQUEST {
693 - COMMAND_REQUEST_HEADER Command;
694 -} GET_VERSION_REQUEST, *PGET_VERSION_REQUEST;
695 +struct novfs_get_version_request {
696 + struct novfs_command_request_header Command;
699 -typedef struct _GET_VERSION_REPLY {
700 - COMMAND_REPLY_HEADER Reply;
701 +struct novfs_get_version_reply {
702 + struct novfs_command_reply_header Reply;
703 unsigned char Version[1];
704 -} GET_VERSION_REPLY, *PGET_VERSION_REPLY;
707 -typedef struct _SET_MOUNT_PATH {
708 - COMMAND_REQUEST_HEADER Command;
709 +struct novfs_set_mount_path {
710 + struct novfs_command_request_header Command;
711 unsigned int PathLength;
712 unsigned char Path[1];
713 -} SET_MOUNT_PATH_REQUEST, *PSET_MOUNT_PATH_REQUEST;
716 -typedef struct _SET_MOUNT_PATH_REPLY {
717 - COMMAND_REPLY_HEADER Reply;
718 -} SET_MOUNT_PATH, *PSET_MOUNT_PATH_REPLY;
720 -typedef struct _GET_USER_SPACE {
721 - COMMAND_REQUEST_HEADER Command;
722 -} GET_USER_SPACE_REQUEST, *PGET_USER_SPACE_REQUEST;
723 +struct novfs_set_mount_path_reply {
724 + struct novfs_command_reply_header Reply;
727 +struct novfs_get_user_space {
728 + struct novfs_command_request_header Command;
731 -typedef struct _GET_USER_SPACE_REPLY {
732 - COMMAND_REPLY_HEADER Reply;
733 +struct novfs_get_user_space_reply {
734 + struct novfs_command_reply_header Reply;
737 uint64_t TotalEnties;
739 -} GET_USER_SPACE_REPLY, *PGET_USER_SPACE_REPLY;
742 -typedef struct _XPLAT_CALL_REQUEST {
743 - COMMAND_REQUEST_HEADER Command;
744 +struct novfs_xplat_call_request {
745 + struct novfs_command_request_header Command;
746 unsigned int NwcCommand;
747 unsigned long dataLen;
748 unsigned char data[1];
750 -} XPLAT_CALL_REQUEST, *PXPLAT_CALL_REQUEST;
753 -typedef struct _XPLAT_CALL_REPLY {
754 - COMMAND_REPLY_HEADER Reply;
755 +struct novfs_xplat_call_reply {
756 + struct novfs_command_reply_header Reply;
757 unsigned long dataLen;
758 unsigned char data[1];
760 -} XPLAT_CALL_REPLY, *PXPLAT_CALL_REPLY;
763 /* XPlat NWC structures used by the daemon */
765 -typedef struct _NWD_OPEN_CONN_BY_NAME {
767 +struct nwd_open_conn_by_name {
769 unsigned int nameLen;
770 unsigned int oName; /* Ofset to the Name */
771 unsigned int serviceLen;
772 unsigned int oServiceType; /* Offset to service Type; */
773 unsigned int uConnFlags;
774 unsigned int uTranType;
775 - HANDLE newConnHandle;
776 + void *newConnHandle;
778 -} NwdCOpenConnByName, *PNwdCOpenConnByName;
781 -typedef struct _NWD_TRAN_ADDR {
782 +struct nwd_tran_addr {
783 unsigned int uTransportType;
784 unsigned int uAddressLength;
785 unsigned int oAddress;
787 -} NwdCTranAddr, *PNwdCTranAddr;
790 -typedef struct _NWD_OPEN_CONN_BY_ADDR {
792 +struct nwd_open_conn_by_addr {
794 unsigned int oServiceType;
795 unsigned int uConnFlags;
796 - NwdCTranAddr TranAddr;
797 + struct nwd_tran_addr TranAddr;
799 -} NwdCOpenConnByAddr, *PNwdCOpenConnByAddr;
802 -typedef struct _NWD_CLOSE_CONN {
804 +struct nwd_close_conn {
807 -} NwdCCloseConn, *PNwdCCloseConn;
810 -typedef struct _NWD_NCP_REQ {
812 +struct nwd_ncp_req {
814 unsigned int replyLen;
815 unsigned int requestLen;
816 unsigned int function;
817 @@ -710,48 +613,37 @@ typedef struct _NWD_NCP_REQ {
819 unsigned char data[1];
821 -} NwdCNCPReq, *PNwdCNCPReq;
824 -typedef struct _NWD_NCP_REP {
825 +struct nwd_ncp_rep {
826 unsigned int replyLen;
827 unsigned char data[1];
829 -} NwdCNCPRep, *PNwdCNCPRep;
832 -typedef struct _NWC_AUTH_WID {
834 +struct nwc_auth_wid {
836 u32 AuthenticationId;
838 -} NwdCAuthenticateWithId, *PNwdCAuthenticateWithId;
841 -typedef struct _NWC_AUTHENTICATE {
843 - unsigned int uAuthenticationType;
844 - unsigned int userNameOffset;
845 - unsigned int passwordOffset;
846 - unsigned int MaxInfoLength;
847 - unsigned int InfoLength;
848 - unsigned int authenInfoOffset;
850 -} NwdCAuthenticate, *PNwdCAuthenticate;
852 -typedef struct _NWC_UNAUTHENTICATE {
854 +struct nwc_unauthenticate {
856 unsigned int AuthenticationId;
858 -} NwdCUnauthenticate, *PNwdCUnauthenticate;
861 -typedef struct _NWC_LISC_ID {
863 +struct nwc_lisc_id {
866 -} NwdCLicenseConn, *PNwdCLicenseConn;
869 -typedef struct _NWC_UNLIC_CONN {
871 +struct nwc_unlic_conn {
874 -} NwdCUnlicenseConn, *PNwdCUnlicenseConn;
877 -typedef struct _NWC_GET_IDENT_INFO {
878 +struct nwd_get_id_info {
879 u32 AuthenticationId;
880 unsigned int AuthType;
881 unsigned int NameType;
882 @@ -762,44 +654,44 @@ typedef struct _NWC_GET_IDENT_INFO {
883 unsigned int objectLen;
884 unsigned int pObjectNameOffset;
886 -} NwdCGetIdentityInfo, *PNwdCGetIdentityInfo;
889 -typedef struct _NWC_LO_ID {
891 u32 AuthenticationId;
893 -} NwdCLogoutIdentity, *PNwdCLogoutIdentity;
896 -typedef struct _RENAME_FILE_REQUEST {
897 - COMMAND_REQUEST_HEADER Command;
898 +struct novfs_rename_file_request {
899 + struct novfs_command_request_header Command;
901 unsigned int newnameLen;
902 unsigned char newname[256];
903 unsigned int oldnameLen;
904 unsigned char oldname[256];
905 -} RENAME_FILE_REQUEST, *PRENAME_FILE_REQUEST;
908 -typedef struct _RENAME_FILE_REPLY {
909 - COMMAND_REPLY_HEADER Reply;
910 +struct novfs_rename_file_reply {
911 + struct novfs_command_reply_header Reply;
913 -} RENAME_FILE_REPLY, *PRENAME_FILE_REPLY;
916 -typedef struct __NwdServerVersion {
917 +struct nwd_server_version {
918 unsigned int uMajorVersion;
919 unsigned short int uMinorVersion;
920 unsigned short int uRevision;
923 -} NwdServerVersion, *PNwdServerVersion;
925 #define MAX_ADDRESS_LENGTH 32
927 -typedef struct tagNwdTranAddrEx {
928 +struct tagNwdTranAddrEx {
929 unsigned int uTransportType;
930 unsigned int uAddressLength;
931 unsigned char Buffer[MAX_ADDRESS_LENGTH];
933 -} NwdTranAddr, *PNwdTranAddr;
936 -typedef struct __NWD_CONN_INFO {
937 +struct __NWD_CONN_INFO {
938 unsigned int uInfoVersion;
939 unsigned int uAuthenticationState;
940 unsigned int uBroadcastState;
941 @@ -819,33 +711,31 @@ typedef struct __NWD_CONN_INFO {
942 unsigned int uDistance;
944 unsigned int uDisconnected;
945 - NwdServerVersion ServerVersion;
946 - NwdTranAddr TranAddress;
948 -} NwdConnInfo, *PNwdConnInfo;
949 + struct nwd_server_version ServerVersion;
950 + struct nwd_tran_addr TranAddress;
953 -typedef struct _nwd_conn_info {
955 +struct nwd_conn_info {
957 unsigned int uInfoLevel;
958 unsigned int uInfoLength;
961 -} NwdCGetConnInfo, *PNwdCGetConnInfo;
963 -typedef struct nwd_open_conn_by_Ref {
964 - HANDLE uConnReference;
965 +struct nwd_open_conn_by_ref {
966 + void *uConnReference;
967 unsigned int uConnFlags;
971 -} NwdCOpenConnByRef, *PNwdCOpenConnByRef;
974 -typedef struct nwd_get_reqversion {
975 +struct nwd_get_reqversion {
976 unsigned int uMajorVersion;
977 unsigned int uMinorVersion;
978 unsigned int uRevision;
980 -} NwdCGetRequesterVersion, *PNwdCGetRequesterVersion;
983 -typedef struct _nwc_scan_conn_info {
984 +struct nwd_scan_conn_info {
985 unsigned int uScanIndex;
986 unsigned int uScanInfoLevel;
987 unsigned int uScanInfoLen;
988 @@ -856,43 +746,43 @@ typedef struct _nwc_scan_conn_info {
989 unsigned int uConnectionReference;
990 unsigned int uReturnConnInfoOffset;
992 -} NwdCScanConnInfo, *PNwdCScanConnInfo;
995 -typedef struct nwc_get_pref_ds_tree {
996 +struct nwd_get_pref_ds_tree {
997 unsigned int uTreeLength;
998 unsigned int DsTreeNameOffset;
1000 -} NwdCGetPreferredDsTree, *PNwdCGetPreferredDsTree;
1003 -typedef struct nwc_set_pref_ds_tree {
1004 +struct nwd_set_pref_ds_tree {
1005 unsigned int uTreeLength;
1006 unsigned int DsTreeNameOffset;
1008 -} NwdCSetPreferredDsTree, *PNwdCSetPreferredDsTree;
1011 -typedef struct nwc_set_def_name_ctx {
1012 +struct nwd_set_def_name_ctx {
1013 unsigned int uTreeLength;
1014 unsigned int TreeOffset;
1015 unsigned int uNameLength;
1016 unsigned int NameContextOffset;
1018 -} NwdCSetDefaultNameContext, *PNwdCSetDefaultNameContext;
1021 -typedef struct nwc_get_def_name_ctx {
1022 +struct nwd_get_def_name_ctx {
1023 unsigned int uTreeLength;
1024 unsigned int TreeOffset;
1025 unsigned int uNameLength;
1026 unsigned int NameContextOffset;
1028 -} NwdCGetDefaultNameContext, *PNwdCGetDefaultNameContext;
1031 -typedef struct _nwc_get_treemonitored_connref {
1032 - NwdString TreeName;
1033 - HANDLE uConnReference;
1034 +struct nwd_get_tree_monitored_conn_ref {
1035 + struct nwd_string TreeName;
1036 + void *uConnReference;
1038 -} NwdCGetTreeMonitoredConnRef, *PNwdCGetTreeMonitoredConnRef;
1041 -typedef struct _nwc_enumerate_identities {
1042 +struct nwd_enum_ids {
1043 unsigned int Iterator;
1044 unsigned int domainNameLen;
1045 unsigned int domainNameOffset;
1046 @@ -904,9 +794,9 @@ typedef struct _nwc_enumerate_identities
1047 unsigned int IdentityFlags;
1048 u32 AuthenticationId;
1050 -} NwdCDEnumerateIdentities, *PNwdCEnumerateIdentities;
1053 -typedef struct nwd_change_key {
1054 +struct nwd_change_key {
1055 unsigned int domainNameOffset;
1056 unsigned int domainNameLen;
1057 unsigned int AuthType;
1058 @@ -919,82 +809,43 @@ typedef struct nwd_change_key {
1059 unsigned int newPasswordOffset;
1060 unsigned int newPasswordLen;
1062 -} NwdCChangeKey, *PNwdCChangeKey;
1065 -typedef struct _nwd_get_primary_conn {
1066 - HANDLE uConnReference;
1067 +struct nwd_set_primary_conn {
1070 -} NwdCGetPrimaryConnection, *PNwdCGetPrimaryConnection;
1073 -typedef struct _nwd_set_primary_conn {
1074 - HANDLE ConnHandle;
1076 -} NwdCSetPrimaryConnection, *PNwdCSetPrimaryConnection;
1078 -typedef struct _nwd_map_drive_ex {
1081 - u32 linkOffsetLength;
1083 - u32 dirPathOffsetLength;
1084 - u32 dirPathOffset;
1086 -} NwdCMapDriveEx, *PNwdCMapDriveEx;
1088 -typedef struct _nwd_unmap_drive_ex {
1089 - unsigned int linkLen;
1092 -} NwdCUnmapDriveEx, *PNwdCUnmapDriveEx;
1094 -typedef struct _nwd_enum_links {
1095 - unsigned int totalLen;
1096 - unsigned int linkCount;
1098 -} NwdCEnumLinks, *PNwdCEnumLinks;
1100 -typedef struct nwd_getbroadcastnotification {
1101 +struct nwd_get_bcast_notification {
1102 unsigned int uMessageFlags;
1103 - HANDLE uConnReference;
1104 + void *uConnReference;
1105 unsigned int messageLen;
1108 -} NwdCGetBroadcastNotification, *PNwdCGetBroadcastNotification;
1110 -typedef struct _enum_entry {
1111 - unsigned int entryLen;
1114 -} NwdCEnumEntry, *PNwdCEnumEntry;
1117 -typedef struct _nwd_set_conn_info {
1118 - HANDLE ConnHandle;
1119 +struct nwd_set_conn_info {
1121 unsigned int uInfoLevel;
1122 unsigned int uInfoLength;
1123 unsigned int offsetConnInfo;
1125 -} NwdCSetConnInfo, *PNwdCSetConnInfo;
1127 -typedef struct _len_string {
1132 -} LString, *PLString;
1134 -typedef struct _DEBUG_REQUEST {
1135 - COMMAND_REQUEST_HEADER Command;
1136 +struct novfs_debug_request {
1137 + struct novfs_command_request_header Command;
1141 -} DEBUG_REQUEST, *PDEBUG_REQUEST;
1144 -typedef struct _DEBUG_REPLY {
1145 - COMMAND_REPLY_HEADER Reply;
1146 +struct novfs_debug_reply {
1147 + struct novfs_command_reply_header Reply;
1149 -} DEBUG_REPLY, *PDEBUG_REPLY;
1152 -typedef struct _Nwd_Set_Key {
1153 - HANDLE ConnHandle;
1154 +struct nwd_set_key {
1156 unsigned int AuthenticationId;
1157 unsigned int objectNameLen;
1158 unsigned int objectNameOffset;
1159 @@ -1002,9 +853,9 @@ typedef struct _Nwd_Set_Key {
1160 unsigned int newPasswordLen;
1161 unsigned int newPasswordOffset;
1163 -} NwdCSetKey, *PNwdCSetKey;
1166 -typedef struct _Nwd_Verify_Key {
1167 +struct nwd_verify_key {
1168 unsigned int AuthType;
1169 unsigned int NameType;
1170 unsigned short int ObjectType;
1171 @@ -1015,43 +866,43 @@ typedef struct _Nwd_Verify_Key {
1172 unsigned int verifyPasswordLen;
1173 unsigned int verifyPasswordOffset;
1175 -} NwdCVerifyKey, *PNwdCVerifyKey;
1178 -typedef struct _GET_CACHE_FLAG {
1179 - COMMAND_REQUEST_HEADER Command;
1180 +struct novfs_get_cache_flag {
1181 + struct novfs_command_request_header Command;
1183 unsigned char path[0];
1185 -} GET_CACHE_FLAG_REQUEST, *PGET_CACHE_FLAG_REQUEST;
1188 -typedef struct _GET_CACHE_FLAG_REPLY {
1189 - COMMAND_REPLY_HEADER Reply;
1190 +struct novfs_get_cache_flag_reply {
1191 + struct novfs_command_reply_header Reply;
1194 -} GET_CACHE_FLAG_REPLY, *PGET_CACHE_FLAG_REPLY;
1197 -typedef struct _XA_LIST_REPLY {
1198 - COMMAND_REPLY_HEADER Reply;
1199 +struct novfs_xa_list_reply {
1200 + struct novfs_command_reply_header Reply;
1201 unsigned char *pData;
1203 -} XA_LIST_REPLY, *PXA_LIST_REPLY;
1206 -typedef struct _XA_GET_REQUEST {
1207 - COMMAND_REQUEST_HEADER Command;
1208 +struct novfs_xa_get_request {
1209 + struct novfs_command_request_header Command;
1210 unsigned int pathLen;
1211 unsigned int nameLen;
1212 unsigned char data[1]; //hold path, attribute name
1214 -} XA_GET_REQUEST, *PXA_GET_REQUEST;
1217 -typedef struct _XA_GET_REPLY {
1218 - COMMAND_REPLY_HEADER Reply;
1219 +struct novfs_xa_get_reply {
1220 + struct novfs_command_reply_header Reply;
1221 unsigned char *pData;
1223 -} XA_GET_REPLY, *PXA_GET_REPLY;
1226 -typedef struct _XA_SET_REQUEST {
1227 - COMMAND_REQUEST_HEADER Command;
1228 +struct novfs_xa_set_request {
1229 + struct novfs_command_request_header Command;
1230 unsigned int TtlWriteDataSize;
1231 unsigned int WritePosition;
1233 @@ -1060,27 +911,44 @@ typedef struct _XA_SET_REQUEST {
1234 unsigned int valueLen;
1235 unsigned char data[1]; //hold path, attribute name, value data
1237 -} XA_SET_REQUEST, *PXA_SET_REQUEST;
1240 -typedef struct _XA_SET_REPLY {
1241 - COMMAND_REPLY_HEADER Reply;
1242 +struct novfs_xa_set_reply {
1243 + struct novfs_command_reply_header Reply;
1244 unsigned char *pData;
1246 -} XA_SET_REPLY, *PXA_SET_REPLY;
1249 -typedef struct _SET_FILE_LOCK_REQUEST {
1250 - COMMAND_REQUEST_HEADER Command;
1252 +struct novfs_set_file_lock_request {
1253 + struct novfs_command_request_header Command;
1255 unsigned char fl_type;
1259 -} SET_FILE_LOCK_REQUEST, *PSET_FILE_LOCK_REQUEST;
1262 +struct novfs_set_file_lock_reply {
1263 + struct novfs_command_reply_header Reply;
1267 -typedef struct _SET_FILE_LOCK_REPLY {
1268 - COMMAND_REPLY_HEADER Reply;
1270 -} SET_FILE_LOCK_REPLY, *PSET_FILE_LOCK_REPLY;
1271 +struct novfs_scope_list{
1272 + struct list_head ScopeList;
1273 + struct novfs_schandle ScopeId;
1274 + struct novfs_schandle SessionId;
1276 + struct task_struct *ScopeTask;
1277 + unsigned int ScopeHash;
1279 + uint64_t ScopeUSize;
1280 + uint64_t ScopeUFree;
1281 + uint64_t ScopeUTEnties;
1282 + uint64_t ScopeUAEnties;
1283 + int ScopeUserNameLength;
1284 + unsigned char ScopeUserName[32];
1289 --- a/fs/novfs/daemon.c
1290 +++ b/fs/novfs/daemon.c
1292 #include <linux/module.h>
1293 #include <linux/fs.h>
1294 #include <linux/slab.h>
1295 -#include <linux/string.h>
1296 #include <linux/list.h>
1297 #include <linux/timer.h>
1298 #include <linux/poll.h>
1300 #define DH_TYPE_STREAM 1
1301 #define DH_TYPE_CONNECTION 2
1303 -/*===[ Type definitions ]=================================================*/
1304 -typedef struct _DAEMON_QUEUE {
1305 +struct daemon_queue {
1306 struct list_head list; /* Must be first entry */
1307 spinlock_t lock; /* Used to control access to list */
1308 struct semaphore semaphore; /* Used to signal when data is available */
1312 -typedef struct _DAEMON_COMMAND {
1313 +struct daemon_cmd {
1314 struct list_head list; /* Must be first entry */
1316 unsigned int status;
1317 @@ -65,61 +63,44 @@ typedef struct _DAEMON_COMMAND {
1320 unsigned long replen;
1321 -} daemon_command_t;
1324 -typedef struct _DAEMON_HANDLE_ {
1325 +struct daemon_handle {
1326 struct list_head list;
1328 - session_t session;
1330 + struct novfs_schandle session;
1333 -typedef struct _DAEMON_RESOURCE_ {
1334 +struct daemon_resource {
1335 struct list_head list;
1337 - HANDLE connection;
1339 unsigned char handle[6];
1342 -} daemon_resource_t;
1345 -typedef struct _DRIVE_MAP_ {
1347 struct list_head list; /* Must be first item */
1348 - session_t session;
1349 + struct novfs_schandle session;
1356 +static void Queue_get(struct daemon_cmd * Que);
1357 +static void Queue_put(struct daemon_cmd * Que);
1358 +static void RemoveDriveMaps(void);
1359 +static int NwdConvertLocalHandle(struct novfs_xplat *pdata, struct daemon_handle * DHandle);
1360 +static int NwdConvertNetwareHandle(struct novfs_xplat *pdata, struct daemon_handle * DHandle);
1361 +static int set_map_drive(struct novfs_xplat *pdata, struct novfs_schandle Session);
1362 +static int unmap_drive(struct novfs_xplat *pdata, struct novfs_schandle Session);
1363 +static int NwdGetMountPath(struct novfs_xplat *pdata);
1364 +static int local_unlink(const char *pathname);
1366 -/*===[ Function prototypes ]==============================================*/
1367 -int Daemon_Close_Control(struct inode *Inode, struct file *File);
1368 -int Daemon_Library_close(struct inode *inode, struct file *file);
1369 -int Daemon_Library_open(struct inode *inode, struct file *file);
1370 -loff_t Daemon_Library_llseek(struct file *file, loff_t offset, int origin);
1371 -int Daemon_Open_Control(struct inode *Inode, struct file *File);
1372 -uint Daemon_Poll(struct file *file, struct poll_table_struct *poll_table);
1373 -int Daemon_Remove_Resource(daemon_handle_t * DHandle, int Type, HANDLE CHandle,
1374 - unsigned long FHandle);
1376 -int Daemon_SetMountPoint(char *Path);
1377 -void Daemon_Timer(unsigned long data);
1378 -int Daemon_getpwuid(uid_t uid, int unamelen, char *uname);
1379 -int Queue_Daemon_Command(void *request, unsigned long reqlen, void *data, int dlen,
1380 - void **reply, unsigned long * replen, int interruptible);
1381 -void Queue_get(daemon_command_t * que);
1382 -void Queue_put(daemon_command_t * que);
1383 -void Uninit_Daemon_Queue(void);
1384 -daemon_command_t *find_queue(unsigned long sequence);
1385 -daemon_command_t *get_next_queue(int Set_Queue_Waiting);
1386 -int NwdConvertNetwareHandle(PXPLAT pdata, daemon_handle_t * DHandle);
1387 -int NwdConvertLocalHandle(PXPLAT pdata, daemon_handle_t * DHandle);
1388 -int NwdGetMountPath(PXPLAT pdata);
1389 -static int NwdSetMapDrive(PXPLAT pdata, session_t Session);
1390 -static int NwdUnMapDrive(PXPLAT pdata, session_t Session);
1391 -void RemoveDriveMaps(void);
1392 -int local_unlink(const char *pathname);
1394 /*===[ Global variables ]=================================================*/
1395 -static daemon_queue_t Daemon_Queue;
1396 +static struct daemon_queue Daemon_Queue;
1398 static DECLARE_WAIT_QUEUE_HEAD(Read_waitqueue);
1400 @@ -131,51 +112,24 @@ static unsigned long Daemon_Command_Time
1401 static DECLARE_MUTEX(DriveMapLock);
1402 static LIST_HEAD(DriveMapList);
1404 -int MaxIoSize = PAGE_SIZE;
1405 +int novfs_max_iosize = PAGE_SIZE;
1407 -void Init_Daemon_Queue(void)
1408 +void novfs_daemon_queue_init()
1410 INIT_LIST_HEAD(&Daemon_Queue.list);
1411 spin_lock_init(&Daemon_Queue.lock);
1412 init_MUTEX_LOCKED(&Daemon_Queue.semaphore);
1415 -/*++======================================================================*/
1416 -void Uninit_Daemon_Queue(void)
1429 - *========================================================================*/
1430 +void novfs_daemon_queue_exit(void)
1432 /* Does nothing for now but we maybe should clear the queue. */
1435 /*++======================================================================*/
1436 -void Daemon_Timer(unsigned long data)
1449 - *========================================================================*/
1450 +static void novfs_daemon_timer(unsigned long data)
1452 - daemon_command_t *que = (daemon_command_t *) data;
1453 + struct daemon_cmd *que = (struct daemon_cmd *) data;
1455 if (QUEUE_ACKED != que->status) {
1456 que->status = QUEUE_TIMEOUT;
1457 @@ -183,14 +137,14 @@ void Daemon_Timer(unsigned long data)
1458 up(&que->semaphore);
1461 -int Queue_Daemon_Command(void *request, unsigned long reqlen, void *data, int dlen,
1462 +/*++======================================================================*/
1463 +int Queue_Daemon_Command(void *request,
1464 + unsigned long reqlen,
1467 void **reply, unsigned long * replen, int interruptible)
1469 - * Arguments: void *request - pointer to the request that is to be sent. Needs to be kernel memory.
1470 - * int reqlen - length of the request.
1471 - *========================================================================*/
1473 - daemon_command_t *que;
1474 + struct daemon_cmd *que;
1478 @@ -201,6 +155,7 @@ int Queue_Daemon_Command(void *request,
1479 if (atomic_read(&Daemon_Open_Count)) {
1481 que = kmalloc(sizeof(*que), GFP_KERNEL);
1483 DbgPrint("Queue_Daemon_Command: que=0x%p\n", que);
1485 atomic_set(&que->reference, 0);
1486 @@ -211,7 +166,7 @@ int Queue_Daemon_Command(void *request,
1488 que->sequence = atomic_inc_return(&Sequence);
1490 - ((PCOMMAND_REQUEST_HEADER) request)->SequenceNumber =
1491 + ((struct novfs_command_request_header *) request)->SequenceNumber =
1495 @@ -220,7 +175,7 @@ int Queue_Daemon_Command(void *request,
1496 init_timer(&que->timer);
1497 que->timer.expires = jiffies + (HZ * Daemon_Command_Timeout);
1498 que->timer.data = (unsigned long) que;
1499 - que->timer.function = Daemon_Timer;
1500 + que->timer.function = novfs_daemon_timer;
1501 add_timer(&que->timer);
1504 @@ -317,41 +272,13 @@ int Queue_Daemon_Command(void *request,
1508 -/*++======================================================================*/
1509 -void Queue_get(daemon_command_t * Que)
1522 - *========================================================================*/
1523 +static void Queue_get(struct daemon_cmd * Que)
1525 DbgPrint("Queue_get: que=0x%p %d\n", Que, atomic_read(&Que->reference));
1526 atomic_inc(&Que->reference);
1529 -/*++======================================================================*/
1530 -void Queue_put(daemon_command_t * Que)
1543 - *========================================================================*/
1544 +static void Queue_put(struct daemon_cmd * Que)
1547 DbgPrint("Queue_put: que=0x%p %d\n", Que, atomic_read(&Que->reference));
1548 @@ -373,35 +300,21 @@ void Queue_put(daemon_command_t * Que)
1552 -/*++======================================================================*/
1553 -daemon_command_t *get_next_queue(int Set_Queue_Waiting)
1566 - *========================================================================*/
1567 +struct daemon_cmd *get_next_queue(int Set_Queue_Waiting)
1569 - daemon_command_t *que;
1570 + struct daemon_cmd *que;
1572 DbgPrint("get_next_queue: que=0x%p\n", Daemon_Queue.list.next);
1574 spin_lock(&Daemon_Queue.lock);
1575 - que = (daemon_command_t *) Daemon_Queue.list.next;
1576 + que = (struct daemon_cmd *) Daemon_Queue.list.next;
1578 - while (que && (que != (daemon_command_t *) & Daemon_Queue.list.next)
1579 + while (que && (que != (struct daemon_cmd *) & Daemon_Queue.list.next)
1580 && (que->status != QUEUE_SENDING)) {
1581 - que = (daemon_command_t *) que->list.next;
1582 + que = (struct daemon_cmd *) que->list.next;
1585 - if ((NULL == que) || (que == (daemon_command_t *) & Daemon_Queue.list)
1586 + if ((NULL == que) || (que == (struct daemon_cmd *) & Daemon_Queue.list)
1587 || (que->status != QUEUE_SENDING)) {
1589 } else if (Set_Queue_Waiting) {
1590 @@ -418,36 +331,22 @@ daemon_command_t *get_next_queue(int Set
1594 -/*++======================================================================*/
1595 -daemon_command_t *find_queue(unsigned long sequence)
1608 - *========================================================================*/
1609 +static struct daemon_cmd *find_queue(unsigned long sequence)
1611 - daemon_command_t *que;
1612 + struct daemon_cmd *que;
1614 DbgPrint("find_queue: 0x%x\n", sequence);
1616 spin_lock(&Daemon_Queue.lock);
1617 - que = (daemon_command_t *) Daemon_Queue.list.next;
1618 + que = (struct daemon_cmd *) Daemon_Queue.list.next;
1620 - while (que && (que != (daemon_command_t *) & Daemon_Queue.list.next)
1621 + while (que && (que != (struct daemon_cmd *) & Daemon_Queue.list.next)
1622 && (que->sequence != sequence)) {
1623 - que = (daemon_command_t *) que->list.next;
1624 + que = (struct daemon_cmd *) que->list.next;
1628 - || (que == (daemon_command_t *) & Daemon_Queue.list.next)
1629 + || (que == (struct daemon_cmd *) & Daemon_Queue.list.next)
1630 || (que->sequence != sequence)) {
1633 @@ -462,21 +361,7 @@ daemon_command_t *find_queue(unsigned lo
1637 -/*++======================================================================*/
1638 -int Daemon_Open_Control(struct inode *Inode, struct file *File)
1651 - *========================================================================*/
1652 +int novfs_daemon_open_control(struct inode *Inode, struct file *File)
1654 DbgPrint("Daemon_Open_Control: pid=%d Count=%d\n", current->pid,
1655 atomic_read(&Daemon_Open_Count));
1656 @@ -485,23 +370,9 @@ int Daemon_Open_Control(struct inode *In
1660 -/*++======================================================================*/
1661 -int Daemon_Close_Control(struct inode *Inode, struct file *File)
1674 - *========================================================================*/
1675 +int novfs_daemon_close_control(struct inode *Inode, struct file *File)
1677 - daemon_command_t *que;
1678 + struct daemon_cmd *que;
1680 DbgPrint("Daemon_Close_Control: pid=%d Count=%d\n", current->pid,
1681 atomic_read(&Daemon_Open_Count));
1682 @@ -512,39 +383,39 @@ int Daemon_Close_Control(struct inode *I
1685 spin_lock(&Daemon_Queue.lock);
1686 - que = (daemon_command_t *) Daemon_Queue.list.next;
1687 + que = (struct daemon_cmd *) Daemon_Queue.list.next;
1690 - && (que != (daemon_command_t *) & Daemon_Queue.list.next)
1691 + && (que != (struct daemon_cmd *) & Daemon_Queue.list.next)
1692 && (que->status != QUEUE_DONE)) {
1693 que->status = QUEUE_TIMEOUT;
1694 up(&que->semaphore);
1696 - que = (daemon_command_t *) que->list.next;
1697 + que = (struct daemon_cmd *) que->list.next;
1699 spin_unlock(&Daemon_Queue.lock);
1704 + novfs_scope_cleanup();
1710 -ssize_t Daemon_Send_Command(struct file *file, char __user *buf, size_t len, loff_t * off)
1711 +ssize_t novfs_daemon_cmd_send(struct file * file, char *buf, size_t len, loff_t * off)
1713 - daemon_command_t *que;
1714 + struct daemon_cmd *que;
1715 size_t retValue = 0;
1717 - struct data_list *dlist;
1718 + struct novfs_data_list *dlist;
1719 int i, dcnt, bcnt, ccnt, error;
1721 unsigned long cpylen;
1723 DbgPrint("Daemon_Send_Command: %u %lld\n", len, *off);
1724 - if (len > MaxIoSize) {
1726 + if (len > novfs_max_iosize) {
1727 + novfs_max_iosize = len;
1731 @@ -556,9 +427,9 @@ ssize_t Daemon_Send_Command(struct file
1734 if (retValue > 0x80)
1735 - mydump(0x80, que->request);
1736 + novfs_dump(0x80, que->request);
1738 - mydump(retValue, que->request);
1739 + novfs_dump(retValue, que->request);
1741 cpylen = copy_to_user(buf, que->request, retValue);
1742 if (que->datalen && (retValue < len)) {
1743 @@ -599,10 +470,10 @@ ssize_t Daemon_Send_Command(struct file
1744 ("Daemon_Send_Command: Copy %d from 0x%p to 0x%p.\n",
1756 @@ -646,14 +517,14 @@ ssize_t Daemon_Send_Command(struct file
1760 -ssize_t Daemon_Receive_Reply(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos)
1761 +ssize_t novfs_daemon_recv_reply(struct file *file, const char *buf, size_t nbytes, loff_t * ppos)
1763 - daemon_command_t *que;
1764 + struct daemon_cmd *que;
1765 size_t retValue = 0;
1767 unsigned long sequence, cpylen;
1769 - struct data_list *dlist;
1770 + struct novfs_data_list *dlist;
1774 @@ -727,9 +598,9 @@ ssize_t Daemon_Receive_Reply(struct file
1777 if (thiscopy > 0x80)
1778 - mydump(0x80, vadr);
1779 + novfs_dump(0x80, vadr);
1781 - mydump(thiscopy, vadr);
1782 + novfs_dump(thiscopy, vadr);
1785 kunmap(dlist->page);
1786 @@ -743,17 +614,20 @@ ssize_t Daemon_Receive_Reply(struct file
1787 que->replen = retValue;
1789 reply = kmalloc(nbytes, GFP_KERNEL);
1790 - DbgPrint("Daemon_Receive_Reply: reply=0x%p\n", reply);
1791 + DbgPrint("Daemon_Receive_Reply: reply=0x%p\n",
1796 que->replen = nbytes;
1798 - retValue -= copy_from_user(reply, buf, retValue);
1800 + copy_from_user(reply, buf,
1802 if (retValue > 0x80)
1803 - mydump(0x80, reply);
1804 + novfs_dump(0x80, reply);
1806 - mydump(retValue, reply);
1807 + novfs_dump(retValue, reply);
1811 @@ -775,10 +649,11 @@ ssize_t Daemon_Receive_Reply(struct file
1815 -int do_login(NclString *Server, NclString *Username, NclString *Password, HANDLE *lgnId, struct schandle *Session)
1816 +int novfs_do_login(struct ncl_string *Server, struct ncl_string *Username,
1817 +struct ncl_string *Password, void **lgnId, struct novfs_schandle *Session)
1819 - PLOGIN_USER_REQUEST cmd;
1820 - PLOGIN_USER_REPLY reply;
1821 + struct novfs_login_user_request *cmd;
1822 + struct novfs_login_user_reply *reply;
1823 unsigned long replylen = 0;
1824 int retCode, cmdlen, datalen;
1825 unsigned char *data;
1826 @@ -812,8 +687,8 @@ int do_login(NclString *Server, NclStrin
1827 memcpy(data, Password->buffer, Password->len);
1828 data += Password->len;
1830 - retCode = Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
1831 - &replylen, INTERRUPTIBLE);
1832 + retCode = Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
1833 + &replylen, INTERRUPTIBLE);
1835 if (reply->Reply.ErrorCode) {
1836 retCode = reply->Reply.ErrorCode;
1837 @@ -827,18 +702,18 @@ int do_login(NclString *Server, NclStrin
1839 memset(cmd, 0, cmdlen);
1846 -int do_logout(struct qstr *Server, struct schandle *Session)
1847 +int novfs_daemon_logout(struct qstr *Server, struct novfs_schandle *Session)
1849 - PLOGOUT_REQUEST cmd;
1850 - PLOGOUT_REPLY reply;
1851 + struct novfs_logout_request *cmd;
1852 + struct novfs_logout_reply *reply;
1853 unsigned long replylen = 0;
1854 int retCode, cmdlen;
1856 - cmdlen = offsetof(LOGOUT_REQUEST, Name) + Server->len;
1857 + cmdlen = offsetof(struct novfs_logout_request, Name) + Server->len;
1858 cmd = kmalloc(cmdlen, GFP_KERNEL);
1861 @@ -849,7 +724,8 @@ int do_logout(struct qstr *Server, struc
1862 cmd->length = Server->len;
1863 memcpy(cmd->Name, Server->name, Server->len);
1865 - retCode = Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
1867 + Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
1869 if (reply->Reply.ErrorCode) {
1871 @@ -861,24 +737,10 @@ int do_logout(struct qstr *Server, struc
1875 -/*++======================================================================*/
1876 -int Daemon_getpwuid(uid_t uid, int unamelen, char *uname)
1889 - *========================================================================*/
1890 +int novfs_daemon_getpwuid(uid_t uid, int unamelen, char *uname)
1892 - GETPWUID_REQUEST cmd;
1893 - PGETPWUID_REPLY reply;
1894 + struct novfs_getpwuid_request cmd;
1895 + struct novfs_getpwuid_reply *reply;
1896 unsigned long replylen = 0;
1899 @@ -896,7 +758,9 @@ int Daemon_getpwuid(uid_t uid, int uname
1902 memset(uname, 0, unamelen);
1903 - replylen = replylen - offsetof(GETPWUID_REPLY, UserName);
1905 + replylen - offsetof(struct
1906 + novfs_getpwuid_reply, UserName);
1908 if (replylen > unamelen) {
1910 @@ -911,24 +775,10 @@ int Daemon_getpwuid(uid_t uid, int uname
1914 -/*++======================================================================*/
1915 -int Daemon_getversion(char *Buf, int length)
1928 - *========================================================================*/
1929 +int novfs_daemon_getversion(char *Buf, int length)
1931 - GET_VERSION_REQUEST cmd;
1932 - PGET_VERSION_REPLY reply;
1933 + struct novfs_get_version_request cmd;
1934 + struct novfs_get_version_reply *reply;
1935 unsigned long replylen = 0;
1938 @@ -942,7 +792,9 @@ int Daemon_getversion(char *Buf, int len
1939 if (reply->Reply.ErrorCode) {
1942 - retVal = replylen - offsetof(GET_VERSION_REPLY, Version);
1944 + replylen - offsetof(struct
1945 + novfs_get_version_reply, Version);
1946 if (retVal < length) {
1947 memcpy(Buf, reply->Version, retVal);
1949 @@ -954,13 +806,13 @@ int Daemon_getversion(char *Buf, int len
1953 -static int daemon_login(struct login *Login, struct schandle *Session)
1954 +static int daemon_login(struct novfs_login *Login, struct novfs_schandle *Session)
1956 int retCode = -ENOMEM;
1957 - struct login lLogin;
1959 - NclString username;
1960 - NclString password;
1961 + struct novfs_login lLogin;
1962 + struct ncl_string server;
1963 + struct ncl_string username;
1964 + struct ncl_string password;
1966 if (!copy_from_user(&lLogin, Login, sizeof(lLogin))) {
1967 server.buffer = kmalloc(lLogin.Server.length, GFP_KERNEL);
1968 @@ -968,29 +820,29 @@ static int daemon_login(struct login *Lo
1969 server.len = lLogin.Server.length;
1970 server.type = NWC_STRING_TYPE_ASCII;
1971 if (!copy_from_user((void *)server.buffer, lLogin.Server.data, server.len)) {
1972 - username.buffer = kmalloc(lLogin.UserName.length, GFP_KERNEL);
1973 + username.buffer = kmalloc(lLogin.UserName.length, GFP_KERNEL);
1974 if (username.buffer) {
1975 username.len = lLogin.UserName.length;
1976 username.type = NWC_STRING_TYPE_ASCII;
1977 if (!copy_from_user((void *)username.buffer, lLogin.UserName.data, username.len)) {
1978 - password.buffer = kmalloc(lLogin.Password.length, GFP_KERNEL);
1979 - if (password.buffer) {
1980 + password.buffer = kmalloc(lLogin.Password.length, GFP_KERNEL);
1981 + if (password.buffer)
1983 password.len = lLogin.Password.length;
1984 password.type = NWC_STRING_TYPE_ASCII;
1985 if (!copy_from_user((void *)password.buffer, lLogin.Password.data, password.len)) {
1986 - retCode = do_login (&server, &username, &password, NULL, Session);
1987 + retCode = novfs_do_login (&server, &username, &password, NULL, Session);
1990 - name = Scope_Get_UserName();
1992 - Novfs_Add_to_Root(name);
1994 + username = novfs_scope_get_username();
1996 + novfs_add_to_root(username);
2000 - memset(password.buffer, 0, password.len);
2001 kfree(password.buffer);
2004 - memset(username.buffer, 0, username.len);
2005 kfree(username.buffer);
2008 @@ -1001,32 +853,30 @@ static int daemon_login(struct login *Lo
2012 -static int daemon_logout(struct logout *Logout, struct schandle *Session)
2013 +static int daemon_logout(struct novfs_logout *Logout, struct novfs_schandle *Session)
2015 - struct logout lLogout;
2016 + struct novfs_logout lLogout;
2018 - int retCode = -ENOMEM;
2021 if (copy_from_user(&lLogout, Logout, sizeof(lLogout)))
2024 server.name = kmalloc(lLogout.Server.length, GFP_KERNEL);
2027 server.len = lLogout.Server.length;
2028 if (copy_from_user((void *)server.name, lLogout.Server.data, server.len))
2031 - retCode = do_logout(&server, Session);
2032 + retCode = novfs_daemon_logout(&server, Session);
2039 -int Daemon_CreateSessionId(struct schandle *SessionId)
2040 +int novfs_daemon_create_sessionId(struct novfs_schandle * SessionId)
2042 - CREATE_CONTEXT_REQUEST cmd;
2043 - PCREATE_CONTEXT_REPLY reply;
2044 + struct novfs_create_context_request cmd;
2045 + struct novfs_create_context_reply *reply;
2046 unsigned long replylen = 0;
2049 @@ -1041,7 +891,7 @@ int Daemon_CreateSessionId(struct schand
2050 &replylen, INTERRUPTIBLE);
2052 if (!reply->Reply.ErrorCode
2053 - && replylen > sizeof(COMMAND_REPLY_HEADER)) {
2054 + && replylen > sizeof(struct novfs_command_reply_header)) {
2055 *SessionId = reply->SessionId;
2058 @@ -1055,26 +905,26 @@ int Daemon_CreateSessionId(struct schand
2062 -int Daemon_DestroySessionId(struct schandle *SessionId)
2063 +int novfs_daemon_destroy_sessionId(struct novfs_schandle SessionId)
2065 - DESTROY_CONTEXT_REQUEST cmd;
2066 - PDESTROY_CONTEXT_REPLY reply;
2067 + struct novfs_destroy_context_request cmd;
2068 + struct novfs_destroy_context_reply *reply;
2069 unsigned long replylen = 0;
2072 - DbgPrint("Daemon_DestroySessionId: 0x%p:%p\n",
2073 - SessionId->hTypeId, SessionId->hId);
2074 + DbgPrint("Daemon_DestroySessionId: 0x%p:%p\n", SessionId.hTypeId,
2077 cmd.Command.CommandType = VFS_COMMAND_DESTROY_CONTEXT;
2078 cmd.Command.SequenceNumber = 0;
2079 - memcpy(&cmd.Command.SessionId, SessionId, sizeof (*SessionId));
2080 + cmd.Command.SessionId = SessionId;
2083 Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
2084 &replylen, INTERRUPTIBLE);
2086 if (!reply->Reply.ErrorCode) {
2088 + struct drive_map *dm;
2089 struct list_head *list;
2092 @@ -1085,11 +935,8 @@ int Daemon_DestroySessionId(struct schan
2094 down(&DriveMapLock);
2095 list_for_each(list, &DriveMapList) {
2096 - struct schandle *temp;
2098 - dm = list_entry(list, drive_map_t, list);
2099 - temp = &dm->session;
2100 - if (SC_EQUAL(SessionId, temp)) {
2101 + dm = list_entry(list, struct drive_map, list);
2102 + if (SC_EQUAL(SessionId, dm->session)) {
2103 local_unlink(dm->name);
2105 list_del(&dm->list);
2106 @@ -1107,21 +954,21 @@ int Daemon_DestroySessionId(struct schan
2110 -int Daemon_Get_UserSpace(struct schandle *SessionId, uint64_t * TotalSize,
2111 +int novfs_daemon_get_userspace(struct novfs_schandle SessionId, uint64_t * TotalSize,
2112 uint64_t * Free, uint64_t * TotalEnties,
2113 uint64_t * FreeEnties)
2115 - GET_USER_SPACE_REQUEST cmd;
2116 - PGET_USER_SPACE_REPLY reply;
2117 + struct novfs_get_user_space cmd;
2118 + struct novfs_get_user_space_reply *reply;
2119 unsigned long replylen = 0;
2122 - DbgPrint("Daemon_Get_UserSpace: 0x%p:%p\n",
2123 - SessionId->hTypeId, SessionId->hId);
2124 + DbgPrint("Daemon_Get_UserSpace: 0x%p:%p\n", SessionId.hTypeId,
2127 cmd.Command.CommandType = VFS_COMMAND_GET_USER_SPACE;
2128 cmd.Command.SequenceNumber = 0;
2129 - memcpy(&cmd.Command.SessionId, SessionId, sizeof (*SessionId));
2130 + cmd.Command.SessionId = SessionId;
2133 Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
2134 @@ -1151,36 +998,22 @@ int Daemon_Get_UserSpace(struct schandle
2138 -/*++======================================================================*/
2139 -int Daemon_SetMountPoint(char *Path)
2152 - *========================================================================*/
2153 +int novfs_daemon_set_mnt_point(char *Path)
2155 - PSET_MOUNT_PATH_REQUEST cmd;
2156 - PSET_MOUNT_PATH_REPLY reply;
2157 + struct novfs_set_mount_path *cmd;
2158 + struct novfs_set_mount_path_reply *reply;
2159 unsigned long replylen, cmdlen;
2160 int retCode = -ENOMEM;
2162 DbgPrint("Daemon_SetMountPoint: %s\n", Path);
2164 replylen = strlen(Path);
2165 - cmdlen = sizeof(SET_MOUNT_PATH_REQUEST) + replylen;
2167 + cmdlen = sizeof(struct novfs_set_mount_path) + replylen;
2169 cmd = kmalloc(cmdlen, GFP_KERNEL);
2173 cmd->Command.CommandType = VFS_COMMAND_SET_MOUNT_PATH;
2174 cmd->Command.SequenceNumber = 0;
2175 SC_INITIALIZE(cmd->Command.SessionId);
2176 @@ -1190,7 +1023,9 @@ int Daemon_SetMountPoint(char *Path)
2180 - retCode = Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
2182 + Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
2183 + &replylen, INTERRUPTIBLE);
2185 if (!reply->Reply.ErrorCode) {
2187 @@ -1203,27 +1038,13 @@ int Daemon_SetMountPoint(char *Path)
2191 -/*++======================================================================*/
2192 -int Daemon_SendDebugCmd(char *Command)
2205 - *========================================================================*/
2207 - DEBUG_REQUEST cmd;
2208 - PDEBUG_REPLY reply;
2209 - DEBUG_REPLY lreply;
2210 +int novfs_daemon_debug_cmd_send(char *Command)
2212 + struct novfs_debug_request cmd;
2213 + struct novfs_debug_reply *reply;
2214 + struct novfs_debug_reply lreply;
2215 unsigned long replylen, cmdlen;
2216 - struct data_list dlist[2];
2217 + struct novfs_data_list dlist[2];
2219 int retCode = -ENOMEM;
2221 @@ -1239,7 +1060,7 @@ int Daemon_SendDebugCmd(char *Command)
2222 dlist[1].len = sizeof(lreply);
2223 dlist[1].rwflag = DLWRITE;
2225 - cmdlen = offsetof(DEBUG_REQUEST, dbgcmd);
2226 + cmdlen = offsetof(struct novfs_debug_request, dbgcmd);
2228 cmd.Command.CommandType = VFS_COMMAND_DBG;
2229 cmd.Command.SequenceNumber = 0;
2230 @@ -1248,7 +1069,9 @@ int Daemon_SendDebugCmd(char *Command)
2234 - retCode = Queue_Daemon_Command(&cmd, cmdlen, dlist, 2, (void *)&reply, &replylen, INTERRUPTIBLE);
2236 + Queue_Daemon_Command(&cmd, cmdlen, dlist, 2, (void *)&reply,
2237 + &replylen, INTERRUPTIBLE);
2241 @@ -1259,21 +1082,20 @@ int Daemon_SendDebugCmd(char *Command)
2245 -int Daemon_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
2246 +int novfs_daemon_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
2248 int retCode = -ENOSYS;
2249 unsigned long cpylen;
2250 - struct schandle session_id;
2252 - session_id = Scope_Get_SessionId(NULL);
2253 + struct novfs_schandle session_id;
2254 + session_id = novfs_scope_get_sessionId(NULL);
2258 - retCode = daemon_login((struct login *)arg, &session_id);
2259 + retCode = daemon_login((struct novfs_login *) arg, &session_id);
2263 - retCode = daemon_logout((struct logout *) arg, &session_id);
2264 + retCode = daemon_logout((struct novfs_logout *)arg, &session_id);
2266 case IOC_DEBUGPRINT:
2268 @@ -1302,7 +1124,7 @@ int Daemon_ioctl(struct inode *inode, st
2273 + struct novfs_xplat data;
2276 copy_from_user(&data, (void *)arg, sizeof(data));
2277 @@ -1324,23 +1146,29 @@ int Daemon_ioctl(struct inode *inode, st
2281 -int Daemon_Added_Resource(daemon_handle_t *DHandle, int Type, HANDLE CHandle, unsigned char *FHandle, unsigned long Mode, unsigned long Size)
2282 +static int daemon_added_resource(struct daemon_handle * DHandle, int Type, void *CHandle,
2283 + unsigned char * FHandle, unsigned long Mode, u_long Size)
2285 - daemon_resource_t *resource;
2286 + struct daemon_resource *resource;
2289 - DbgPrint("Daemon_Added_Resource: DHandle=0x%p Type=%d CHandle=0x%p FHandle=0x%x Mode=0x%x Size=%d\n", DHandle, Type, CHandle, *(u32 *) & FHandle[2], Mode, Size);
2291 + ("Daemon_Added_Resource: DHandle=0x%p Type=%d CHandle=0x%p FHandle=0x%x Mode=0x%x Size=%d\n",
2292 + DHandle, Type, CHandle, *(u32 *) & FHandle[2], Mode, Size);
2294 - DbgPrint("Daemon_Added_Resource: DHandle=0x%p Type=%d CHandle=0x%p\n", DHandle, Type, CHandle);
2296 + ("Daemon_Added_Resource: DHandle=0x%p Type=%d CHandle=0x%p\n",
2297 + DHandle, Type, CHandle);
2299 - resource = kmalloc(sizeof(daemon_resource_t), GFP_KERNEL);
2300 + resource = kmalloc(sizeof(struct daemon_resource), GFP_KERNEL);
2304 resource->type = Type;
2305 resource->connection = CHandle;
2307 - memcpy(resource->handle, FHandle, sizeof(resource->handle));
2308 + memcpy(resource->handle, FHandle,
2309 + sizeof(resource->handle));
2311 memset(resource->handle, 0, sizeof(resource->handle));
2312 resource->mode = Mode;
2313 @@ -1348,29 +1176,15 @@ int Daemon_Added_Resource(daemon_handle_
2314 write_lock(&DHandle->lock);
2315 list_add(&resource->list, &DHandle->list);
2316 write_unlock(&DHandle->lock);
2317 - DbgPrint("Daemon_Added_Resource: Adding resource=0x%p\n", resource);
2319 + DbgPrint("Daemon_Added_Resource: Adding resource=0x%p\n",
2324 -/*++======================================================================*/
2325 -int Daemon_Remove_Resource(daemon_handle_t * DHandle, int Type, HANDLE CHandle,
2326 +static int daemon_remove_resource(struct daemon_handle * DHandle, int Type, void *CHandle,
2327 unsigned long FHandle)
2340 - *========================================================================*/
2342 - daemon_resource_t *resource;
2343 + struct daemon_resource *resource;
2344 struct list_head *l;
2345 int retVal = -ENOMEM;
2347 @@ -1381,7 +1195,7 @@ int Daemon_Remove_Resource(daemon_handle
2348 write_lock(&DHandle->lock);
2350 list_for_each(l, &DHandle->list) {
2351 - resource = list_entry(l, daemon_resource_t, list);
2352 + resource = list_entry(l, struct daemon_resource, list);
2354 if ((Type == resource->type) &&
2355 (resource->connection == CHandle)) {
2356 @@ -1400,76 +1214,59 @@ int Daemon_Remove_Resource(daemon_handle
2360 -int Daemon_Library_open(struct inode *inode, struct file *file)
2361 +int novfs_daemon_lib_open(struct inode *inode, struct file *file)
2363 - daemon_handle_t *dh;
2364 + struct daemon_handle *dh;
2366 DbgPrint("Daemon_Library_open: inode=0x%p file=0x%p\n", inode, file);
2368 - dh = kmalloc(sizeof(daemon_handle_t), GFP_KERNEL);
2369 + dh = kmalloc(sizeof(struct daemon_handle), GFP_KERNEL);
2373 file->private_data = dh;
2374 INIT_LIST_HEAD(&dh->list);
2375 rwlock_init(&dh->lock);
2376 - dh->session = Scope_Get_SessionId(NULL);
2378 + dh->session = novfs_scope_get_sessionId(NULL);
2382 -/*++======================================================================*/
2383 -int Daemon_Library_close(struct inode *inode, struct file *file)
2396 - *========================================================================*/
2397 +int novfs_daemon_lib_close(struct inode *inode, struct file *file)
2399 - daemon_handle_t *dh;
2400 - daemon_resource_t *resource;
2401 + struct daemon_handle *dh;
2402 + struct daemon_resource *resource;
2403 struct list_head *l;
2405 - char commanddata[sizeof(XPLAT_CALL_REQUEST) + sizeof(NwdCCloseConn)];
2406 - PXPLAT_CALL_REQUEST cmd;
2407 - PXPLAT_CALL_REPLY reply;
2408 - PNwdCCloseConn nwdClose;
2409 + char commanddata[sizeof(struct novfs_xplat_call_request) + sizeof(struct nwd_close_conn)];
2410 + struct novfs_xplat_call_request *cmd;
2411 + struct xplat_call_reply *reply;
2412 + struct nwd_close_conn *nwdClose;
2413 unsigned long cmdlen, replylen;
2415 DbgPrint("Daemon_Library_close: inode=0x%p file=0x%p\n", inode, file);
2416 if (file->private_data) {
2417 - dh = (daemon_handle_t *) file->private_data;
2418 + dh = (struct daemon_handle *) file->private_data;
2420 list_for_each(l, &dh->list) {
2421 - resource = list_entry(l, daemon_resource_t, list);
2422 + resource = list_entry(l, struct daemon_resource, list);
2424 if (DH_TYPE_STREAM == resource->type) {
2425 - Novfs_Close_Stream(resource->connection,
2426 + novfs_close_stream(resource->connection,
2429 } else if (DH_TYPE_CONNECTION == resource->type) {
2430 - cmd = (PXPLAT_CALL_REQUEST) commanddata;
2431 + cmd = (struct novfs_xplat_call_request *) commanddata;
2433 - offsetof(XPLAT_CALL_REQUEST,
2434 - data) + sizeof(NwdCCloseConn);
2435 + offsetof(struct novfs_xplat_call_request,
2436 + data) + sizeof(struct nwd_close_conn);
2437 cmd->Command.CommandType =
2438 VFS_COMMAND_XPLAT_CALL;
2439 cmd->Command.SequenceNumber = 0;
2440 cmd->Command.SessionId = dh->session;
2441 cmd->NwcCommand = NWC_CLOSE_CONN;
2443 - cmd->dataLen = sizeof(NwdCCloseConn);
2444 - nwdClose = (PNwdCCloseConn) cmd->data;
2445 + cmd->dataLen = sizeof(struct nwd_close_conn);
2446 + nwdClose = (struct nwd_close_conn *) cmd->data;
2447 nwdClose->ConnHandle =
2448 - (HANDLE) resource->connection;
2449 + (void *) resource->connection;
2451 Queue_Daemon_Command((void *)cmd, cmdlen, NULL,
2453 @@ -1488,10 +1285,11 @@ int Daemon_Library_close(struct inode *i
2457 -ssize_t Daemon_Library_read(struct file *file, char __user *buf, size_t len, loff_t *off)
2458 +ssize_t novfs_daemon_lib_read(struct file * file, char *buf, size_t len,
2461 - daemon_handle_t *dh;
2462 - daemon_resource_t *resource;
2463 + struct daemon_handle *dh;
2464 + struct daemon_resource *resource;
2466 size_t thisread, totalread = 0;
2467 loff_t offset = *off;
2468 @@ -1504,12 +1302,12 @@ ssize_t Daemon_Library_read(struct file
2469 read_lock(&dh->lock);
2470 if (&dh->list != dh->list.next) {
2472 - list_entry(dh->list.next, daemon_resource_t, list);
2473 + list_entry(dh->list.next, struct daemon_resource, list);
2475 if (DH_TYPE_STREAM == resource->type) {
2476 while (len > 0 && (offset < resource->size)) {
2478 - if (Novfs_Read_Stream
2479 + if (novfs_read_stream
2480 (resource->connection,
2481 resource->handle, buf, &thisread,
2482 &offset, 1, dh->session)
2483 @@ -1530,10 +1328,11 @@ ssize_t Daemon_Library_read(struct file
2487 -ssize_t Daemon_Library_write(struct file *file, const char __user *buf, size_t len, loff_t *off)
2488 +ssize_t novfs_daemon_lib_write(struct file * file, const char *buf, size_t len,
2491 - daemon_handle_t *dh;
2492 - daemon_resource_t *resource;
2493 + struct daemon_handle *dh;
2494 + struct daemon_resource *resource;
2496 size_t thiswrite, totalwrite = -EINVAL;
2497 loff_t offset = *off;
2498 @@ -1547,14 +1346,14 @@ ssize_t Daemon_Library_write(struct file
2499 write_lock(&dh->lock);
2500 if (&dh->list != dh->list.next) {
2502 - list_entry(dh->list.next, daemon_resource_t, list);
2503 + list_entry(dh->list.next, struct daemon_resource, list);
2505 if ((DH_TYPE_STREAM == resource->type) && (len >= 0)) {
2510 - Novfs_Write_Stream(resource->
2511 + novfs_write_stream(resource->
2515 @@ -1590,24 +1389,10 @@ ssize_t Daemon_Library_write(struct file
2516 return (totalwrite);
2519 -/*++======================================================================*/
2520 -loff_t Daemon_Library_llseek(struct file * file, loff_t offset, int origin)
2533 - *========================================================================*/
2534 +loff_t novfs_daemon_lib_llseek(struct file * file, loff_t offset, int origin)
2536 - daemon_handle_t *dh;
2537 - daemon_resource_t *resource;
2538 + struct daemon_handle *dh;
2539 + struct daemon_resource *resource;
2541 loff_t retVal = -EINVAL;
2543 @@ -1619,7 +1404,7 @@ loff_t Daemon_Library_llseek(struct file
2544 read_lock(&dh->lock);
2545 if (&dh->list != dh->list.next) {
2547 - list_entry(dh->list.next, daemon_resource_t, list);
2548 + list_entry(dh->list.next, struct daemon_resource, list);
2550 if (DH_TYPE_STREAM == resource->type) {
2552 @@ -1646,11 +1431,11 @@ loff_t Daemon_Library_llseek(struct file
2556 -int Daemon_Library_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
2557 +int novfs_daemon_lib_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
2559 int retCode = -ENOSYS;
2560 - daemon_handle_t *dh;
2561 - HANDLE handle = NULL;
2562 + struct daemon_handle *dh;
2563 + void *handle = NULL;
2564 unsigned long cpylen;
2566 dh = file->private_data;
2567 @@ -1662,11 +1447,11 @@ int Daemon_Library_ioctl(struct inode *i
2571 - retCode = daemon_login((struct login *)arg, &dh->session);
2572 + retCode = daemon_login((struct novfs_login *)arg, &dh->session);
2576 - retCode = daemon_logout((struct logout *)arg, &dh->session);
2577 + retCode = daemon_logout((struct novfs_logout *)arg, &dh->session);
2580 case IOC_DEBUGPRINT:
2581 @@ -1681,10 +1466,14 @@ int Daemon_Library_ioctl(struct inode *i
2582 copy_from_user(&io, (void *)arg,
2585 - buf = kmalloc(io.length + 1, GFP_KERNEL);
2587 + kmalloc(io.length + 1,
2591 - cpylen = copy_from_user(buf, io.data, io.length);
2593 + copy_from_user(buf, io.data,
2595 buf[io.length] = '\0';
2596 DbgPrint("%s", buf);
2598 @@ -1696,7 +1485,7 @@ int Daemon_Library_ioctl(struct inode *i
2603 + struct novfs_xplat data;
2606 copy_from_user(&data, (void *)arg,
2607 @@ -1707,61 +1496,79 @@ int Daemon_Library_ioctl(struct inode *i
2609 switch (data.xfunction) {
2610 case NWC_OPEN_CONN_BY_NAME:
2611 - DbgPrint("[VFS XPLAT] Call NwOpenConnByName\n");
2612 - retCode = NwOpenConnByName(&data, &handle, dh->session);
2614 + ("[VFS XPLAT] Call NwOpenConnByName\n");
2616 + novfs_open_conn_by_name(&data,
2617 + &handle, dh->session);
2619 - Daemon_Added_Resource(dh, DH_TYPE_CONNECTION, handle, NULL, 0, 0);
2620 + daemon_added_resource(dh,
2621 + DH_TYPE_CONNECTION,handle, 0, 0, 0);
2624 case NWC_OPEN_CONN_BY_ADDRESS:
2625 - DbgPrint("[VFS XPLAT] Call NwOpenConnByAddress\n");
2626 - retCode = NwOpenConnByAddr(&data, &handle, dh->session);
2628 + ("[VFS XPLAT] Call NwOpenConnByAddress\n");
2630 + novfs_open_conn_by_addr(&data, &handle,
2633 - Daemon_Added_Resource(dh, DH_TYPE_CONNECTION, handle, NULL, 0, 0);
2634 + daemon_added_resource(dh,
2635 + DH_TYPE_CONNECTION,
2640 case NWC_OPEN_CONN_BY_REFERENCE:
2641 - DbgPrint("[VFS XPLAT] Call NwOpenConnByReference\n");
2642 - retCode = NwOpenConnByRef(&data, &handle, dh->session);
2645 + ("[VFS XPLAT] Call NwOpenConnByReference\n");
2647 + novfs_open_conn_by_ref(&data, &handle,
2650 - Daemon_Added_Resource(dh,
2651 + daemon_added_resource(dh,
2658 case NWC_SYS_CLOSE_CONN:
2659 DbgPrint("[VFS XPLAT] Call NwSysCloseConn\n");
2660 - retCode = NwSysConnClose(&data, (unsigned long *)&handle, dh->session);
2661 - Daemon_Remove_Resource(dh, DH_TYPE_CONNECTION, handle, 0);
2663 + novfs_sys_conn_close(&data, (unsigned long *)&handle, dh->session);
2664 + daemon_remove_resource(dh, DH_TYPE_CONNECTION, handle, 0);
2667 case NWC_CLOSE_CONN:
2669 ("[VFS XPLAT] Call NwCloseConn\n");
2671 - NwConnClose(&data, &handle,
2672 + novfs_conn_close(&data, &handle,
2674 - Daemon_Remove_Resource(dh,
2675 + daemon_remove_resource(dh,
2680 case NWC_LOGIN_IDENTITY:
2681 - DbgPrint("[VFS XPLAT] Call NwLoginIdentity\n");
2682 - retCode = NwLoginIdentity(&data, &dh->session);
2684 + ("[VFS XPLAT] Call NwLoginIdentity\n");
2686 + novfs_login_id(&data, dh->session);
2689 case NWC_RAW_NCP_REQUEST:
2690 - DbgPrint("[VFS XPLAT] Send Raw NCP Request\n");
2691 - retCode = NwRawSend(&data, dh->session);
2693 + ("[VFS XPLAT] Send Raw NCP Request\n");
2694 + retCode = novfs_raw_send(&data, dh->session);
2697 case NWC_AUTHENTICATE_CONN_WITH_ID:
2699 ("[VFS XPLAT] Authenticate Conn With ID\n");
2701 - NwAuthConnWithId(&data,
2702 + novfs_auth_conn(&data,
2706 @@ -1769,21 +1576,21 @@ int Daemon_Library_ioctl(struct inode *i
2708 ("[VFS XPLAT] UnAuthenticate Conn With ID\n");
2710 - NwUnAuthenticate(&data,
2711 + novfs_unauthenticate(&data,
2715 case NWC_LICENSE_CONN:
2716 DbgPrint("Call NwLicenseConn\n");
2718 - NwLicenseConn(&data, dh->session);
2719 + novfs_license_conn(&data, dh->session);
2722 case NWC_LOGOUT_IDENTITY:
2724 ("[VFS XPLAT] Call NwLogoutIdentity\n");
2726 - NwLogoutIdentity(&data,
2727 + novfs_logout_id(&data,
2731 @@ -1791,35 +1598,35 @@ int Daemon_Library_ioctl(struct inode *i
2733 ("[VFS XPLAT] Call NwUnlicense\n");
2735 - NwUnlicenseConn(&data, dh->session);
2736 + novfs_unlicense_conn(&data, dh->session);
2739 case NWC_GET_CONN_INFO:
2741 ("[VFS XPLAT] Call NwGetConnInfo\n");
2743 - NwGetConnInfo(&data, dh->session);
2744 + novfs_get_conn_info(&data, dh->session);
2747 case NWC_SET_CONN_INFO:
2749 ("[VFS XPLAT] Call NwGetConnInfo\n");
2751 - NwSetConnInfo(&data, dh->session);
2752 + novfs_set_conn_info(&data, dh->session);
2755 case NWC_SCAN_CONN_INFO:
2757 ("[VFS XPLAT] Call NwScanConnInfo\n");
2759 - NwScanConnInfo(&data, dh->session);
2760 + novfs_scan_conn_info(&data, dh->session);
2763 case NWC_GET_IDENTITY_INFO:
2765 ("[VFS XPLAT] Call NwGetIdentityInfo\n");
2767 - NwGetIdentityInfo(&data,
2768 + novfs_get_id_info(&data,
2772 @@ -1827,7 +1634,7 @@ int Daemon_Library_ioctl(struct inode *i
2774 ("[VFS XPLAT] Call NwGetDaemonVersion\n");
2776 - NwGetDaemonVersion(&data,
2777 + novfs_get_daemon_ver(&data,
2781 @@ -1835,7 +1642,7 @@ int Daemon_Library_ioctl(struct inode *i
2783 ("[VFS XPLAT] Call NwcGetPreferredDsTree\n");
2785 - NwcGetPreferredDSTree(&data,
2786 + novfs_get_preferred_DS_tree(&data,
2790 @@ -1843,7 +1650,7 @@ int Daemon_Library_ioctl(struct inode *i
2792 ("[VFS XPLAT] Call NwcSetPreferredDsTree\n");
2794 - NwcSetPreferredDSTree(&data,
2795 + novfs_set_preferred_DS_tree(&data,
2799 @@ -1851,7 +1658,7 @@ int Daemon_Library_ioctl(struct inode *i
2801 ("[VFS XPLAT] Call NwcGetDefaultNameContext\n");
2803 - NwcGetDefaultNameCtx(&data,
2804 + novfs_get_default_ctx(&data,
2808 @@ -1859,7 +1666,7 @@ int Daemon_Library_ioctl(struct inode *i
2810 ("[VFS XPLAT] Call NwcSetDefaultNameContext\n");
2812 - NwcSetDefaultNameCtx(&data,
2813 + novfs_set_default_ctx(&data,
2817 @@ -1867,14 +1674,14 @@ int Daemon_Library_ioctl(struct inode *i
2819 ("[VFS XPLAT] Call NwQueryFeature\n");
2821 - NwQueryFeature(&data, dh->session);
2822 + novfs_query_feature(&data, dh->session);
2825 case NWC_GET_TREE_MONITORED_CONN_REF:
2827 ("[VFS XPLAT] Call NwcGetTreeMonitoredConn\n");
2829 - NwcGetTreeMonitoredConn(&data,
2830 + novfs_get_tree_monitored_conn(&data,
2834 @@ -1883,7 +1690,7 @@ int Daemon_Library_ioctl(struct inode *i
2836 ("[VFS XPLAT] Call NwcEnumerateIdentities\n");
2838 - NwcEnumIdentities(&data,
2839 + novfs_enum_ids(&data,
2843 @@ -1891,7 +1698,7 @@ int Daemon_Library_ioctl(struct inode *i
2845 ("[VFS XPLAT] Call NwcChangeAuthKey\n");
2847 - NwcChangeAuthKey(&data,
2848 + novfs_change_auth_key(&data,
2852 @@ -1913,7 +1720,7 @@ int Daemon_Library_ioctl(struct inode *i
2854 ("[VFS XPLAT] Call NwcSetPrimaryConn\n");
2856 - NwcSetPrimaryConn(&data,
2857 + novfs_set_pri_conn(&data,
2861 @@ -1921,26 +1728,29 @@ int Daemon_Library_ioctl(struct inode *i
2863 ("[VFS XPLAT] Call NwcGetPrimaryConn\n");
2865 - NwcGetPrimaryConn(&data,
2866 + novfs_get_pri_conn(&data,
2871 - DbgPrint("[VFS XPLAT] Call NwcMapDrive\n");
2872 - retCode = NwdSetMapDrive(&data, dh->session);
2874 + ("[VFS XPLAT] Call NwcMapDrive\n");
2876 + set_map_drive(&data, dh->session);
2879 case NWC_UNMAP_DRIVE:
2881 ("[VFS XPLAT] Call NwcUnMapDrive\n");
2882 - retCode = NwdUnMapDrive(&data, dh->session);
2884 + unmap_drive(&data, dh->session);
2887 case NWC_ENUMERATE_DRIVES:
2889 ("[VFS XPLAT] Call NwcEnumerateDrives\n");
2891 - NwcEnumerateDrives(&data,
2892 + novfs_enum_drives(&data,
2896 @@ -1954,21 +1764,21 @@ int Daemon_Library_ioctl(struct inode *i
2898 ("[VSF XPLAT Call NwdGetBroadcastMessage\n");
2900 - NwcGetBroadcastMessage(&data,
2901 + novfs_get_bcast_msg(&data,
2906 DbgPrint("[VSF XPLAT Call NwdSetKey\n");
2908 - NwdSetKeyValue(&data, dh->session);
2909 + novfs_set_key_value(&data, dh->session);
2912 case NWC_VERIFY_KEY:
2914 ("[VSF XPLAT Call NwdVerifyKey\n");
2916 - NwdVerifyKeyValue(&data,
2917 + novfs_verify_key_value(&data,
2921 @@ -1991,9 +1801,10 @@ int Daemon_Library_ioctl(struct inode *i
2925 -unsigned int Daemon_Poll(struct file *file, struct poll_table_struct *poll_table)
2926 +unsigned int novfs_daemon_poll(struct file *file,
2927 + struct poll_table_struct *poll_table)
2929 - daemon_command_t *que;
2930 + struct daemon_cmd *que;
2931 unsigned int mask = POLLOUT | POLLWRNORM;
2933 que = get_next_queue(0);
2934 @@ -2002,43 +1813,32 @@ unsigned int Daemon_Poll(struct file *fi
2938 -int NwdConvertNetwareHandle(PXPLAT pdata, daemon_handle_t *DHandle)
2939 +static int NwdConvertNetwareHandle(struct novfs_xplat *pdata, struct daemon_handle * DHandle)
2942 - NwcConvertNetWareHandle nh;
2943 + struct nwc_convert_netware_handle nh;
2944 unsigned long cpylen;
2946 DbgPrint("NwdConvertNetwareHandle: DHandle=0x%p\n", DHandle);
2948 - cpylen = copy_from_user(&nh, pdata->reqData, sizeof(NwcConvertNetWareHandle));
2950 + copy_from_user(&nh, pdata->reqData,
2951 + sizeof(struct nwc_convert_netware_handle));
2954 + daemon_added_resource(DHandle, DH_TYPE_STREAM,
2955 + Uint32toHandle(nh.ConnHandle),
2956 + nh.NetWareHandle, nh.uAccessMode,
2959 - retVal = Daemon_Added_Resource(DHandle, DH_TYPE_STREAM,
2960 - Uint32toHandle(nh.ConnHandle),
2961 - nh.NetWareHandle, nh.uAccessMode,
2968 -/*++======================================================================*/
2969 -int NwdConvertLocalHandle(PXPLAT pdata, daemon_handle_t * DHandle)
2982 - *========================================================================*/
2983 +static int NwdConvertLocalHandle(struct novfs_xplat *pdata, struct daemon_handle * DHandle)
2985 int retVal = NWE_REQUESTER_FAILURE;
2986 - daemon_resource_t *resource;
2987 - NwcConvertLocalHandle lh;
2988 + struct daemon_resource *resource;
2989 + struct nwc_convert_local_handle lh;
2990 struct list_head *l;
2991 unsigned long cpylen;
2993 @@ -2047,7 +1847,7 @@ int NwdConvertLocalHandle(PXPLAT pdata,
2994 read_lock(&DHandle->lock);
2996 list_for_each(l, &DHandle->list) {
2997 - resource = list_entry(l, daemon_resource_t, list);
2998 + resource = list_entry(l, struct daemon_resource, list);
3000 if (DH_TYPE_STREAM == resource->type) {
3002 @@ -2055,10 +1855,10 @@ int NwdConvertLocalHandle(PXPLAT pdata,
3004 //sgled memcpy(lh.NwWareHandle, resource->handle, sizeof(resource->handle));
3005 memcpy(lh.NetWareHandle, resource->handle, sizeof(resource->handle)); //sgled
3006 - if (pdata->repLen >= sizeof(NwcConvertLocalHandle)) {
3007 + if (pdata->repLen >= sizeof(struct nwc_convert_local_handle)) {
3009 copy_to_user(pdata->repData, &lh,
3010 - sizeof(NwcConvertLocalHandle));
3011 + sizeof(struct nwc_convert_local_handle));
3014 retVal = NWE_BUFFER_OVERFLOW;
3015 @@ -2072,39 +1872,25 @@ int NwdConvertLocalHandle(PXPLAT pdata,
3019 -/*++======================================================================*/
3020 -int NwdGetMountPath(PXPLAT pdata)
3033 - *========================================================================*/
3034 +static int NwdGetMountPath(struct novfs_xplat *pdata)
3036 int retVal = NWE_REQUESTER_FAILURE;
3038 unsigned long cpylen;
3039 - NwcGetMountPath mp;
3040 + struct nwc_get_mount_path mp;
3042 cpylen = copy_from_user(&mp, pdata->reqData, pdata->reqLen);
3044 - if (Novfs_CurrentMount) {
3045 + if (novfs_current_mnt) {
3047 - len = strlen(Novfs_CurrentMount) + 1;
3048 + len = strlen(novfs_current_mnt) + 1;
3049 if ((len > mp.MountPathLen) && mp.pMountPath) {
3050 retVal = NWE_BUFFER_OVERFLOW;
3052 if (mp.pMountPath) {
3054 copy_to_user(mp.pMountPath,
3055 - Novfs_CurrentMount, len);
3056 + novfs_current_mnt, len);
3060 @@ -2119,52 +1905,55 @@ int NwdGetMountPath(PXPLAT pdata)
3064 -static int NwdSetMapDrive(PXPLAT pdata, session_t Session)
3065 +static int set_map_drive(struct novfs_xplat *pdata, struct novfs_schandle Session)
3068 - NwcMapDriveEx symInfo;
3069 + unsigned long cpylen;
3070 + struct nwc_map_drive_ex symInfo;
3072 - drive_map_t *drivemap, *dm;
3073 + struct drive_map *drivemap, *dm;
3074 struct list_head *list;
3076 - retVal = NwcSetMapDrive(pdata, Session);
3077 + retVal = novfs_set_map_drive(pdata, Session);
3081 if (copy_from_user(&symInfo, pdata->reqData, sizeof(symInfo)))
3084 - drivemap = kmalloc(sizeof(drive_map_t) + symInfo.linkOffsetLength, GFP_KERNEL);
3086 + kmalloc(sizeof(struct drive_map) + symInfo.linkOffsetLength,
3091 path = (char *)pdata->reqData;
3092 path += symInfo.linkOffset;
3093 - if (copy_from_user(drivemap->name, path, symInfo.linkOffsetLength)) {
3098 + copy_from_user(drivemap->name, path,
3099 + symInfo.linkOffsetLength);
3101 drivemap->session = Session;
3102 - drivemap->hash = full_name_hash(drivemap->name, symInfo.linkOffsetLength - 1);
3104 + full_name_hash(drivemap->name,
3105 + symInfo.linkOffsetLength - 1);
3106 drivemap->namelen = symInfo.linkOffsetLength - 1;
3107 - DbgPrint("NwdSetMapDrive: hash=0x%x path=%s\n", drivemap->hash, drivemap->name);
3108 + DbgPrint("NwdSetMapDrive: hash=0x%x path=%s\n",
3109 + drivemap->hash, drivemap->name);
3111 - dm = (drive_map_t *) & DriveMapList.next;
3112 + dm = (struct drive_map *) & DriveMapList.next;
3114 down(&DriveMapLock);
3116 list_for_each(list, &DriveMapList) {
3117 - dm = list_entry(list, drive_map_t, list);
3118 + dm = list_entry(list, struct drive_map, list);
3119 DbgPrint("NwdSetMapDrive: dm=0x%p\n"
3123 - dm, dm->hash, dm->namelen, dm->name);
3127 + dm, dm->hash, dm->namelen, dm->name);
3129 if (drivemap->hash == dm->hash) {
3131 - strcmp(dm->name, drivemap->name)) {
3132 + strcmp(dm->name, drivemap->name)) {
3136 @@ -2174,59 +1963,57 @@ static int NwdSetMapDrive(PXPLAT pdata,
3140 - if ((dm == (drive_map_t *) & DriveMapList) ||
3141 - (dm->hash < drivemap->hash)) {
3142 + if ((dm == (struct drive_map *) & DriveMapList) ||
3143 + (dm->hash < drivemap->hash)) {
3144 list_add(&drivemap->list, &dm->list);
3146 list_add_tail(&drivemap->list,
3159 -static int NwdUnMapDrive(PXPLAT pdata, session_t Session)
3160 +static int unmap_drive(struct novfs_xplat *pdata, struct novfs_schandle Session)
3162 int retVal = NWE_REQUESTER_FAILURE;
3163 - NwcUnmapDriveEx symInfo;
3164 + struct nwc_unmap_drive_ex symInfo;
3167 + struct drive_map *dm;
3168 struct list_head *list;
3171 - retVal = NwcUnMapDrive(pdata, Session);
3173 + retVal = novfs_unmap_drive(pdata, Session);
3177 if (copy_from_user(&symInfo, pdata->reqData, sizeof(symInfo)))
3180 path = kmalloc(symInfo.linkLen, GFP_KERNEL);
3184 - if (copy_from_user(path, ((NwcUnmapDriveEx *)pdata->reqData)->linkData, symInfo.linkLen)) {
3185 + if (copy_from_user(path,((struct nwc_unmap_drive_ex *) pdata->reqData)->linkData, symInfo.linkLen)) {
3190 hash = full_name_hash(path, symInfo.linkLen - 1);
3191 - DbgPrint("NwdUnMapDrive: hash=0x%x path=%s\n", hash, path);
3192 + DbgPrint("NwdUnMapDrive: hash=0x%x path=%s\n", hash,
3197 down(&DriveMapLock);
3199 list_for_each(list, &DriveMapList) {
3200 - dm = list_entry(list, drive_map_t, list);
3201 + dm = list_entry(list, struct drive_map, list);
3202 DbgPrint("NwdUnMapDrive: dm=0x%p %s\n"
3205 - dm, dm->name, dm->hash, dm->namelen);
3208 + dm, dm->name, dm->hash, dm->namelen);
3210 if (hash == dm->hash) {
3211 if (0 == strcmp(dm->name, path)) {
3212 @@ -2240,40 +2027,25 @@ static int NwdUnMapDrive(PXPLAT pdata, s
3215 DbgPrint("NwdUnMapDrive: Remove dm=0x%p %s\n"
3218 - dm, dm->name, dm->hash, dm->namelen);
3221 + dm, dm->name, dm->hash, dm->namelen);
3222 list_del(&dm->list);
3232 -/*++======================================================================*/
3233 -void RemoveDriveMaps(void)
3246 - *========================================================================*/
3247 +static void RemoveDriveMaps(void)
3250 + struct drive_map *dm;
3251 struct list_head *list;
3253 down(&DriveMapLock);
3254 list_for_each(list, &DriveMapList) {
3255 - dm = list_entry(list, drive_map_t, list);
3256 + dm = list_entry(list, struct drive_map, list);
3258 DbgPrint("RemoveDriveMap: dm=0x%p\n"
3260 @@ -2288,9 +2060,7 @@ void RemoveDriveMaps(void)
3264 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
3265 -/*++======================================================================*/
3266 -int local_unlink(const char *pathname)
3267 +static int local_unlink(const char *pathname)
3270 struct dentry *dentry;
3271 @@ -2341,60 +2111,3 @@ int local_unlink(const char *pathname)
3276 -/*++======================================================================*/
3277 -int local_unlink(const char *pathname)
3280 - struct dentry *dentry;
3281 - struct nameidata nd;
3282 - struct inode *inode = NULL;
3284 - DbgPrint("local_unlink: %s\n", pathname);
3285 - error = path_lookup(pathname, LOOKUP_PARENT, &nd);
3286 - DbgPrint("local_unlink: path_lookup %d\n", error);
3289 - if (nd.last_type == LAST_NORM) {
3290 - down(&nd.dentry->d_inode->i_sem);
3292 - lookup_one_len(&nd.last, nd.dentry,
3294 - DbgPrint("local_unlink: lookup_hash 0x%p\n", dentry);
3296 - error = PTR_ERR(dentry);
3297 - if (!IS_ERR(dentry)) {
3298 - if (nd.last.name[nd.last.len]) {
3301 - d_inode ? -ENOENT : S_ISDIR(dentry->
3304 - ? -EISDIR : -ENOTDIR;
3306 - inode = dentry->d_inode;
3308 - atomic_inc(&inode->i_count);
3311 - vfs_unlink(nd.dentry->d_inode,
3314 - ("local_unlink: vfs_unlink %d\n",
3319 - up(&nd.dentry->d_inode->i_sem);
3321 - path_release(&nd);
3325 - iput(inode); /* truncate the inode here */
3328 - DbgPrint("local_unlink: error=%d\n", error);
3332 --- a/fs/novfs/file.c
3333 +++ b/fs/novfs/file.c
3335 #include "commands.h"
3336 #include "nwerror.h"
3338 -/*===[ Function prototypes ]==============================================*/
3339 -int Novfs_get_alltrees(struct dentry *parent);
3340 -ssize_t Novfs_tree_read(struct file *file, char *buf, size_t len, loff_t * off);
3342 -int Novfs_Find_Name_In_List(struct qstr *Name, unsigned char * List);
3344 -int Novfs_Create(unsigned char * Path, int DirectoryFlag, session_t SessionId);
3345 -int Novfs_Close_File(HANDLE Handle, session_t SessionId);
3346 -int Novfs_Read_File(HANDLE Handle, unsigned char * Buffer, size_t * Bytes,
3347 - loff_t * Offset, session_t SessionId);
3348 -int Novfs_Write_File(HANDLE Handle, unsigned char * Buffer, size_t * Bytes,
3349 - loff_t * Offset, session_t SessionId);
3350 -int Novfs_Write_Page(HANDLE Handle, struct page *Page, session_t SessionId);
3351 -int Novfs_Read_Stream(HANDLE ConnHandle, unsigned char * Handle, unsigned char * Buffer,
3352 - size_t * Bytes, loff_t * Offset, int User,
3353 - session_t SessionId);
3354 -int Novfs_Write_Stream(HANDLE ConnHandle, unsigned char * Handle, unsigned char * Buffer,
3355 - size_t * Bytes, loff_t * Offset, session_t SessionId);
3356 -int Novfs_Close_Stream(HANDLE ConnHandle, unsigned char * Handle, session_t SessionId);
3357 -int Novfs_Delete(unsigned char * Path, int DirectoryFlag, session_t SessionId);
3358 -int Novfs_Truncate_File(unsigned char * Path, int PathLen, session_t SessionId);
3359 -int Novfs_Truncate_File_Ex(HANDLE Handle, loff_t Offset, session_t SessionId);
3360 -int Novfs_Rename_File(int DirectoryFlag, unsigned char * OldName, int OldLen,
3361 - unsigned char * NewName, int NewLen, session_t SessionId);
3362 -int Novfs_Set_Attr(unsigned char * Path, struct iattr *Attr, session_t SessionId);
3363 -int Novfs_Get_File_Cache_Flag(unsigned char * Path, session_t SessionId);
3364 +static ssize_t novfs_tree_read(struct file * file, char *buf, size_t len, loff_t * off);
3365 +extern struct dentry_operations novfs_dentry_operations;
3367 -static struct file_operations Novfs_tree_operations = {
3368 - read:Novfs_tree_read,
3369 +static struct file_operations novfs_tree_operations = {
3370 + read:novfs_tree_read,
3374 @@ -65,12 +41,12 @@ static struct file_operations Novfs_tree
3376 static int StripTrailingDots = 1;
3378 -int Novfs_get_alltrees(struct dentry *parent)
3379 +int novfs_get_alltrees(struct dentry *parent)
3382 - PCOMMAND_REPLY_HEADER reply = NULL;
3383 + struct novfs_command_reply_header * reply = NULL;
3384 unsigned long replylen = 0;
3385 - COMMAND_REQUEST_HEADER cmd;
3386 + struct novfs_command_request_header cmd;
3388 struct dentry *entry;
3390 @@ -81,30 +57,30 @@ int Novfs_get_alltrees(struct dentry *pa
3391 //sg ??? cmd.SessionId = 0x1234;
3392 SC_INITIALIZE(cmd.SessionId);
3394 - DbgPrint("Novfs_get_alltrees:\n");
3395 + DbgPrint("novfs_get_alltrees:\n");
3397 retCode = Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
3398 - DbgPrint("Novfs_get_alltrees: relpy=0x%p replylen=%d\n", reply,
3399 + DbgPrint("novfs_get_alltrees: relpy=0x%p replylen=%d\n", reply,
3402 - mydump(replylen, reply);
3403 + novfs_dump(replylen, reply);
3404 if (!reply->ErrorCode
3405 - && (replylen > sizeof(COMMAND_REPLY_HEADER))) {
3406 + && (replylen > sizeof(struct novfs_command_reply_header))) {
3407 p = (char *)reply + 8;
3409 - DbgPrint("Novfs_get_alltrees: %s\n", p);
3410 + DbgPrint("novfs_get_alltrees: %s\n", p);
3411 name.len = strlen(p);
3413 name.hash = full_name_hash(name.name, name.len);
3414 entry = d_lookup(parent, &name);
3415 if (NULL == entry) {
3416 - DbgPrint("Novfs_get_alltrees: adding %s\n", p);
3417 + DbgPrint("novfs_get_alltrees: adding %s\n", p);
3418 entry = d_alloc(parent, &name);
3420 - entry->d_op = &Novfs_dentry_operations;
3421 - inode = Novfs_get_inode(parent->d_sb, S_IFREG | 0400, 0, 0, 0, &name);
3422 + entry->d_op = &novfs_dentry_operations;
3423 + inode = novfs_get_inode(parent->d_sb, S_IFREG | 0400, 0, 0, 0, &name);
3425 - inode->i_fop = &Novfs_tree_operations;
3426 + inode->i_fop = &novfs_tree_operations;
3427 d_add(entry, inode);
3430 @@ -117,7 +93,7 @@ int Novfs_get_alltrees(struct dentry *pa
3434 -ssize_t Novfs_tree_read(struct file * file, char *buf, size_t len, loff_t * off)
3435 +static ssize_t novfs_tree_read(struct file * file, char *buf, size_t len, loff_t * off)
3437 if (file->f_pos != 0) {
3439 @@ -128,24 +104,24 @@ ssize_t Novfs_tree_read(struct file * fi
3443 -int Novfs_Get_Connected_Server_List(unsigned char ** ServerList, struct schandle *SessionId)
3444 +int novfs_get_servers(unsigned char ** ServerList, struct novfs_schandle SessionId)
3446 - GET_CONNECTED_SERVER_LIST_REQUEST req;
3447 - PGET_CONNECTED_SERVER_LIST_REPLY reply = NULL;
3448 + struct novfs_get_connected_server_list req;
3449 + struct novfs_get_connected_server_list_reply *reply = NULL;
3450 unsigned long replylen = 0;
3455 req.Command.CommandType = VFS_COMMAND_GET_CONNECTED_SERVER_LIST;
3456 - memcpy(&req.Command.SessionId, SessionId, sizeof(*SessionId));
3457 + req.Command.SessionId = SessionId;
3460 Queue_Daemon_Command(&req, sizeof(req), NULL, 0, (void *)&reply,
3461 &replylen, INTERRUPTIBLE);
3463 - DbgPrint("Novfs_Get_Connected_Server_List: reply\n");
3464 - replylen -= sizeof(COMMAND_REPLY_HEADER);
3465 + DbgPrint("novfs_Get_Connected_Server_List: reply\n");
3466 + replylen -= sizeof(struct novfs_command_reply_header);
3467 if (!reply->Reply.ErrorCode && replylen) {
3468 memcpy(reply, reply->List, replylen);
3469 *ServerList = (unsigned char *) reply;
3470 @@ -158,30 +134,31 @@ int Novfs_Get_Connected_Server_List(unsi
3474 -int Novfs_Get_Server_Volume_List(struct qstr *Server, unsigned char ** VolumeList,
3475 - struct schandle *SessionId)
3476 +int novfs_get_vols(struct qstr *Server, unsigned char ** VolumeList,
3477 + struct novfs_schandle SessionId)
3479 - PGET_SERVER_VOLUME_LIST_REQUEST req;
3480 - PGET_SERVER_VOLUME_LIST_REPLY reply = NULL;
3481 + struct novfs_get_server_volume_list *req;
3482 + struct novfs_get_server_volume_list_reply *reply = NULL;
3483 unsigned long replylen = 0, reqlen;
3487 - reqlen = sizeof(GET_SERVER_VOLUME_LIST_REQUEST) + Server->len;
3488 + reqlen = sizeof(struct novfs_get_server_volume_list) + Server->len;
3489 req = kmalloc(reqlen, GFP_KERNEL);
3492 req->Command.CommandType = VFS_COMMAND_GET_SERVER_VOLUME_LIST;
3493 req->Length = Server->len;
3494 memcpy(req->Name, Server->name, Server->len);
3495 - memcpy(&req->Command.SessionId, SessionId, sizeof(*SessionId));
3496 + req->Command.SessionId = SessionId;
3498 - retCode = Queue_Daemon_Command(req, reqlen, NULL, 0, (void *)&reply,
3499 - &replylen, INTERRUPTIBLE);
3501 + Queue_Daemon_Command(req, reqlen, NULL, 0, (void *)&reply,
3502 + &replylen, INTERRUPTIBLE);
3504 - DbgPrint("Novfs_Get_Server_Volume_List: reply\n");
3505 - mydump(replylen, reply);
3506 - replylen -= sizeof(COMMAND_REPLY_HEADER);
3507 + DbgPrint("novfs_Get_Server_Volume_List: reply\n");
3508 + novfs_dump(replylen, reply);
3509 + replylen -= sizeof(struct novfs_command_reply_header);
3511 if (!reply->Reply.ErrorCode && replylen) {
3512 memcpy(reply, reply->List, replylen);
3513 @@ -193,35 +170,19 @@ int Novfs_Get_Server_Volume_List(struct
3520 -int Novfs_Find_Name_In_List(struct qstr *Name, unsigned char * List)
3526 - len = strlen(List);
3527 - if ((len == Name->len) && !strncmp(Name->name, List, len)) {
3531 - List += (len + 1);
3536 -int Novfs_Get_File_Info(unsigned char * Path, struct entry_info *Info, struct schandle *SessionId)
3537 +int novfs_get_file_info(unsigned char * Path, struct novfs_entry_info * Info, struct novfs_schandle SessionId)
3539 - PVERIFY_FILE_REPLY reply = NULL;
3540 + struct novfs_verify_file_reply *reply = NULL;
3541 unsigned long replylen = 0;
3542 - PVERIFY_FILE_REQUEST cmd;
3543 + struct novfs_verify_file_request * cmd;
3545 int retCode = -ENOENT;
3548 - DbgPrint("%s: Path = %s\n", __func__, Path);
3549 + DbgPrint("novfs_Get_File_Info: Path = %s\n", Path);
3551 Info->mode = S_IFDIR | 0700;
3552 Info->uid = current->uid;
3553 @@ -235,12 +196,12 @@ int Novfs_Get_File_Info(unsigned char *
3554 if ('.' == Path[pathlen - 1])
3557 - cmdlen = offsetof(VERIFY_FILE_REQUEST, path) + pathlen;
3558 - cmd = (PVERIFY_FILE_REQUEST) Novfs_Malloc(cmdlen, GFP_KERNEL);
3559 + cmdlen = offsetof(struct novfs_verify_file_request,path) + pathlen;
3560 + cmd = kmalloc(cmdlen, GFP_KERNEL);
3562 cmd->Command.CommandType = VFS_COMMAND_VERIFY_FILE;
3563 cmd->Command.SequenceNumber = 0;
3564 - memcpy(&cmd->Command.SessionId, SessionId, sizeof(*SessionId));
3565 + cmd->Command.SessionId = SessionId;
3566 cmd->pathLen = pathlen;
3567 memcpy(cmd->path, Path, cmd->pathLen);
3569 @@ -279,11 +240,18 @@ int Novfs_Get_File_Info(unsigned char *
3570 Info->mtime.tv_nsec = 0;
3571 Info->ctime.tv_sec = reply->createTime;
3572 Info->ctime.tv_nsec = 0;
3573 - DbgPrint("%s: replylen=%d sizeof(VERIFY_FILE_REPLY)=%d\n", __func__, replylen, sizeof(VERIFY_FILE_REPLY));
3574 - if (replylen > sizeof(VERIFY_FILE_REPLY)) {
3575 - unsigned int *lp = &reply->fileMode;
3577 + ("novfs_Get_File_Info: replylen=%d sizeof(VERIFY_FILE_REPLY)=%d\n",
3579 + sizeof(struct novfs_verify_file_reply));
3581 + sizeof(struct novfs_verify_file_reply)) {
3582 + unsigned int *lp =
3585 - DbgPrint("%s: extra data 0x%x\n", __func__, *lp);
3587 + ("novfs_Get_File_Info: extra data 0x%x\n",
3589 Info->mtime.tv_nsec = *lp;
3592 @@ -295,35 +263,37 @@ int Novfs_Get_File_Info(unsigned char *
3596 - DbgPrint("%s: return 0x%x\n", __func__, retCode);
3597 + DbgPrint("novfs_Get_File_Info: return 0x%x\n", retCode);
3601 -int Novfs_GetX_File_Info(char *Path, const char *Name, char *buffer,
3602 +int novfs_getx_file_info(char *Path, const char *Name, char *buffer,
3603 ssize_t buffer_size, ssize_t * dataLen,
3604 - session_t *SessionId)
3605 + struct novfs_schandle SessionId)
3607 - PXA_GET_REPLY reply = NULL;
3608 + struct novfs_xa_get_reply *reply = NULL;
3609 unsigned long replylen = 0;
3610 - PXA_GET_REQUEST cmd;
3611 + struct novfs_xa_get_request *cmd;
3613 int retCode = -ENOENT;
3615 int namelen = strlen(Name);
3616 int pathlen = strlen(Path);
3618 - DbgPrint("%s: xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i\n", __func__, Path, pathlen, Name, namelen);
3620 + ("novfs_GetX_File_Info xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i\n",
3621 + Path, pathlen, Name, namelen);
3623 if (namelen > MAX_XATTR_NAME_LEN) {
3627 - cmdlen = offsetof(XA_GET_REQUEST, data) + pathlen + 1 + namelen + 1; // two '\0'
3628 - cmd = (PXA_GET_REQUEST) Novfs_Malloc(cmdlen, GFP_KERNEL);
3629 + cmdlen = offsetof(struct novfs_xa_get_request, data) + pathlen + 1 + namelen + 1; // two '\0'
3630 + cmd = (struct novfs_xa_get_request *) kmalloc(cmdlen, GFP_KERNEL);
3632 cmd->Command.CommandType = VFS_COMMAND_GET_EXTENDED_ATTRIBUTE;
3633 cmd->Command.SequenceNumber = 0;
3634 - memcpy(&cmd->Command.SessionId, SessionId, sizeof(*SessionId));
3635 + cmd->Command.SessionId = SessionId;
3637 cmd->pathLen = pathlen;
3638 memcpy(cmd->data, Path, cmd->pathLen + 1); //+ '\0'
3639 @@ -331,14 +301,20 @@ int Novfs_GetX_File_Info(char *Path, con
3640 cmd->nameLen = namelen;
3641 memcpy(cmd->data + cmd->pathLen + 1, Name, cmd->nameLen + 1);
3643 - DbgPrint("%s xattr: PXA_GET_REQUEST BEGIN\n", __func__);
3644 - DbgPrint("%s xattr: Queue_Daemon_Command %d\n", __func__, cmd->Command.CommandType);
3645 - DbgPrint("%s xattr: Command.SessionId = %d\n", __func__, cmd->Command.SessionId);
3646 - DbgPrint("%s xattr: pathLen = %d\n", __func__, cmd->pathLen);
3647 - DbgPrint("%s xattr: Path = %s\n", __func__, cmd->data);
3648 - DbgPrint("%s xattr: nameLen = %d\n", __func__, cmd->nameLen);
3649 - DbgPrint("%s xattr: name = %s\n", __func__, (cmd->data + cmd->pathLen + 1));
3650 - DbgPrint("%s xattr: PXA_GET_REQUEST END\n", __func__);
3651 + DbgPrint("novfs_GetX_File_Info xattr: PXA_GET_REQUEST BEGIN\n");
3653 + ("novfs_GetX_File_Info xattr: Queue_Daemon_Command %d\n",
3654 + cmd->Command.CommandType);
3655 + DbgPrint("novfs_GetX_File_Info xattr: Command.SessionId = %d\n",
3656 + cmd->Command.SessionId);
3657 + DbgPrint("novfs_GetX_File_Info xattr: pathLen = %d\n",
3659 + DbgPrint("novfs_GetX_File_Info xattr: Path = %s\n", cmd->data);
3660 + DbgPrint("novfs_GetX_File_Info xattr: nameLen = %d\n",
3662 + DbgPrint("novfs_GetX_File_Info xattr: name = %s\n",
3663 + (cmd->data + cmd->pathLen + 1));
3664 + DbgPrint("novfs_GetX_File_Info xattr: PXA_GET_REQUEST END\n");
3667 Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
3668 @@ -347,8 +323,13 @@ int Novfs_GetX_File_Info(char *Path, con
3671 if (reply->Reply.ErrorCode) {
3672 - DbgPrint("%s xattr: reply->Reply.ErrorCode=%d, %X\n", __func__, reply->Reply.ErrorCode, reply->Reply.ErrorCode);
3673 - DbgPrint("%s xattr: replylen=%d\n", __func__, replylen);
3675 + ("novfs_GetX_File_Info xattr: reply->Reply.ErrorCode=%d, %X\n",
3676 + reply->Reply.ErrorCode,
3677 + reply->Reply.ErrorCode);
3679 + ("novfs_GetX_File_Info xattr: replylen=%d\n",
3682 //0xC9 = EA not found (C9), 0xD1 = EA access denied
3683 if ((reply->Reply.ErrorCode == 0xC9)
3684 @@ -360,26 +341,32 @@ int Novfs_GetX_File_Info(char *Path, con
3688 - replylen - sizeof(COMMAND_REPLY_HEADER);
3689 - DbgPrint("%s xattr: replylen=%u, dataLen=%u\n", __func__, replylen, *dataLen);
3690 + replylen - sizeof(struct novfs_command_reply_header);
3692 + ("novfs_GetX_File_Info xattr: replylen=%u, dataLen=%u\n",
3693 + replylen, *dataLen);
3695 if (buffer_size >= *dataLen) {
3696 - DbgPrint("%s xattr: copying to buffer from &reply->pData\n", __func__);
3698 + ("novfs_GetX_File_Info xattr: copying to buffer from &reply->pData\n");
3699 memcpy(buffer, &reply->pData, *dataLen);
3703 - DbgPrint("%s xattr: (!!!) buffer is smaller then reply\n", __func__);
3705 + ("novfs_GetX_File_Info xattr: (!!!) buffer is smaller then reply\n");
3708 - DbgPrint("%s xattr: /dumping buffer\n", __func__);
3709 - mydump(*dataLen, buffer);
3710 - DbgPrint("%s xattr: \\after dumping buffer\n", __func__);
3712 + ("novfs_GetX_File_Info xattr: /dumping buffer\n");
3713 + novfs_dump(*dataLen, buffer);
3715 + ("novfs_GetX_File_Info xattr: \\after dumping buffer\n");
3720 - DbgPrint("%s xattr: reply = NULL\n", __func__);
3721 + DbgPrint("novfs_GetX_File_Info xattr: reply = NULL\n");
3725 @@ -388,32 +375,33 @@ int Novfs_GetX_File_Info(char *Path, con
3729 -int Novfs_SetX_File_Info(char *Path, const char *Name, const void *Value,
3730 +int novfs_setx_file_info(char *Path, const char *Name, const void *Value,
3731 unsigned long valueLen, unsigned long *bytesWritten,
3732 - int flags, struct schandle *SessionId)
3733 + int flags, struct novfs_schandle SessionId)
3735 - PXA_SET_REPLY reply = NULL;
3736 + struct novfs_xa_set_reply *reply = NULL;
3737 unsigned long replylen = 0;
3738 - PXA_SET_REQUEST cmd;
3739 + struct novfs_xa_set_request *cmd;
3741 int retCode = -ENOENT;
3743 int namelen = strlen(Name);
3744 int pathlen = strlen(Path);
3746 - DbgPrint("%s xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i, value len = %u\n", __func__,
3748 + ("novfs_SetX_File_Info xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i, value len = %u\n",
3749 Path, pathlen, Name, namelen, valueLen);
3751 if (namelen > MAX_XATTR_NAME_LEN) {
3755 - cmdlen = offsetof(XA_SET_REQUEST, data) + pathlen + 1 + namelen + 1 + valueLen;
3756 - cmd = (PXA_SET_REQUEST) Novfs_Malloc(cmdlen, GFP_KERNEL);
3757 + cmdlen = offsetof(struct novfs_xa_set_request, data) + pathlen + 1 + namelen + 1 + valueLen;
3758 + cmd = (struct novfs_xa_set_request *) kmalloc(cmdlen, GFP_KERNEL);
3760 cmd->Command.CommandType = VFS_COMMAND_SET_EXTENDED_ATTRIBUTE;
3761 cmd->Command.SequenceNumber = 0;
3762 - memcpy(&cmd->Command.SessionId, SessionId, sizeof(*SessionId));
3763 + cmd->Command.SessionId = SessionId;
3766 cmd->pathLen = pathlen;
3767 @@ -426,16 +414,22 @@ int Novfs_SetX_File_Info(char *Path, con
3768 memcpy(cmd->data + cmd->pathLen + 1 + cmd->nameLen + 1, Value,
3771 - DbgPrint("%s xattr: PXA_SET_REQUEST BEGIN\n", __func__);
3772 - DbgPrint("%s xattr: Queue_Daemon_Command %d\n", __func__, cmd->Command.CommandType);
3773 - DbgPrint("%s xattr: Command.SessionId = %d\n", __func__, cmd->Command.SessionId);
3774 - DbgPrint("%s xattr: pathLen = %d\n", __func__, cmd->pathLen);
3775 - DbgPrint("%s xattr: Path = %s\n", __func__, cmd->data);
3776 - DbgPrint("%s xattr: nameLen = %d\n", __func__, cmd->nameLen);
3777 - DbgPrint("%s xattr: name = %s\n", __func__, (cmd->data + cmd->pathLen + 1));
3778 - mydump(valueLen < 16 ? valueLen : 16, (char *)Value);
3779 + DbgPrint("novfs_SetX_File_Info xattr: PXA_SET_REQUEST BEGIN\n");
3781 + ("novfs_SetX_File_Info xattr: Queue_Daemon_Command %d\n",
3782 + cmd->Command.CommandType);
3783 + DbgPrint("novfs_SetX_File_Info xattr: Command.SessionId = %d\n",
3784 + cmd->Command.SessionId);
3785 + DbgPrint("novfs_SetX_File_Info xattr: pathLen = %d\n",
3787 + DbgPrint("novfs_SetX_File_Info xattr: Path = %s\n", cmd->data);
3788 + DbgPrint("novfs_SetX_File_Info xattr: nameLen = %d\n",
3790 + DbgPrint("novfs_SetX_File_Info xattr: name = %s\n",
3791 + (cmd->data + cmd->pathLen + 1));
3792 + novfs_dump(valueLen < 16 ? valueLen : 16, (char *)Value);
3794 - DbgPrint("%s xattr: PXA_SET_REQUEST END\n", __func__);
3795 + DbgPrint("novfs_SetX_File_Info xattr: PXA_SET_REQUEST END\n");
3798 Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
3799 @@ -444,22 +438,30 @@ int Novfs_SetX_File_Info(char *Path, con
3802 if (reply->Reply.ErrorCode) {
3803 - DbgPrint("%s xattr: reply->Reply.ErrorCode=%d, %X\n", __func__, reply->Reply.ErrorCode, reply->Reply.ErrorCode);
3804 - DbgPrint("%s xattr: replylen=%d\n", __func__, replylen);
3806 + ("novfs_SetX_File_Info xattr: reply->Reply.ErrorCode=%d, %X\n",
3807 + reply->Reply.ErrorCode,
3808 + reply->Reply.ErrorCode);
3810 + ("novfs_SetX_File_Info xattr: replylen=%d\n",
3813 retCode = -reply->Reply.ErrorCode; //-ENOENT;
3816 - DbgPrint("%s xattr: replylen=%u, real len = %u\n", __func__, replylen, replylen - sizeof(COMMAND_REPLY_HEADER));
3818 + ("novfs_SetX_File_Info xattr: replylen=%u, real len = %u\n",
3820 + replylen - sizeof(struct novfs_command_reply_header));
3821 memcpy(bytesWritten, &reply->pData,
3822 - replylen - sizeof(COMMAND_REPLY_HEADER));
3823 + replylen - sizeof(struct novfs_command_reply_header));
3830 - DbgPrint("%s xattr: reply = NULL\n", __func__);
3831 + DbgPrint("novfs_SetX_File_Info xattr: reply = NULL\n");
3835 @@ -468,32 +470,41 @@ int Novfs_SetX_File_Info(char *Path, con
3839 -int Novfs_ListX_File_Info(char *Path, char *buffer, ssize_t buffer_size, ssize_t * dataLen, struct schandle *SessionId)
3840 +int novfs_listx_file_info(char *Path, char *buffer, ssize_t buffer_size,
3841 + ssize_t * dataLen, struct novfs_schandle SessionId)
3843 - PXA_LIST_REPLY reply = NULL;
3844 + struct novfs_xa_list_reply *reply = NULL;
3845 unsigned long replylen = 0;
3846 - PVERIFY_FILE_REQUEST cmd;
3847 + struct novfs_verify_file_request *cmd;
3849 int retCode = -ENOENT;
3851 int pathlen = strlen(Path);
3852 - DbgPrint("%s xattr: Path = %s, pathlen = %i\n", __func__, Path, pathlen);
3853 + DbgPrint("novfs_ListX_File_Info xattr: Path = %s, pathlen = %i\n", Path,
3857 - cmdlen = offsetof(VERIFY_FILE_REQUEST, path) + pathlen;
3858 - cmd = (PVERIFY_FILE_REQUEST) Novfs_Malloc(cmdlen, GFP_KERNEL);
3859 + cmdlen = offsetof(struct novfs_verify_file_request, path) + pathlen;
3860 + cmd = (struct novfs_verify_file_request *) kmalloc(cmdlen, GFP_KERNEL);
3862 cmd->Command.CommandType = VFS_COMMAND_LIST_EXTENDED_ATTRIBUTES;
3863 cmd->Command.SequenceNumber = 0;
3864 - memcpy(&cmd->Command.SessionId, SessionId, sizeof(*SessionId));
3865 + cmd->Command.SessionId = SessionId;
3866 cmd->pathLen = pathlen;
3867 memcpy(cmd->path, Path, cmd->pathLen + 1); //+ '\0'
3868 - DbgPrint("%s xattr: PVERIFY_FILE_REQUEST BEGIN\n", __func__);
3869 - DbgPrint("%s xattr: Queue_Daemon_Command %d\n", __func__, cmd->Command.CommandType);
3870 - DbgPrint("%s xattr: Command.SessionId = %d\n", __func__, cmd->Command.SessionId);
3871 - DbgPrint("%s xattr: pathLen = %d\n", __func__, cmd->pathLen);
3872 - DbgPrint("%s xattr: Path = %s\n", __func__, cmd->path);
3873 - DbgPrint("%s xattr: PVERIFY_FILE_REQUEST END\n", __func__);
3875 + ("novfs_ListX_File_Info xattr: PVERIFY_FILE_REQUEST BEGIN\n");
3877 + ("novfs_ListX_File_Info xattr: Queue_Daemon_Command %d\n",
3878 + cmd->Command.CommandType);
3880 + ("novfs_ListX_File_Info xattr: Command.SessionId = %d\n",
3881 + cmd->Command.SessionId);
3882 + DbgPrint("novfs_ListX_File_Info xattr: pathLen = %d\n",
3884 + DbgPrint("novfs_ListX_File_Info xattr: Path = %s\n", cmd->path);
3886 + ("novfs_ListX_File_Info xattr: PVERIFY_FILE_REQUEST END\n");
3889 Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
3890 @@ -502,31 +513,43 @@ int Novfs_ListX_File_Info(char *Path, ch
3893 if (reply->Reply.ErrorCode) {
3894 - DbgPrint("%s xattr: reply->Reply.ErrorCode=%d, %X\n", __func__, reply->Reply.ErrorCode, reply->Reply.ErrorCode);
3895 - DbgPrint("%s xattr: replylen=%d\n", __func__, replylen);
3897 + ("novfs_ListX_File_Info xattr: reply->Reply.ErrorCode=%d, %X\n",
3898 + reply->Reply.ErrorCode,
3899 + reply->Reply.ErrorCode);
3901 + ("novfs_ListX_File_Info xattr: replylen=%d\n",
3906 - *dataLen = replylen - sizeof(COMMAND_REPLY_HEADER);
3907 - DbgPrint("%s xattr: replylen=%u, dataLen=%u\n", __func__, replylen, *dataLen);
3909 + replylen - sizeof(struct novfs_command_reply_header);
3911 + ("novfs_ListX_File_Info xattr: replylen=%u, dataLen=%u\n",
3912 + replylen, *dataLen);
3914 if (buffer_size >= *dataLen) {
3915 - DbgPrint("%s xattr: copying to buffer from &reply->pData\n", __func__);
3917 + ("novfs_ListX_File_Info xattr: copying to buffer from &reply->pData\n");
3918 memcpy(buffer, &reply->pData, *dataLen);
3920 - DbgPrint("%s xattr: (!!!) buffer is smaller then reply\n", __func__);
3922 + ("novfs_ListX_File_Info xattr: (!!!) buffer is smaller then reply\n");
3925 - DbgPrint("%s xattr: /dumping buffer\n", __func__);
3926 - mydump(*dataLen, buffer);
3927 - DbgPrint("%s xattr: \\after dumping buffer\n", __func__);
3929 + ("novfs_ListX_File_Info xattr: /dumping buffer\n");
3930 + novfs_dump(*dataLen, buffer);
3932 + ("novfs_ListX_File_Info xattr: \\after dumping buffer\n");
3939 - DbgPrint("%s xattr: reply = NULL\n", __func__);
3940 + DbgPrint("novfs_ListX_File_Info xattr: reply = NULL\n");
3944 @@ -535,21 +558,23 @@ int Novfs_ListX_File_Info(char *Path, ch
3948 -static int begin_directory_enumerate(unsigned char *Path, int PathLen, HANDLE *EnumHandle, struct schandle *SessionId)
3949 +static int begin_directory_enumerate(unsigned char * Path, int PathLen, void ** EnumHandle,
3950 + struct novfs_schandle SessionId)
3952 - PBEGIN_ENUMERATE_DIRECTORY_REQUEST cmd;
3953 - PBEGIN_ENUMERATE_DIRECTORY_REPLY reply = NULL;
3954 + struct novfs_begin_enumerate_directory_request *cmd;
3955 + struct novfs_begin_enumerate_directory_reply *reply = NULL;
3956 unsigned long replylen = 0;
3957 int retCode, cmdlen;
3961 - cmdlen = offsetof(BEGIN_ENUMERATE_DIRECTORY_REQUEST, path) + PathLen;
3962 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
3963 + cmdlen = offsetof(struct
3964 + novfs_begin_enumerate_directory_request, path) + PathLen;
3965 + cmd = kmalloc(cmdlen, GFP_KERNEL);
3967 cmd->Command.CommandType = VFS_COMMAND_START_ENUMERATE;
3968 cmd->Command.SequenceNumber = 0;
3969 - memcpy(&cmd->Command.SessionId, SessionId, sizeof(*SessionId));
3970 + cmd->Command.SessionId = SessionId;
3972 cmd->pathLen = PathLen;
3973 memcpy(cmd->path, Path, PathLen);
3974 @@ -576,16 +601,16 @@ static int begin_directory_enumerate(uns
3978 -static int end_directory_enumerate(HANDLE EnumHandle, struct schandle *SessionId)
3979 +static int end_directory_enumerate(void *EnumHandle, struct novfs_schandle SessionId)
3981 - END_ENUMERATE_DIRECTORY_REQUEST cmd;
3982 - PEND_ENUMERATE_DIRECTORY_REPLY reply = NULL;
3983 + struct novfs_end_enumerate_directory_request cmd;
3984 + struct novfs_end_enumerate_directory_reply *reply = NULL;
3985 unsigned long replylen = 0;
3988 cmd.Command.CommandType = VFS_COMMAND_END_ENUMERATE;
3989 cmd.Command.SequenceNumber = 0;
3990 - copy_session_id(&cmd.Command.SessionId, SessionId);
3991 + cmd.Command.SessionId = SessionId;
3993 cmd.enumerateHandle = EnumHandle;
3995 @@ -603,95 +628,24 @@ static int end_directory_enumerate(HANDL
3999 -int directory_enumerate(HANDLE * EnumHandle, struct entry_info *Info,
4000 - session_t SessionId)
4001 +static int directory_enumerate_ex(void ** EnumHandle, struct novfs_schandle SessionId, int *Count,
4002 + struct novfs_entry_info **PInfo, int Interrupt)
4004 - ENUMERATE_DIRECTORY_REQUEST cmd;
4005 - PENUMERATE_DIRECTORY_REPLY reply = NULL;
4006 - unsigned long replylen = 0;
4009 - cmd.Command.CommandType = VFS_COMMAND_ENUMERATE_DIRECTORY;
4010 - cmd.Command.SequenceNumber = 0;
4011 - cmd.Command.SessionId = SessionId;
4013 - cmd.enumerateHandle = *EnumHandle;
4015 - cmd.path[0] = '\0';
4018 - Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
4019 - &replylen, INTERRUPTIBLE);
4023 - * The VFS_COMMAND_ENUMERATE_DIRECTORY call can return an
4024 - * error but there could still be valid data.
4026 - if (!reply->Reply.ErrorCode ||
4027 - ((replylen > sizeof(COMMAND_REPLY_HEADER)) &&
4028 - (reply->nameLen > 0))) {
4030 - Info->mode = S_IRWXU;
4032 - if (reply->mode & NW_ATTRIBUTE_DIRECTORY) {
4033 - Info->mode |= S_IFDIR;
4034 - Info->mode |= S_IXUSR;
4036 - Info->mode |= S_IFREG;
4039 - if (reply->mode & NW_ATTRIBUTE_READ_ONLY) {
4040 - Info->mode &= ~(S_IWUSR);
4043 - if (reply->mode & NW_ATTRIBUTE_EXECUTE) {
4044 - Info->mode |= S_IXUSR;
4047 - Info->uid = current->uid;
4048 - Info->gid = current->gid;
4049 - Info->size = reply->size;
4050 - Info->atime.tv_sec = reply->lastAccessTime;
4051 - Info->atime.tv_nsec = 0;
4052 - Info->mtime.tv_sec = reply->modifyTime;
4053 - Info->mtime.tv_nsec = 0;
4054 - Info->ctime.tv_sec = reply->createTime;
4055 - Info->ctime.tv_nsec = 0;
4056 - Info->namelength = reply->nameLen;
4057 - memcpy(Info->name, reply->name, reply->nameLen);
4059 - if (reply->Reply.ErrorCode) {
4060 - retCode = -1; /* Eof of data */
4062 - *EnumHandle = reply->enumerateHandle;
4064 - retCode = -ENODATA;
4072 -static int directory_enumerate_ex(HANDLE *EnumHandle, struct schandle *SessionId, int *Count, struct entry_info **PInfo, int Interrupt)
4074 - ENUMERATE_DIRECTORY_EX_REQUEST cmd;
4075 - PENUMERATE_DIRECTORY_EX_REPLY reply = NULL;
4076 + struct novfs_enumerate_directory_ex_request cmd;
4077 + struct novfs_enumerate_directory_ex_reply *reply = NULL;
4078 unsigned long replylen = 0;
4080 - struct entry_info *info;
4081 - PENUMERATE_DIRECTORY_EX_DATA data;
4082 + struct novfs_entry_info * info;
4083 + struct novfs_enumerate_directory_ex_data *data;
4092 cmd.Command.CommandType = VFS_COMMAND_ENUMERATE_DIRECTORY_EX;
4093 cmd.Command.SequenceNumber = 0;
4094 - copy_session_id(&cmd.Command.SessionId, SessionId);
4095 + cmd.Command.SessionId = SessionId;
4097 cmd.enumerateHandle = *EnumHandle;
4099 @@ -709,57 +663,92 @@ static int directory_enumerate_ex(HANDLE
4102 if (!reply->Reply.ErrorCode ||
4103 - ((replylen > sizeof(COMMAND_REPLY_HEADER)) &&
4104 + ((replylen > sizeof(struct novfs_command_reply_header)) &&
4105 (reply->enumCount > 0))) {
4106 DbgPrint("directory_enumerate_ex: isize=%d\n",
4108 - data = (PENUMERATE_DIRECTORY_EX_DATA) ((char *)reply + sizeof(ENUMERATE_DIRECTORY_EX_REPLY));
4109 - isize = replylen - sizeof(PENUMERATE_DIRECTORY_EX_REPLY) - reply->enumCount * offsetof(ENUMERATE_DIRECTORY_EX_DATA, name);
4110 - isize += (reply->enumCount * offsetof(struct entry_info, name));
4112 + (struct novfs_enumerate_directory_ex_data *) ((char *)reply +
4114 + (struct novfs_enumerate_directory_ex_reply));
4116 + replylen - sizeof(struct novfs_enumerate_directory_ex_reply *) -
4117 + reply->enumCount *
4119 + novfs_enumerate_directory_ex_data, name);
4121 + (reply->enumCount *
4122 + offsetof(struct novfs_entry_info, name));
4125 - *PInfo = info = Novfs_Malloc(isize, GFP_KERNEL);
4126 + *PInfo = info = kmalloc(isize, GFP_KERNEL);
4128 - DbgPrint("directory_enumerate_ex1: data=0x%p info=0x%p\n", data, info);
4130 + ("directory_enumerate_ex1: data=0x%p info=0x%p\n",
4132 *Count = reply->enumCount;
4134 - DbgPrint("directory_enumerate_ex2: data=0x%p length=%d\n", data);
4136 + ("directory_enumerate_ex2: data=0x%p length=%d\n",
4140 info->mode = S_IRWXU;
4142 - if (data->mode & NW_ATTRIBUTE_DIRECTORY) {
4145 + NW_ATTRIBUTE_DIRECTORY) {
4146 info->mode |= S_IFDIR;
4147 info->mode |= S_IXUSR;
4149 info->mode |= S_IFREG;
4152 - if (data->mode & NW_ATTRIBUTE_READ_ONLY) {
4153 - info->mode &= ~(S_IWUSR);
4156 + NW_ATTRIBUTE_READ_ONLY) {
4161 - if (data->mode & NW_ATTRIBUTE_EXECUTE) {
4163 + mode & NW_ATTRIBUTE_EXECUTE)
4165 info->mode |= S_IXUSR;
4168 info->uid = current->euid;
4169 info->gid = current->egid;
4170 info->size = data->size;
4171 - info->atime.tv_sec = data->lastAccessTime;
4172 + info->atime.tv_sec =
4173 + data->lastAccessTime;
4174 info->atime.tv_nsec = 0;
4175 - info->mtime.tv_sec = data->modifyTime;
4176 + info->mtime.tv_sec =
4178 info->mtime.tv_nsec = 0;
4179 - info->ctime.tv_sec = data->createTime;
4180 + info->ctime.tv_sec =
4182 info->ctime.tv_nsec = 0;
4183 - info->namelength = data->nameLen;
4184 - memcpy(info->name, data->name, data->nameLen);
4185 - data = (PENUMERATE_DIRECTORY_EX_DATA)&data->name[data->nameLen];
4186 - replylen = (int)((char *)&info->name[info->namelength] - (char *)info);
4187 - DbgPrint("directory_enumerate_ex3: info=0x%p\n", info);
4188 - mydump(replylen, info);
4190 - info = (struct entry_info *)&info->name[info->namelength];
4191 + info->namelength =
4193 + memcpy(info->name, data->name,
4196 + (struct novfs_enumerate_directory_ex_data *)
4197 + & data->name[data->nameLen];
4199 + (int)((char *)&info->
4204 + ("directory_enumerate_ex3: info=0x%p\n",
4206 + novfs_dump(replylen, info);
4209 + (struct novfs_entry_info *) & info->
4210 + name[info->namelength];
4212 } while (--reply->enumCount);
4214 @@ -778,8 +767,9 @@ static int directory_enumerate_ex(HANDLE
4218 -int Novfs_Get_Directory_ListEx(unsigned char * Path, HANDLE * EnumHandle, int *Count,
4219 - struct entry_info **Info, struct schandle *SessionId)
4220 +int novfs_get_dir_listex(unsigned char * Path, void ** EnumHandle, int *Count,
4221 + struct novfs_entry_info **Info,
4222 + struct novfs_schandle SessionId)
4224 int retCode = -ENOENT;
4226 @@ -788,15 +778,20 @@ int Novfs_Get_Directory_ListEx(unsigned
4230 - if ((HANDLE) - 1 == *EnumHandle) {
4231 + if ((void *) - 1 == *EnumHandle) {
4235 - if (0 == *EnumHandle)
4236 - retCode = begin_directory_enumerate(Path, strlen(Path), EnumHandle, SessionId);
4237 + if (0 == *EnumHandle) {
4239 + begin_directory_enumerate(Path, strlen(Path), EnumHandle,
4244 - retCode = directory_enumerate_ex(EnumHandle, SessionId, Count, Info, INTERRUPTIBLE);
4246 + directory_enumerate_ex(EnumHandle, SessionId, Count, Info,
4249 end_directory_enumerate(*EnumHandle, SessionId);
4250 if (-1 == retCode) {
4251 @@ -808,11 +803,12 @@ int Novfs_Get_Directory_ListEx(unsigned
4255 -int Novfs_Open_File(unsigned char * Path, int Flags, struct entry_info *Info, HANDLE * Handle,
4256 - session_t SessionId)
4257 +int novfs_open_file(unsigned char * Path, int Flags, struct novfs_entry_info * Info,
4259 + struct novfs_schandle SessionId)
4261 - POPEN_FILE_REQUEST cmd;
4262 - POPEN_FILE_REPLY reply;
4263 + struct novfs_open_file_request *cmd;
4264 + struct novfs_open_file_reply *reply;
4265 unsigned long replylen = 0;
4266 int retCode, cmdlen, pathlen;
4268 @@ -825,8 +821,8 @@ int Novfs_Open_File(unsigned char * Path
4272 - cmdlen = offsetof(OPEN_FILE_REQUEST, path) + pathlen;
4273 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
4274 + cmdlen = offsetof(struct novfs_open_file_request, path) + pathlen;
4275 + cmd = kmalloc(cmdlen, GFP_KERNEL);
4277 cmd->Command.CommandType = VFS_COMMAND_OPEN_FILE;
4278 cmd->Command.SequenceNumber = 0;
4279 @@ -903,10 +899,10 @@ int Novfs_Open_File(unsigned char * Path
4283 -int Novfs_Create(unsigned char * Path, int DirectoryFlag, session_t SessionId)
4284 +int novfs_create(unsigned char * Path, int DirectoryFlag, struct novfs_schandle SessionId)
4286 - PCREATE_FILE_REQUEST cmd;
4287 - PCREATE_FILE_REPLY reply;
4288 + struct novfs_create_file_request *cmd;
4289 + struct novfs_create_file_reply *reply;
4290 unsigned long replylen = 0;
4291 int retCode, cmdlen, pathlen;
4293 @@ -917,8 +913,8 @@ int Novfs_Create(unsigned char * Path, i
4297 - cmdlen = offsetof(CREATE_FILE_REQUEST, path) + pathlen;
4298 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
4299 + cmdlen = offsetof(struct novfs_create_file_request, path) + pathlen;
4300 + cmd = kmalloc(cmdlen, GFP_KERNEL);
4302 cmd->Command.CommandType = VFS_COMMAND_CREATE_FILE;
4303 if (DirectoryFlag) {
4304 @@ -948,10 +944,10 @@ int Novfs_Create(unsigned char * Path, i
4308 -int Novfs_Close_File(HANDLE Handle, session_t SessionId)
4309 +int novfs_close_file(void *Handle, struct novfs_schandle SessionId)
4311 - CLOSE_FILE_REQUEST cmd;
4312 - PCLOSE_FILE_REPLY reply;
4313 + struct novfs_close_file_request cmd;
4314 + struct novfs_close_file_reply *reply;
4315 unsigned long replylen = 0;
4318 @@ -974,11 +970,11 @@ int Novfs_Close_File(HANDLE Handle, sess
4322 -int Novfs_Read_File(HANDLE Handle, unsigned char * Buffer, size_t * Bytes,
4323 - loff_t * Offset, session_t SessionId)
4324 +int novfs_read_file(void *Handle, unsigned char * Buffer, size_t * Bytes,
4325 + loff_t * Offset, struct novfs_schandle SessionId)
4327 - READ_FILE_REQUEST cmd;
4328 - PREAD_FILE_REPLY reply = NULL;
4329 + struct novfs_read_file_request cmd;
4330 + struct novfs_read_file_reply * reply = NULL;
4331 unsigned long replylen = 0;
4334 @@ -986,8 +982,10 @@ int Novfs_Read_File(HANDLE Handle, unsig
4338 - if ((offsetof(READ_FILE_REPLY, data) + len) > MaxIoSize) {
4339 - len = MaxIoSize - offsetof(READ_FILE_REPLY, data);
4340 + if (offsetof(struct novfs_read_file_reply, data) + len
4341 + > novfs_max_iosize) {
4342 + len = novfs_max_iosize - offsetof(struct
4343 + novfs_read_file_reply, data);
4344 len = (len / PAGE_SIZE) * PAGE_SIZE;
4347 @@ -999,9 +997,12 @@ int Novfs_Read_File(HANDLE Handle, unsig
4349 cmd.offset = *Offset;
4351 - retCode = Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
4353 + Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
4354 + &replylen, INTERRUPTIBLE);
4356 - DbgPrint("Novfs_Read_File: Queue_Daemon_Command 0x%x replylen=%d\n", retCode, replylen);
4357 + DbgPrint("novfs_Read_File: Queue_Daemon_Command 0x%x replylen=%d\n",
4358 + retCode, replylen);
4361 if (reply->Reply.ErrorCode) {
4362 @@ -1011,9 +1012,12 @@ int Novfs_Read_File(HANDLE Handle, unsig
4366 - replylen -= offsetof(READ_FILE_REPLY, data);
4367 + replylen -= offsetof(struct
4368 + novfs_read_file_reply, data);
4371 - replylen -= copy_to_user(Buffer, reply->data, replylen);
4373 + copy_to_user(Buffer, reply->data, replylen);
4377 @@ -1023,17 +1027,18 @@ int Novfs_Read_File(HANDLE Handle, unsig
4381 - DbgPrint("Novfs_Read_File *Bytes=0x%x retCode=0x%x\n", *Bytes, retCode);
4382 + DbgPrint("novfs_Read_File *Bytes=0x%x retCode=0x%x\n", *Bytes, retCode);
4387 -int Novfs_Read_Pages(HANDLE Handle, struct data_list *DList, int DList_Cnt,
4388 - size_t * Bytes, loff_t * Offset, session_t SessionId)
4389 +int novfs_read_pages(void *Handle, struct novfs_data_list *DList,
4390 + int DList_Cnt, size_t * Bytes, loff_t * Offset,
4391 + struct novfs_schandle SessionId)
4393 - READ_FILE_REQUEST cmd;
4394 - PREAD_FILE_REPLY reply = NULL;
4395 - READ_FILE_REPLY lreply;
4396 + struct novfs_read_file_request cmd;
4397 + struct novfs_read_file_reply * reply = NULL;
4398 + struct novfs_read_file_reply lreply;
4399 unsigned long replylen = 0;
4402 @@ -1042,7 +1047,7 @@ int Novfs_Read_Pages(HANDLE Handle, stru
4406 - ("Novfs_Read_Pages: Handle=0x%p Dlst=0x%p Dlcnt=%d Bytes=%d Offset=%lld SessionId=0x%p:%p\n",
4407 + ("novfs_Read_Pages: Handle=0x%p Dlst=0x%p Dlcnt=%d Bytes=%d Offset=%lld SessionId=0x%p:%p\n",
4408 Handle, DList, DList_Cnt, len, *Offset, SessionId.hTypeId,
4411 @@ -1059,14 +1064,14 @@ int Novfs_Read_Pages(HANDLE Handle, stru
4413 DList[0].page = NULL;
4414 DList[0].offset = &lreply;
4415 - DList[0].len = offsetof(READ_FILE_REPLY, data);
4416 + DList[0].len = offsetof(struct novfs_read_file_reply, data);
4417 DList[0].rwflag = DLWRITE;
4420 Queue_Daemon_Command(&cmd, sizeof(cmd), DList, DList_Cnt,
4421 (void *)&reply, &replylen, INTERRUPTIBLE);
4423 - DbgPrint("Novfs_Read_Pages: Queue_Daemon_Command 0x%x\n", retCode);
4424 + DbgPrint("novfs_Read_Pages: Queue_Daemon_Command 0x%x\n", retCode);
4428 @@ -1080,44 +1085,45 @@ int Novfs_Read_Pages(HANDLE Handle, stru
4432 - *Bytes = replylen - offsetof(READ_FILE_REPLY, data);
4433 + *Bytes = replylen - offsetof(struct
4434 + novfs_read_file_reply, data);
4441 - DbgPrint("Novfs_Read_Pages: retCode=0x%x\n", retCode);
4442 + DbgPrint("novfs_Read_Pages: retCode=0x%x\n", retCode);
4447 -int Novfs_Write_File(HANDLE Handle, unsigned char * Buffer, size_t * Bytes,
4448 - loff_t * Offset, session_t SessionId)
4449 +int novfs_write_file(void *Handle, unsigned char * Buffer, size_t * Bytes,
4450 + loff_t * Offset, struct novfs_schandle SessionId)
4452 - WRITE_FILE_REQUEST cmd;
4453 - PWRITE_FILE_REPLY reply = NULL;
4454 + struct novfs_write_file_request cmd;
4455 + struct novfs_write_file_reply *reply = NULL;
4456 unsigned long replylen = 0;
4457 int retCode = 0, cmdlen;
4461 struct page **pages;
4462 - struct data_list *dlist;
4463 + struct novfs_data_list *dlist;
4464 int res = 0, npage, i;
4465 - WRITE_FILE_REPLY lreply;
4466 + struct novfs_write_file_reply lreply;
4469 - cmdlen = offsetof(WRITE_FILE_REQUEST, data);
4470 + cmdlen = offsetof(struct novfs_write_file_request, data);
4474 memset(&lreply, 0, sizeof(lreply));
4476 - DbgPrint("Novfs_Write_File cmdlen=%ld len=%ld\n", cmdlen, len);
4477 + DbgPrint("novfs_Write_File cmdlen=%ld len=%ld\n", cmdlen, len);
4479 - if ((cmdlen + len) > MaxIoSize) {
4480 - len = MaxIoSize - cmdlen;
4481 + if ((cmdlen + len) > novfs_max_iosize) {
4482 + len = novfs_max_iosize - cmdlen;
4483 len = (len / PAGE_SIZE) * PAGE_SIZE;
4485 cmd.Command.CommandType = VFS_COMMAND_WRITE_FILE;
4486 @@ -1127,18 +1133,18 @@ int Novfs_Write_File(HANDLE Handle, unsi
4488 cmd.offset = *Offset;
4490 - DbgPrint("Novfs_Write_File cmdlen=%ld len=%ld\n", cmdlen, len);
4491 + DbgPrint("novfs_Write_File cmdlen=%ld len=%ld\n", cmdlen, len);
4494 (((unsigned long)Buffer & ~PAGE_MASK) + len +
4495 (PAGE_SIZE - 1)) >> PAGE_SHIFT;
4497 - dlist = Novfs_Malloc(sizeof(struct data_list) * (npage + 1), GFP_KERNEL);
4498 + dlist = kmalloc(sizeof(struct novfs_data_list) * (npage + 1), GFP_KERNEL);
4499 if (NULL == dlist) {
4503 - pages = Novfs_Malloc(sizeof(struct page *) * npage, GFP_KERNEL);
4504 + pages = kmalloc(sizeof(struct page *) * npage, GFP_KERNEL);
4506 if (NULL == pages) {
4508 @@ -1153,7 +1159,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4510 up_read(¤t->mm->mmap_sem);
4512 - DbgPrint("Novfs_Write_File res=%d\n", res);
4513 + DbgPrint("novfs_Write_File res=%d\n", res);
4516 boff = (unsigned long)Buffer & ~PAGE_MASK;
4517 @@ -1168,12 +1174,12 @@ int Novfs_Write_File(HANDLE Handle, unsi
4521 - DbgPrint("Novfs_Write_File0: page=0x%p offset=0x%p len=%d\n",
4522 + DbgPrint("novfs_Write_File0: page=0x%p offset=0x%p len=%d\n",
4523 dlist[0].page, dlist[0].offset, dlist[0].len);
4525 boff = dlist[0].len;
4527 - DbgPrint("Novfs_Write_File len=%d boff=%d\n", len, boff);
4528 + DbgPrint("novfs_Write_File len=%d boff=%d\n", len, boff);
4530 for (i = 1; (i < res) && (boff < len); i++) {
4531 flush_dcache_page(pages[i]);
4532 @@ -1188,7 +1194,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4534 boff += dlist[i].len;
4536 - ("Novfs_Write_File%d: page=0x%p offset=0x%p len=%d\n",
4537 + ("novfs_Write_File%d: page=0x%p offset=0x%p len=%d\n",
4538 i, dlist[i].page, dlist[i].offset, dlist[i].len);
4541 @@ -1198,7 +1204,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4542 dlist[i].rwflag = DLWRITE;
4545 - DbgPrint("Novfs_Write_File Buffer=0x%p boff=0x%x len=%d\n",
4546 + DbgPrint("novfs_Write_File Buffer=0x%p boff=0x%x len=%d\n",
4550 @@ -1211,7 +1217,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4554 - kdata = Novfs_Malloc(len, GFP_KERNEL);
4555 + kdata = kmalloc(len, GFP_KERNEL);
4557 len -= copy_from_user(kdata, Buffer, len);
4558 dlist[0].page = NULL;
4559 @@ -1233,7 +1239,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4563 - DbgPrint("Novfs_Write_File retCode=0x%x reply=0x%p\n", retCode, reply);
4564 + DbgPrint("novfs_Write_File retCode=0x%x reply=0x%p\n", retCode, reply);
4567 switch (lreply.Reply.ErrorCode) {
4568 @@ -1267,7 +1273,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4572 - DbgPrint("Novfs_Write_File *Bytes=0x%x retCode=0x%x\n", *Bytes,
4573 + DbgPrint("novfs_Write_File *Bytes=0x%x retCode=0x%x\n", *Bytes,
4577 @@ -1276,7 +1282,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4579 * Arguments: HANDLE Handle - novfsd file handle
4580 * struct page *Page - Page to be written out
4581 - * session_t SessionId - novfsd session handle
4582 + * struct novfs_schandle SessionId - novfsd session handle
4584 * Returns: 0 - Success
4585 * -ENOSPC - Out of space on server
4586 @@ -1285,17 +1291,17 @@ int Novfs_Write_File(HANDLE Handle, unsi
4588 * Abstract: Write page to file.
4590 -int Novfs_Write_Page(HANDLE Handle, struct page *Page, session_t SessionId)
4591 +int novfs_write_page(void *Handle, struct page *Page, struct novfs_schandle SessionId)
4593 - WRITE_FILE_REQUEST cmd;
4594 - WRITE_FILE_REPLY lreply;
4595 - PWRITE_FILE_REPLY reply = NULL;
4596 + struct novfs_write_file_request cmd;
4597 + struct novfs_write_file_reply lreply;
4598 + struct novfs_write_file_reply *reply = NULL;
4599 unsigned long replylen = 0;
4600 int retCode = 0, cmdlen;
4601 - struct data_list dlst[2];
4602 + struct novfs_data_list dlst[2];
4605 - ("Novfs_Write_Page: Handle=0x%p Page=0x%p Index=%lu SessionId=0x%llx\n",
4606 + ("novfs_Write_Page: Handle=0x%p Page=0x%p Index=%lu SessionId=0x%llx\n",
4607 Handle, Page, Page->index, SessionId);
4609 dlst[0].page = NULL;
4610 @@ -1308,7 +1314,7 @@ int Novfs_Write_Page(HANDLE Handle, stru
4611 dlst[1].len = PAGE_CACHE_SIZE;
4612 dlst[1].rwflag = DLREAD;
4614 - cmdlen = offsetof(WRITE_FILE_REQUEST, data);
4615 + cmdlen = offsetof(struct novfs_write_file_request, data);
4617 cmd.Command.CommandType = VFS_COMMAND_WRITE_FILE;
4618 cmd.Command.SequenceNumber = 0;
4619 @@ -1348,23 +1354,23 @@ int Novfs_Write_Page(HANDLE Handle, stru
4623 - DbgPrint("Novfs_Write_Page retCode=0x%x\n", retCode);
4624 + DbgPrint("novfs_Write_Page retCode=0x%x\n", retCode);
4629 -int Novfs_Write_Pages(HANDLE Handle, struct data_list *DList, int DList_Cnt,
4630 - size_t Bytes, loff_t Offset, session_t SessionId)
4631 +int novfs_write_pages(void *Handle, struct novfs_data_list *DList, int DList_Cnt,
4632 + size_t Bytes, loff_t Offset, struct novfs_schandle SessionId)
4634 - WRITE_FILE_REQUEST cmd;
4635 - WRITE_FILE_REPLY lreply;
4636 - PWRITE_FILE_REPLY reply = NULL;
4637 + struct novfs_write_file_request cmd;
4638 + struct novfs_write_file_reply lreply;
4639 + struct novfs_write_file_reply *reply = NULL;
4640 unsigned long replylen = 0;
4641 int retCode = 0, cmdlen;
4645 - ("Novfs_Write_Pages: Handle=0x%p Dlst=0x%p Dlcnt=%d Bytes=%d Offset=%lld SessionId=0x%llx\n",
4646 + ("novfs_Write_Pages: Handle=0x%p Dlst=0x%p Dlcnt=%d Bytes=%d Offset=%lld SessionId=0x%llx\n",
4647 Handle, DList, DList_Cnt, Bytes, Offset, SessionId);
4649 DList[0].page = NULL;
4650 @@ -1373,7 +1379,7 @@ int Novfs_Write_Pages(HANDLE Handle, str
4651 DList[0].rwflag = DLWRITE;
4654 - cmdlen = offsetof(WRITE_FILE_REQUEST, data);
4655 + cmdlen = offsetof(struct novfs_write_file_request, data);
4658 cmd.Command.CommandType = VFS_COMMAND_WRITE_FILE;
4659 @@ -1414,17 +1420,17 @@ int Novfs_Write_Pages(HANDLE Handle, str
4663 - DbgPrint("Novfs_Write_Pages retCode=0x%x\n", retCode);
4664 + DbgPrint("novfs_Write_Pages retCode=0x%x\n", retCode);
4669 -int Novfs_Read_Stream(HANDLE ConnHandle, unsigned char * Handle, unsigned char * Buffer,
4670 +int novfs_read_stream(void *ConnHandle, unsigned char * Handle, u_char * Buffer,
4671 size_t * Bytes, loff_t * Offset, int User,
4672 - session_t SessionId)
4673 + struct novfs_schandle SessionId)
4675 - READ_STREAM_REQUEST cmd;
4676 - PREAD_STREAM_REPLY reply = NULL;
4677 + struct novfs_read_stream_request cmd;
4678 + struct novfs_read_stream_reply *reply = NULL;
4679 unsigned long replylen = 0;
4682 @@ -1432,8 +1438,10 @@ int Novfs_Read_Stream(HANDLE ConnHandle,
4686 - if ((offsetof(READ_FILE_REPLY, data) + len) > MaxIoSize) {
4687 - len = MaxIoSize - offsetof(READ_FILE_REPLY, data);
4688 + if (offsetof(struct novfs_read_file_reply, data) + len
4689 + > novfs_max_iosize) {
4690 + len = novfs_max_iosize - offsetof(struct
4691 + novfs_read_file_reply, data);
4692 len = (len / PAGE_SIZE) * PAGE_SIZE;
4695 @@ -1446,60 +1454,70 @@ int Novfs_Read_Stream(HANDLE ConnHandle,
4697 cmd.offset = *Offset;
4699 - retCode = Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
4701 + Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
4702 + &replylen, INTERRUPTIBLE);
4704 - DbgPrint("Novfs_Read_Stream: Queue_Daemon_Command 0x%x replylen=%d\n", retCode, replylen);
4705 + DbgPrint("novfs_Read_Stream: Queue_Daemon_Command 0x%x replylen=%d\n",
4706 + retCode, replylen);
4710 if (reply->Reply.ErrorCode) {
4713 - replylen -= offsetof(READ_STREAM_REPLY, data);
4714 + replylen -= offsetof(struct
4715 + novfs_read_stream_reply, data);
4718 - replylen -= copy_to_user(Buffer, reply->data, replylen);
4722 + copy_to_user(Buffer, reply->data,
4725 memcpy(Buffer, reply->data, replylen);
4734 - DbgPrint("Novfs_Read_Stream *Bytes=0x%x retCode=0x%x\n", *Bytes, retCode);
4735 + DbgPrint("novfs_Read_Stream *Bytes=0x%x retCode=0x%x\n", *Bytes,
4741 -int Novfs_Write_Stream(HANDLE ConnHandle, unsigned char * Handle, unsigned char * Buffer,
4742 - size_t * Bytes, loff_t * Offset, session_t SessionId)
4743 +int novfs_write_stream(void *ConnHandle, unsigned char * Handle, u_char * Buffer,
4744 + size_t * Bytes, loff_t * Offset, struct novfs_schandle SessionId)
4746 - PWRITE_STREAM_REQUEST cmd;
4747 - PWRITE_STREAM_REPLY reply = NULL;
4748 + struct novfs_write_stream_request * cmd;
4749 + struct novfs_write_stream_reply * reply = NULL;
4750 unsigned long replylen = 0;
4751 int retCode = 0, cmdlen;
4755 - cmdlen = len + offsetof(WRITE_STREAM_REQUEST, data);
4756 + cmdlen = len + offsetof(struct novfs_write_stream_request, data);
4759 - if (cmdlen > MaxIoSize) {
4760 - cmdlen = MaxIoSize;
4761 - len = cmdlen - offsetof(WRITE_STREAM_REQUEST, data);
4762 + if (cmdlen > novfs_max_iosize) {
4763 + cmdlen = novfs_max_iosize;
4764 + len = cmdlen - offsetof(struct
4765 + novfs_write_stream_request, data);
4768 - DbgPrint("Novfs_Write_Stream cmdlen=%d len=%d\n", cmdlen, len);
4769 + DbgPrint("novfs_Write_Stream cmdlen=%d len=%d\n", cmdlen, len);
4771 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
4772 + cmd = kmalloc(cmdlen, GFP_KERNEL);
4775 if (Buffer && len) {
4776 len -= copy_from_user(cmd->data, Buffer, len);
4779 - DbgPrint("Novfs_Write_Stream len=%d\n", len);
4780 + DbgPrint("novfs_Write_Stream len=%d\n", len);
4782 cmd->Command.CommandType = VFS_COMMAND_WRITE_STREAM;
4783 cmd->Command.SequenceNumber = 0;
4784 @@ -1532,23 +1550,23 @@ int Novfs_Write_Stream(HANDLE ConnHandle
4788 - ("Novfs_Write_Stream reply->bytesWritten=0x%lx\n",
4789 + ("novfs_Write_Stream reply->bytesWritten=0x%lx\n",
4790 reply->bytesWritten);
4791 *Bytes = reply->bytesWritten;
4796 - DbgPrint("Novfs_Write_Stream *Bytes=0x%x retCode=0x%x\n", *Bytes,
4797 + DbgPrint("novfs_Write_Stream *Bytes=0x%x retCode=0x%x\n", *Bytes,
4803 -int Novfs_Close_Stream(HANDLE ConnHandle, unsigned char * Handle, session_t SessionId)
4804 +int novfs_close_stream(void *ConnHandle, unsigned char * Handle, struct novfs_schandle SessionId)
4806 - CLOSE_STREAM_REQUEST cmd;
4807 - PCLOSE_STREAM_REPLY reply;
4808 + struct novfs_close_stream_request cmd;
4809 + struct novfs_close_stream_reply *reply;
4810 unsigned long replylen = 0;
4813 @@ -1572,10 +1590,10 @@ int Novfs_Close_Stream(HANDLE ConnHandle
4817 -int Novfs_Delete(unsigned char * Path, int DirectoryFlag, session_t SessionId)
4818 +int novfs_delete(unsigned char * Path, int DirectoryFlag, struct novfs_schandle SessionId)
4820 - PDELETE_FILE_REQUEST cmd;
4821 - PDELETE_FILE_REPLY reply;
4822 + struct novfs_delete_file_request *cmd;
4823 + struct novfs_delete_file_reply *reply;
4824 unsigned long replylen = 0;
4825 int retCode, cmdlen, pathlen;
4827 @@ -1586,8 +1604,8 @@ int Novfs_Delete(unsigned char * Path, i
4831 - cmdlen = offsetof(DELETE_FILE_REQUEST, path) + pathlen;
4832 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
4833 + cmdlen = offsetof(struct novfs_delete_file_request, path) + pathlen;
4834 + cmd = kmalloc(cmdlen, GFP_KERNEL);
4836 cmd->Command.CommandType = VFS_COMMAND_DELETE_FILE;
4837 cmd->Command.SequenceNumber = 0;
4838 @@ -1618,10 +1636,11 @@ int Novfs_Delete(unsigned char * Path, i
4842 -int Novfs_Truncate_File(unsigned char * Path, int PathLen, session_t SessionId)
4843 +int novfs_trunc(unsigned char * Path, int PathLen,
4844 + struct novfs_schandle SessionId)
4846 - PTRUNCATE_FILE_REQUEST cmd;
4847 - PTRUNCATE_FILE_REPLY reply;
4848 + struct novfs_truncate_file_request *cmd;
4849 + struct novfs_truncate_file_reply *reply = NULL;
4850 unsigned long replylen = 0;
4851 int retCode, cmdlen;
4853 @@ -1629,8 +1648,9 @@ int Novfs_Truncate_File(unsigned char *
4854 if ('.' == Path[PathLen - 1])
4857 - cmdlen = offsetof(TRUNCATE_FILE_REQUEST, path) + PathLen;
4858 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
4859 + cmdlen = offsetof(struct novfs_truncate_file_request, path)
4861 + cmd = kmalloc(cmdlen, GFP_KERNEL);
4863 cmd->Command.CommandType = VFS_COMMAND_TRUNCATE_FILE;
4864 cmd->Command.SequenceNumber = 0;
4865 @@ -1655,17 +1675,18 @@ int Novfs_Truncate_File(unsigned char *
4869 -int Novfs_Truncate_File_Ex(HANDLE Handle, loff_t Offset, session_t SessionId)
4870 +int novfs_trunc_ex(void *Handle, loff_t Offset,
4871 + struct novfs_schandle SessionId)
4873 - WRITE_FILE_REQUEST cmd;
4874 - PWRITE_FILE_REPLY reply = NULL;
4875 + struct novfs_write_file_request cmd;
4876 + struct novfs_write_file_reply *reply = NULL;
4877 unsigned long replylen = 0;
4878 int retCode = 0, cmdlen;
4880 - DbgPrint("Novfs_Truncate_File_Ex Handle=0x%p Offset=%lld\n", Handle,
4881 + DbgPrint("novfs_Truncate_File_Ex Handle=0x%p Offset=%lld\n", Handle,
4884 - cmdlen = offsetof(WRITE_FILE_REQUEST, data);
4885 + cmdlen = offsetof(struct novfs_write_file_request, data);
4887 cmd.Command.CommandType = VFS_COMMAND_WRITE_FILE;
4888 cmd.Command.SequenceNumber = 0;
4889 @@ -1678,7 +1699,7 @@ int Novfs_Truncate_File_Ex(HANDLE Handle
4890 Queue_Daemon_Command(&cmd, cmdlen, NULL, 0, (void *)&reply,
4891 &replylen, INTERRUPTIBLE);
4893 - DbgPrint("Novfs_Truncate_File_Ex retCode=0x%x reply=0x%p\n", retCode,
4894 + DbgPrint("novfs_Truncate_File_Ex retCode=0x%x reply=0x%p\n", retCode,
4898 @@ -1709,20 +1730,21 @@ int Novfs_Truncate_File_Ex(HANDLE Handle
4902 - DbgPrint("Novfs_Truncate_File_Ex retCode=%d\n", retCode);
4903 + DbgPrint("novfs_Truncate_File_Ex retCode=%d\n", retCode);
4908 -int Novfs_Rename_File(int DirectoryFlag, unsigned char * OldName, int OldLen,
4909 - unsigned char * NewName, int NewLen, session_t SessionId)
4910 +int novfs_rename_file(int DirectoryFlag, unsigned char * OldName, int OldLen,
4911 + unsigned char * NewName, int NewLen,
4912 + struct novfs_schandle SessionId)
4914 - RENAME_FILE_REQUEST cmd;
4915 - PRENAME_FILE_REPLY reply;
4916 + struct novfs_rename_file_request cmd;
4917 + struct novfs_rename_file_reply *reply;
4918 unsigned long replylen = 0;
4921 - DbgPrint("Novfs_Rename_File:\n"
4922 + DbgPrint("novfs_Rename_File:\n"
4923 " DirectoryFlag: %d\n"
4926 @@ -1761,10 +1783,11 @@ int Novfs_Rename_File(int DirectoryFlag,
4930 -int Novfs_Set_Attr(unsigned char * Path, struct iattr *Attr, session_t SessionId)
4931 +int novfs_set_attr(unsigned char * Path, struct iattr *Attr,
4932 + struct novfs_schandle SessionId)
4934 - PSET_FILE_INFO_REQUEST cmd;
4935 - PSET_FILE_INFO_REPLY reply;
4936 + struct novfs_set_file_info_request *cmd;
4937 + struct novfs_set_file_info_reply *reply;
4938 unsigned long replylen = 0;
4939 int retCode, cmdlen, pathlen;
4941 @@ -1775,8 +1798,8 @@ int Novfs_Set_Attr(unsigned char * Path,
4945 - cmdlen = offsetof(SET_FILE_INFO_REQUEST, path) + pathlen;
4946 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
4947 + cmdlen = offsetof(struct novfs_set_file_info_request,path) + pathlen;
4948 + cmd = kmalloc(cmdlen, GFP_KERNEL);
4950 cmd->Command.CommandType = VFS_COMMAND_SET_FILE_INFO;
4951 cmd->Command.SequenceNumber = 0;
4952 @@ -1827,16 +1850,17 @@ int Novfs_Set_Attr(unsigned char * Path,
4956 -int Novfs_Get_File_Cache_Flag(unsigned char * Path, session_t SessionId)
4957 +int novfs_get_file_cache_flag(unsigned char * Path,
4958 + struct novfs_schandle SessionId)
4960 - PGET_CACHE_FLAG_REQUEST cmd;
4961 - PGET_CACHE_FLAG_REPLY reply = NULL;
4962 + struct novfs_get_cache_flag *cmd;
4963 + struct novfs_get_cache_flag_reply *reply = NULL;
4964 unsigned long replylen = 0;
4969 - DbgPrint("Novfs_Get_File_Cache_Flag: Path = %s\n", Path);
4970 + DbgPrint("novfs_Get_File_Cache_Flag: Path = %s\n", Path);
4972 if (Path && *Path) {
4973 pathlen = strlen(Path);
4974 @@ -1844,8 +1868,10 @@ int Novfs_Get_File_Cache_Flag(unsigned c
4975 if ('.' == Path[pathlen - 1])
4978 - cmdlen = offsetof(GET_CACHE_FLAG_REQUEST, path) + pathlen;
4979 - cmd = (PGET_CACHE_FLAG_REQUEST) Novfs_Malloc(cmdlen, GFP_KERNEL);
4980 + cmdlen = offsetof(struct novfs_get_cache_flag, path) +
4982 + cmd = (struct novfs_get_cache_flag *)
4983 + kmalloc(cmdlen, GFP_KERNEL);
4985 cmd->Command.CommandType = VFS_COMMAND_GET_CACHE_FLAG;
4986 cmd->Command.SequenceNumber = 0;
4987 @@ -1869,7 +1895,7 @@ int Novfs_Get_File_Cache_Flag(unsigned c
4991 - DbgPrint("Novfs_Get_File_Cache_Flag: return %d\n", retCode);
4992 + DbgPrint("novfs_Get_File_Cache_Flag: return %d\n", retCode);
4996 @@ -1878,33 +1904,26 @@ int Novfs_Get_File_Cache_Flag(unsigned c
4997 * SessionId, file handle, type of lock (read/write or unlock),
4998 * start of lock area, length of lock area
5002 - * negative value on error
5006 * Notes: lock type - fcntl
5008 -int Novfs_Set_File_Lock(session_t SessionId, HANDLE Handle,
5009 +int novfs_set_file_lock(struct novfs_schandle SessionId, void *Handle,
5010 unsigned char fl_type, loff_t fl_start, loff_t fl_len)
5012 - PSET_FILE_LOCK_REQUEST cmd;
5013 - PSET_FILE_LOCK_REPLY reply = NULL;
5014 + struct novfs_set_file_lock_request *cmd;
5015 + struct novfs_set_file_lock_reply *reply = NULL;
5016 unsigned long replylen = 0;
5021 - DbgPrint("Novfs_Set_File_Lock:\n"
5022 + DbgPrint("novfs_Set_File_Lock:\n"
5023 " SessionId: 0x%llx\n", SessionId);
5026 - (PSET_FILE_LOCK_REQUEST) Novfs_Malloc(sizeof(SET_FILE_LOCK_REQUEST),
5028 + (struct novfs_set_file_lock_request *) kmalloc(sizeof(struct novfs_set_file_lock_request), GFP_KERNEL);
5031 - DbgPrint("Novfs_Set_File_Lock 2\n");
5032 + DbgPrint("novfs_Set_File_Lock 2\n");
5034 cmd->Command.CommandType = VFS_COMMAND_SET_FILE_LOCK;
5035 cmd->Command.SequenceNumber = 0;
5036 @@ -1921,32 +1940,32 @@ int Novfs_Set_File_Lock(session_t Sessio
5037 cmd->fl_start = fl_start;
5038 cmd->fl_len = fl_len;
5040 - DbgPrint("Novfs_Set_File_Lock 3\n");
5041 + DbgPrint("novfs_Set_File_Lock 3\n");
5043 - DbgPrint("Novfs_Set_File_Lock: BEGIN dump arguments\n");
5044 - DbgPrint("Novfs_Set_File_Lock: Queue_Daemon_Command %d\n",
5045 + DbgPrint("novfs_Set_File_Lock: BEGIN dump arguments\n");
5046 + DbgPrint("novfs_Set_File_Lock: Queue_Daemon_Command %d\n",
5047 cmd->Command.CommandType);
5048 - DbgPrint("Novfs_Set_File_Lock: cmd->handle = 0x%p\n",
5049 + DbgPrint("novfs_Set_File_Lock: cmd->handle = 0x%p\n",
5051 - DbgPrint("Novfs_Set_File_Lock: cmd->fl_type = %u\n",
5052 + DbgPrint("novfs_Set_File_Lock: cmd->fl_type = %u\n",
5054 - DbgPrint("Novfs_Set_File_Lock: cmd->fl_start = 0x%X\n",
5055 + DbgPrint("novfs_Set_File_Lock: cmd->fl_start = 0x%X\n",
5057 - DbgPrint("Novfs_Set_File_Lock: cmd->fl_len = 0x%X\n",
5058 + DbgPrint("novfs_Set_File_Lock: cmd->fl_len = 0x%X\n",
5061 - ("Novfs_Set_File_Lock: sizeof(SET_FILE_LOCK_REQUEST) = %u\n",
5062 - sizeof(SET_FILE_LOCK_REQUEST));
5063 - DbgPrint("Novfs_Set_File_Lock: END dump arguments\n");
5064 + ("novfs_Set_File_Lock: sizeof(SET_FILE_LOCK_REQUEST) = %u\n",
5065 + sizeof(struct novfs_set_file_lock_request));
5066 + DbgPrint("novfs_Set_File_Lock: END dump arguments\n");
5069 - Queue_Daemon_Command(cmd, sizeof(SET_FILE_LOCK_REQUEST),
5070 + Queue_Daemon_Command(cmd, sizeof(struct novfs_set_file_lock_request),
5071 NULL, 0, (void *)&reply, &replylen,
5073 - DbgPrint("Novfs_Set_File_Lock 4\n");
5074 + DbgPrint("novfs_Set_File_Lock 4\n");
5077 - DbgPrint("Novfs_Set_File_Lock 5, ErrorCode = %X\n",
5078 + DbgPrint("novfs_Set_File_Lock 5, ErrorCode = %X\n",
5079 reply->Reply.ErrorCode);
5081 if (reply->Reply.ErrorCode) {
5082 @@ -1954,11 +1973,10 @@ int Novfs_Set_File_Lock(session_t Sessio
5090 - DbgPrint("Novfs_Set_File_Lock 6\n");
5091 + DbgPrint("novfs_Set_File_Lock 6\n");
5095 --- a/fs/novfs/inode.c
5096 +++ b/fs/novfs/inode.c
5098 /*===[ Include files specific to this module ]============================*/
5101 -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
5102 -#define FSPRIVATE u.generic_ip
5104 -#define FSPRIVATE i_private
5108 -#define FILE_UPDATE_TIMEOUT 2
5112 @@ -54,285 +46,260 @@ struct inode_data {
5113 unsigned long cntDC;
5114 struct list_head DirCache;
5115 struct semaphore DirCacheLock;
5116 - HANDLE FileHandle;
5117 + void * FileHandle;
5119 char Name[1]; /* Needs to be last entry */
5122 -// FIXME these are wrong, but fake the compiler out for now until the proper people can be flogged...
5123 -extern void *Scope_Get_ScopefromName(struct qstr *Name);
5124 -extern void *Scope_Get_ScopefromPath(struct dentry *Dentry);
5126 -/*===[ Function prototypes ]==============================================*/
5127 -int Novfs_Remove_from_Root(char *RemoveName);
5128 -int Novfs_Add_to_Root(char *);
5129 -char *Novfs_dget_path(struct dentry *d, char *path, unsigned int pathlen);
5130 -int verify_dentry(struct dentry *dentry, int Flags);
5131 -int invalidate_dentry(struct dentry *parent);
5132 -struct dentry *Novfs_d_lookup(struct dentry *Parent, struct qstr *Name);
5133 -int Novfs_d_add(struct dentry *p, struct dentry *d, struct inode *i, int add);
5134 -int Novfs_d_strcmp(struct qstr *s1, struct qstr *s2);
5135 -unsigned long Novfs_internal_hash(struct qstr *name);
5136 +#define FILE_UPDATE_TIMEOUT 2
5138 +/*===[ Function prototypes ]=============================================*/
5140 +static unsigned long novfs_internal_hash(struct qstr *name);
5141 +static int novfs_d_add(struct dentry *p, struct dentry *d, struct inode *i, int add);
5143 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
5144 -int Novfs_get_sb(struct file_system_type *Fstype, int Flags,
5145 +static int novfs_get_sb(struct file_system_type *Fstype, int Flags,
5146 const char *Dev_name, void *Data, struct vfsmount *Mnt);
5148 -struct super_block *Novfs_get_sb(struct file_system_type *Fstype, int Flags,
5149 - const char *Dev_name, void *Data);
5152 -int Novfs_fill_super(struct super_block *SB, void *Data, int Silent);
5153 +static void novfs_kill_sb(struct super_block *SB);
5157 * Declared dentry_operations
5159 -int Novfs_d_revalidate(struct dentry *, struct nameidata *);
5160 -int Novfs_d_hash(struct dentry *, struct qstr *);
5161 -int Novfs_d_compare(struct dentry *, struct qstr *, struct qstr *);
5162 -int Novfs_d_delete(struct dentry *dentry);
5163 -void Novfs_d_release(struct dentry *dentry);
5164 -void Novfs_d_iput(struct dentry *dentry, struct inode *inode);
5165 +int novfs_d_revalidate(struct dentry *, struct nameidata *);
5166 +int novfs_d_hash(struct dentry *, struct qstr *);
5167 +int novfs_d_compare(struct dentry *, struct qstr *, struct qstr *);
5168 +int novfs_d_delete(struct dentry *dentry);
5169 +void novfs_d_release(struct dentry *dentry);
5170 +void novfs_d_iput(struct dentry *dentry, struct inode *inode);
5173 * Declared directory operations
5175 -int Novfs_dir_open(struct inode *inode, struct file *file);
5176 -int Novfs_dir_release(struct inode *inode, struct file *file);
5177 -loff_t Novfs_dir_lseek(struct file *file, loff_t offset, int origin);
5178 -ssize_t Novfs_dir_read(struct file *file, char *buf, size_t len, loff_t * off);
5179 +int novfs_dir_open(struct inode *inode, struct file *file);
5180 +int novfs_dir_release(struct inode *inode, struct file *file);
5181 +loff_t novfs_dir_lseek(struct file *file, loff_t offset, int origin);
5182 +ssize_t novfs_dir_read(struct file *file, char *buf, size_t len, loff_t * off);
5183 void addtodentry(struct dentry *Parent, unsigned char *List, int Level);
5184 -int Novfs_filldir(void *data, const char *name, int namelen, loff_t off,
5185 +int novfs_filldir(void *data, const char *name, int namelen, loff_t off,
5186 ino_t ino, unsigned ftype);
5187 -int Novfs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir);
5188 -int Novfs_dir_fsync(struct file *file, struct dentry *dentry, int datasync);
5189 +int novfs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir);
5190 +int novfs_dir_fsync(struct file *file, struct dentry *dentry, int datasync);
5193 * Declared address space operations
5195 -int Novfs_a_writepage(struct page *page, struct writeback_control *wbc);
5196 -int Novfs_a_writepages(struct address_space *mapping,
5197 +int novfs_a_writepage(struct page *page, struct writeback_control *wbc);
5198 +int novfs_a_writepages(struct address_space *mapping,
5199 struct writeback_control *wbc);
5200 -int Novfs_a_prepare_write(struct file *file, struct page *page, unsigned from,
5201 +int novfs_a_prepare_write(struct file *file, struct page *page, unsigned from,
5203 -int Novfs_a_commit_write(struct file *file, struct page *page, unsigned offset,
5204 +int novfs_a_commit_write(struct file *file, struct page *page, unsigned offset,
5206 -int Novfs_a_readpage(struct file *file, struct page *page);
5207 -int Novfs_a_readpages(struct file *file, struct address_space *mapping,
5208 +int novfs_a_readpage(struct file *file, struct page *page);
5209 +int novfs_a_readpages(struct file *file, struct address_space *mapping,
5210 struct list_head *page_lst, unsigned nr_pages);
5211 -ssize_t Novfs_a_direct_IO(int rw, struct kiocb *kiocb, const struct iovec *iov,
5212 +ssize_t novfs_a_direct_IO(int rw, struct kiocb *kiocb, const struct iovec *iov,
5213 loff_t offset, unsigned long nr_segs);
5216 * Declared file_operations
5218 -ssize_t Novfs_f_read(struct file *, char *, size_t, loff_t *);
5219 -ssize_t Novfs_f_write(struct file *, const char *, size_t, loff_t *);
5220 -int Novfs_f_readdir(struct file *, void *, filldir_t);
5221 -int Novfs_f_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
5222 -int Novfs_f_mmap(struct file *file, struct vm_area_struct *vma);
5223 -int Novfs_f_open(struct inode *, struct file *);
5224 -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
5225 -int Novfs_f_flush(struct file *);
5227 -int Novfs_f_flush(struct file *, fl_owner_t);
5229 -int Novfs_f_release(struct inode *, struct file *);
5230 -int Novfs_f_fsync(struct file *, struct dentry *, int datasync);
5231 -int Novfs_f_lock(struct file *, int, struct file_lock *);
5232 +ssize_t novfs_f_read(struct file *, char *, size_t, loff_t *);
5233 +ssize_t novfs_f_write(struct file *, const char *, size_t, loff_t *);
5234 +int novfs_f_readdir(struct file *, void *, filldir_t);
5235 +int novfs_f_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
5236 +int novfs_f_mmap(struct file *file, struct vm_area_struct *vma);
5237 +int novfs_f_open(struct inode *, struct file *);
5238 +int novfs_f_flush(struct file *, fl_owner_t);
5239 +int novfs_f_release(struct inode *, struct file *);
5240 +int novfs_f_fsync(struct file *, struct dentry *, int datasync);
5241 +int novfs_f_lock(struct file *, int, struct file_lock *);
5244 * Declared inode_operations
5246 -int Novfs_i_create(struct inode *, struct dentry *, int, struct nameidata *);
5247 -struct dentry *Novfs_i_lookup(struct inode *, struct dentry *,
5248 +int novfs_i_create(struct inode *, struct dentry *, int, struct nameidata *);
5249 +struct dentry *novfs_i_lookup(struct inode *, struct dentry *,
5250 struct nameidata *);
5251 -int Novfs_i_mkdir(struct inode *, struct dentry *, int);
5252 -int Novfs_i_unlink(struct inode *dir, struct dentry *dentry);
5253 -int Novfs_i_rmdir(struct inode *, struct dentry *);
5254 -int Novfs_i_mknod(struct inode *, struct dentry *, int, dev_t);
5255 -int Novfs_i_rename(struct inode *, struct dentry *, struct inode *,
5256 +int novfs_i_mkdir(struct inode *, struct dentry *, int);
5257 +int novfs_i_unlink(struct inode *dir, struct dentry *dentry);
5258 +int novfs_i_rmdir(struct inode *, struct dentry *);
5259 +int novfs_i_mknod(struct inode *, struct dentry *, int, dev_t);
5260 +int novfs_i_rename(struct inode *, struct dentry *, struct inode *,
5262 -int Novfs_i_permission(struct inode *inode, int mask);
5263 -int Novfs_i_setattr(struct dentry *, struct iattr *);
5264 -int Novfs_i_getattr(struct vfsmount *mnt, struct dentry *, struct kstat *);
5265 -int Novfs_i_revalidate(struct dentry *dentry);
5266 +int novfs_i_setattr(struct dentry *, struct iattr *);
5267 +int novfs_i_getattr(struct vfsmount *mnt, struct dentry *, struct kstat *);
5268 +int novfs_i_revalidate(struct dentry *dentry);
5271 * Extended attributes operations
5274 -int Novfs_i_getxattr(struct dentry *dentry, const char *name, void *buffer,
5275 +int novfs_i_getxattr(struct dentry *dentry, const char *name, void *buffer,
5277 -int Novfs_i_setxattr(struct dentry *dentry, const char *name, const void *value,
5278 +int novfs_i_setxattr(struct dentry *dentry, const char *name, const void *value,
5279 size_t value_size, int flags);
5280 -int Novfs_i_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);
5281 +int novfs_i_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);
5283 -void update_inode(struct inode *Inode, struct entry_info *Info);
5284 +void update_inode(struct inode *Inode, struct novfs_entry_info *Info);
5287 * Declared super_operations
5289 -void Novfs_read_inode(struct inode *inode);
5290 -void Novfs_write_inode(struct inode *inode);
5291 -int Novfs_notify_change(struct dentry *dentry, struct iattr *attr);
5292 -void Novfs_clear_inode(struct inode *inode);
5293 -int Novfs_show_options(struct seq_file *s, struct vfsmount *m);
5295 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
5296 -int Novfs_statfs(struct dentry *de, struct kstatfs *buf);
5298 -int Novfs_statfs(struct super_block *sb, struct kstatfs *buf);
5300 +void novfs_read_inode(struct inode *inode);
5301 +void novfs_write_inode(struct inode *inode);
5302 +int novfs_notify_change(struct dentry *dentry, struct iattr *attr);
5303 +void novfs_clear_inode(struct inode *inode);
5304 +int novfs_show_options(struct seq_file *s, struct vfsmount *m);
5306 +int novfs_statfs(struct dentry *de, struct kstatfs *buf);
5309 * Declared control interface functions
5312 -Novfs_Control_read(struct file *file, char *buf, size_t nbytes, loff_t * ppos);
5313 +novfs_control_Read(struct file *file, char *buf, size_t nbytes, loff_t * ppos);
5316 -Novfs_Control_write(struct file *file, const char *buf, size_t nbytes,
5317 +novfs_control_write(struct file *file, const char *buf, size_t nbytes,
5320 -int Novfs_Control_ioctl(struct inode *inode, struct file *file,
5321 +int novfs_control_ioctl(struct inode *inode, struct file *file,
5322 unsigned int cmd, unsigned long arg);
5324 int __init init_novfs(void);
5325 void __exit exit_novfs(void);
5327 -int Novfs_lock_inode_cache(struct inode *i);
5328 -void Novfs_unlock_inode_cache(struct inode *i);
5329 -int Novfs_enumerate_inode_cache(struct inode *i, struct list_head **iteration,
5330 - ino_t * ino, struct entry_info *info);
5331 -int Novfs_get_entry(struct inode *i, struct qstr *name, ino_t * ino,
5332 - struct entry_info *info);
5333 -int Novfs_get_entry_by_pos(struct inode *i, loff_t pos, ino_t * ino,
5334 - struct entry_info *info);
5335 -int Novfs_get_entry_time(struct inode *i, struct qstr *name, ino_t * ino,
5336 - struct entry_info *info, u64 * EntryTime);
5337 -int Novfs_get_remove_entry(struct inode *i, ino_t * ino, struct entry_info *info);
5338 -void Novfs_invalidate_inode_cache(struct inode *i);
5339 -static struct dir_cache *Novfs_lookup_inode_cache(struct inode *i, struct qstr *name, ino_t ino);
5340 -int Novfs_lookup_validate(struct inode *i, struct qstr *name, ino_t ino);
5341 -int Novfs_add_inode_entry(struct inode *i, struct qstr *name, ino_t ino,
5342 - struct entry_info *info);
5343 -int Novfs_update_entry(struct inode *i, struct qstr *name, ino_t ino,
5344 - struct entry_info *info);
5345 -void Novfs_remove_inode_entry(struct inode *i, struct qstr *name, ino_t ino);
5346 -void Novfs_free_invalid_entries(struct inode *i);
5347 -void Novfs_free_inode_cache(struct inode *i);
5348 +int novfs_lock_inode_cache(struct inode *i);
5349 +void novfs_unlock_inode_cache(struct inode *i);
5350 +int novfs_enumerate_inode_cache(struct inode *i, struct list_head **iteration,
5351 + ino_t * ino, struct novfs_entry_info *info);
5352 +int novfs_get_entry(struct inode *i, struct qstr *name, ino_t * ino,
5353 + struct novfs_entry_info *info);
5354 +int novfs_get_entry_by_pos(struct inode *i, loff_t pos, ino_t * ino,
5355 + struct novfs_entry_info *info);
5356 +int novfs_get_entry_time(struct inode *i, struct qstr *name, ino_t * ino,
5357 + struct novfs_entry_info *info, u64 * EntryTime);
5358 +int novfs_get_remove_entry(struct inode *i, ino_t * ino, struct novfs_entry_info *info);
5359 +void novfs_invalidate_inode_cache(struct inode *i);
5360 +struct novfs_dir_cache *novfs_lookup_inode_cache(struct inode *i, struct qstr *name,
5362 +int novfs_lookup_validate(struct inode *i, struct qstr *name, ino_t ino);
5363 +int novfs_add_inode_entry(struct inode *i, struct qstr *name, ino_t ino,
5364 + struct novfs_entry_info *info);
5365 +int novfs_update_entry(struct inode *i, struct qstr *name, ino_t ino,
5366 + struct novfs_entry_info *info);
5367 +void novfs_remove_inode_entry(struct inode *i, struct qstr *name, ino_t ino);
5368 +void novfs_free_invalid_entries(struct inode *i);
5369 +void novfs_free_inode_cache(struct inode *i);
5371 /*===[ Global variables ]=================================================*/
5372 -struct dentry_operations Novfs_dentry_operations = {
5373 - .d_revalidate = Novfs_d_revalidate,
5374 - .d_hash = Novfs_d_hash,
5375 - .d_compare = Novfs_d_compare,
5376 - //.d_delete = Novfs_d_delete,
5377 - .d_release = Novfs_d_release,
5378 - .d_iput = Novfs_d_iput,
5379 +struct dentry_operations novfs_dentry_operations = {
5380 + .d_revalidate = novfs_d_revalidate,
5381 + .d_hash = novfs_d_hash,
5382 + .d_compare = novfs_d_compare,
5383 + //.d_delete = novfs_d_delete,
5384 + .d_release = novfs_d_release,
5385 + .d_iput = novfs_d_iput,
5388 -struct file_operations Novfs_dir_operations = {
5389 +struct file_operations novfs_dir_operations = {
5390 .owner = THIS_MODULE,
5391 - .open = Novfs_dir_open,
5392 - .release = Novfs_dir_release,
5393 - .llseek = Novfs_dir_lseek,
5394 - .read = Novfs_dir_read,
5395 - .readdir = Novfs_dir_readdir,
5396 - .fsync = Novfs_dir_fsync,
5397 + .open = novfs_dir_open,
5398 + .release = novfs_dir_release,
5399 + .llseek = novfs_dir_lseek,
5400 + .read = novfs_dir_read,
5401 + .readdir = novfs_dir_readdir,
5402 + .fsync = novfs_dir_fsync,
5405 -static struct file_operations Novfs_file_operations = {
5406 +static struct file_operations novfs_file_operations = {
5407 .owner = THIS_MODULE,
5408 - .read = Novfs_f_read,
5409 - .write = Novfs_f_write,
5410 - .readdir = Novfs_f_readdir,
5411 - .ioctl = Novfs_f_ioctl,
5412 - .mmap = Novfs_f_mmap,
5413 - .open = Novfs_f_open,
5414 - .flush = Novfs_f_flush,
5415 - .release = Novfs_f_release,
5416 - .fsync = Novfs_f_fsync,
5417 + .read = novfs_f_read,
5418 + .write = novfs_f_write,
5419 + .readdir = novfs_f_readdir,
5420 + .ioctl = novfs_f_ioctl,
5421 + .mmap = novfs_f_mmap,
5422 + .open = novfs_f_open,
5423 + .flush = novfs_f_flush,
5424 + .release = novfs_f_release,
5425 + .fsync = novfs_f_fsync,
5426 .llseek = generic_file_llseek,
5427 - .lock = Novfs_f_lock,
5428 + .lock = novfs_f_lock,
5431 -static struct address_space_operations Novfs_nocache_aops = {
5432 - .readpage = Novfs_a_readpage,
5433 +static struct address_space_operations novfs_nocache_aops = {
5434 + .readpage = novfs_a_readpage,
5437 -struct backing_dev_info Novfs_backing_dev_info = {
5438 +struct backing_dev_info novfs_backing_dev_info = {
5439 .ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE,
5441 .capabilities = BDI_CAP_NO_WRITEBACK | BDI_CAP_MAP_COPY,
5442 .unplug_io_fn = default_unplug_io_fn,
5445 -static struct address_space_operations Novfs_aops = {
5446 - .readpage = Novfs_a_readpage,
5447 - .readpages = Novfs_a_readpages,
5448 - .writepage = Novfs_a_writepage,
5449 - .writepages = Novfs_a_writepages,
5450 - .prepare_write = Novfs_a_prepare_write,
5451 - .commit_write = Novfs_a_commit_write,
5452 +static struct address_space_operations novfs_aops = {
5453 + .readpage = novfs_a_readpage,
5454 + .readpages = novfs_a_readpages,
5455 + .writepage = novfs_a_writepage,
5456 + .writepages = novfs_a_writepages,
5457 + .prepare_write = novfs_a_prepare_write,
5458 + .commit_write = novfs_a_commit_write,
5459 .set_page_dirty = __set_page_dirty_nobuffers,
5460 - .direct_IO = Novfs_a_direct_IO,
5461 + .direct_IO = novfs_a_direct_IO,
5464 -static struct inode_operations Novfs_inode_operations = {
5465 - .create = Novfs_i_create,
5466 - .lookup = Novfs_i_lookup,
5467 - .unlink = Novfs_i_unlink,
5468 - .mkdir = Novfs_i_mkdir,
5469 - .rmdir = Novfs_i_rmdir,
5470 - .mknod = Novfs_i_mknod,
5471 - .rename = Novfs_i_rename,
5472 - .setattr = Novfs_i_setattr,
5473 - .getattr = Novfs_i_getattr,
5475 - .getxattr = Novfs_i_getxattr,
5476 - .setxattr = Novfs_i_setxattr,
5477 - .listxattr = Novfs_i_listxattr,
5478 +static struct inode_operations novfs_inode_operations = {
5479 + .create = novfs_i_create,
5480 + .lookup = novfs_i_lookup,
5481 + .unlink = novfs_i_unlink,
5482 + .mkdir = novfs_i_mkdir,
5483 + .rmdir = novfs_i_rmdir,
5484 + .mknod = novfs_i_mknod,
5485 + .rename = novfs_i_rename,
5486 + .setattr = novfs_i_setattr,
5487 + .getattr = novfs_i_getattr,
5489 + .getxattr = novfs_i_getxattr,
5490 + .setxattr = novfs_i_setxattr,
5491 + .listxattr = novfs_i_listxattr,
5495 -static struct inode_operations Novfs_file_inode_operations = {
5496 - .setattr = Novfs_i_setattr,
5497 - .getattr = Novfs_i_getattr,
5499 - .getxattr = Novfs_i_getxattr,
5500 - .setxattr = Novfs_i_setxattr,
5501 - .listxattr = Novfs_i_listxattr,
5502 +static struct inode_operations novfs_file_inode_operations = {
5503 + .setattr = novfs_i_setattr,
5504 + .getattr = novfs_i_getattr,
5506 + .getxattr = novfs_i_getxattr,
5507 + .setxattr = novfs_i_setxattr,
5508 + .listxattr = novfs_i_listxattr,
5512 -static struct super_operations Novfs_ops = {
5513 - .statfs = Novfs_statfs,
5514 - .clear_inode = Novfs_clear_inode,
5515 +static struct super_operations novfs_ops = {
5516 + .statfs = novfs_statfs,
5517 + .clear_inode = novfs_clear_inode,
5518 .drop_inode = generic_delete_inode,
5519 - .show_options = Novfs_show_options,
5520 + .show_options = novfs_show_options,
5524 /* Not currently used
5525 -static struct file_operations Novfs_Control_operations = {
5526 - .read = Novfs_Control_read,
5527 - .write = Novfs_Control_write,
5528 - .ioctl = Novfs_Control_ioctl,
5529 +static struct file_operations novfs_Control_operations = {
5530 + .read = novfs_Control_read,
5531 + .write = novfs_Control_write,
5532 + .ioctl = novfs_Control_ioctl,
5536 -static atomic_t Novfs_Inode_Number = ATOMIC_INIT(0);
5538 -struct dentry *Novfs_root = NULL;
5539 +static atomic_t novfs_Inode_Number = ATOMIC_INIT(0);
5541 -int Novfs_Version_Major = NOVFS_VFS_MAJOR;
5542 -int Novfs_Version_Minor = NOVFS_VFS_MINOR;
5543 -int Novfs_Version_Sub = NOVFS_VFS_SUB;
5544 -int Novfs_Version_Release = NOVFS_VFS_RELEASE;
5546 -char *Novfs_CurrentMount = NULL;
5547 +struct dentry *novfs_root = NULL;
5548 +char *novfs_current_mnt = NULL;
5550 DECLARE_MUTEX(InodeList_lock);
5552 @@ -346,18 +313,13 @@ uint64_t inHAXTime;
5555 unsigned long InodeCount = 0, DCCount = 0;
5556 -unsigned long File_update_timeout = FILE_UPDATE_TIMEOUT;
5558 +unsigned long novfs_update_timeout = FILE_UPDATE_TIMEOUT;
5559 +int novfs_page_cache = 0;
5561 -typedef struct _Novfs_List2 {
5562 - struct list_head list;
5566 -typedef struct _File_Private2 {
5567 +struct file_private {
5569 - HANDLE enumHandle;
5574 static void PRINT_DENTRY(const char *s, struct dentry *d)
5576 @@ -370,8 +332,8 @@ static void PRINT_DENTRY(const char *s,
5577 " prev: 0x%p\n", &d->d_lru, d->d_lru.next,
5579 DbgPrint(" d_child: 0x%p\n" " next: 0x%p\n"
5580 - " prev: 0x%p\n", &d->D_CHILD, d->D_CHILD.next,
5582 + " prev: 0x%p\n", &d->d_u.d_child,
5583 + d->d_u.d_child.next, d->d_u.d_child.prev);
5584 DbgPrint(" d_subdirs: 0x%p\n" " next: 0x%p\n"
5585 " prev: 0x%p\n", &d->d_subdirs, d->d_subdirs.next,
5587 @@ -397,144 +359,109 @@ static void PRINT_DENTRY(const char *s,
5590 /*++======================================================================*/
5591 -int Novfs_Remove_from_Root(char *RemoveName)
5603 - *========================================================================*/
5604 +int novfs_remove_from_root(char *RemoveName)
5607 struct dentry *dentry;
5610 - DbgPrint("Novfs_Remove_from_Root: %s\n", RemoveName);
5611 + DbgPrint("novfs_Remove_from_Root: %s\n", RemoveName);
5612 name.len = strlen(RemoveName);
5613 name.name = RemoveName;
5614 - Novfs_d_hash(Novfs_root, &name);
5615 + novfs_d_hash(novfs_root, &name);
5617 - dentry = d_lookup(Novfs_root, &name);
5618 + dentry = d_lookup(novfs_root, &name);
5620 - if (dentry->d_inode && dentry->d_inode->FSPRIVATE) {
5621 - ((struct inode_data *)(dentry->d_inode->FSPRIVATE))->Scope =
5623 + if (dentry->d_inode && dentry->d_inode->i_private) {
5624 + struct inode_data *n_inode =
5625 + dentry->d_inode->i_private;
5626 + n_inode->Scope = NULL;
5631 - dir = Novfs_root->d_inode;
5632 + dir = novfs_root->d_inode;
5634 - Novfs_lock_inode_cache(dir);
5635 - Novfs_remove_inode_entry(dir, &name, 0);
5636 - Novfs_unlock_inode_cache(dir);
5637 + novfs_lock_inode_cache(dir);
5638 + novfs_remove_inode_entry(dir, &name, 0);
5639 + novfs_unlock_inode_cache(dir);
5644 /*++======================================================================*/
5645 -int Novfs_Add_to_Root(char *AddName)
5657 - *========================================================================*/
5658 +int novfs_add_to_root(char *AddName)
5662 - struct entry_info info;
5663 + struct novfs_entry_info info;
5666 - DbgPrint("Novfs_Add_to_Root: %s\n", AddName);
5667 + DbgPrint("novfs_Add_to_Root: %s\n", AddName);
5668 name.len = strlen(AddName);
5669 name.name = AddName;
5670 - Novfs_d_hash(Novfs_root, &name);
5671 + novfs_d_hash(novfs_root, &name);
5673 - dir = Novfs_root->d_inode;
5674 + dir = novfs_root->d_inode;
5676 - Novfs_lock_inode_cache(dir);
5677 + novfs_lock_inode_cache(dir);
5681 - if (!Novfs_lookup_inode_cache(dir, &name, 0)) {
5682 + if (!novfs_lookup_inode_cache(dir, &name, 0)) {
5683 info.mode = S_IFDIR | 0700;
5685 info.atime = info.ctime = info.mtime = CURRENT_TIME;
5687 - ino = (ino_t)atomic_inc_return(&Novfs_Inode_Number);
5688 - Novfs_add_inode_entry(dir, &name, ino, &info);
5689 + ino = (ino_t)atomic_inc_return(&novfs_Inode_Number);
5690 + novfs_add_inode_entry(dir, &name, ino, &info);
5693 - Novfs_unlock_inode_cache(dir);
5694 + novfs_unlock_inode_cache(dir);
5699 /*++======================================================================*/
5700 -int Novfs_Add_to_Root2(char *AddName)
5712 - *========================================================================*/
5713 +int novfs_Add_to_Root2(char *AddName)
5715 struct dentry *entry;
5717 struct inode *inode;
5720 - DbgPrint("Novfs_Add_to_Root: %s\n", AddName);
5721 + DbgPrint("novfs_Add_to_Root: %s\n", AddName);
5722 name.len = strlen(AddName);
5723 name.name = AddName;
5725 - Novfs_d_hash(Novfs_root, &name);
5726 + novfs_d_hash(novfs_root, &name);
5728 - entry = Novfs_d_lookup(Novfs_root, &name);
5729 - DbgPrint("Novfs_Add_to_Root: Novfs_d_lookup 0x%p\n", entry);
5730 + entry = d_lookup(novfs_root, &name);
5731 + DbgPrint("novfs_Add_to_Root: novfs_d_lookup 0x%p\n", entry);
5732 if (NULL == entry) {
5733 - scope = Scope_Lookup();
5734 + scope = novfs_scope_lookup();
5736 - entry = d_alloc(Novfs_root, &name);
5737 - DbgPrint("Novfs_Add_to_Root: d_alloc 0x%p\n", entry);
5738 + entry = d_alloc(novfs_root, &name);
5739 + DbgPrint("novfs_Add_to_Root: d_alloc 0x%p\n", entry);
5741 - entry->d_op = &Novfs_dentry_operations;
5742 - entry->d_time = jiffies + (File_update_timeout * HZ);
5743 + entry->d_op = &novfs_dentry_operations;
5744 + entry->d_time = jiffies + (novfs_update_timeout * HZ);
5746 - * done in Novfs_d_add now... entry->d_fsdata = (void *)Novfs_internal_hash( &name );
5747 + * done in novfs_d_add now... entry->d_fsdata = (void *)novfs_internal_hash( &name );
5750 - Novfs_get_inode(Novfs_root->d_sb, S_IFDIR | 0700, 0, Scope_Get_Uid(scope), 0, &name);
5751 - DbgPrint("Novfs_Add_to_Root: Inode=0x%p\n", inode);
5752 + novfs_get_inode(novfs_root->d_sb, S_IFDIR | 0700, 0, novfs_scope_get_uid(scope), 0, &name);
5753 + DbgPrint("novfs_Add_to_Root: Inode=0x%p\n", inode);
5757 inode->i_mtime = CURRENT_TIME;
5758 - if (!Novfs_d_add(Novfs_root, entry, inode, 1)) {
5759 - if (inode->FSPRIVATE) {
5760 - ((struct inode_data *) inode->
5761 - FSPRIVATE)->Flags = USER_INODE;
5762 + if (!novfs_d_add(novfs_root, entry, inode, 1)) {
5763 + if (inode->i_private) {
5764 + struct inode_data *n_inode = inode->i_private;
5765 + n_inode->Flags = USER_INODE;
5767 - PRINT_DENTRY("After Novfs_d_add",
5768 + PRINT_DENTRY("After novfs_d_add",
5772 @@ -544,27 +471,12 @@ int Novfs_Add_to_Root2(char *AddName)
5776 - PRINT_DENTRY("Novfs_Add_to_Root: After dput Dentry", entry);
5777 + PRINT_DENTRY("novfs_Add_to_Root: After dput Dentry", entry);
5782 -/*++======================================================================*/
5783 -char *Novfs_dget_path(struct dentry *Dentry, char *Buf, unsigned int Buflen)
5785 - * Arguments: struct dentry *Dentry - starting entry
5786 - * char *Buf - pointer to memory buffer
5787 - * unsigned int Buflen - size of memory buffer
5789 - * Returns: pointer to path.
5791 - * Abstract: Walks the dentry chain building a path.
5797 - *========================================================================*/
5798 +char *novfs_dget_path(struct dentry *Dentry, char *Buf, unsigned int Buflen)
5800 char *retval = &Buf[Buflen];
5801 struct dentry *p = Dentry;
5802 @@ -591,34 +503,17 @@ char *Novfs_dget_path(struct dentry *Den
5806 - DbgPrint("Novfs_dget_path: %s\n", retval);
5807 + DbgPrint("novfs_dget_path: %s\n", retval);
5811 -/*++======================================================================*/
5812 int verify_dentry(struct dentry *dentry, int Flags)
5814 - * Arguments: struct dentry *dentry - entry to verify
5816 - * Returns: zero - Inode cache has been updated. If not in the cache
5817 - * then file doesn't exist.
5820 - * Abstract: This routine will verify if the file that dentry is pointing
5821 - * at exist and if it does it will put it in the inode cache of
5828 - *========================================================================*/
5830 int retVal = -ENOENT;
5832 - struct entry_info *info = NULL;
5833 + struct novfs_entry_info *info = NULL;
5834 struct inode_data *id;
5835 - session_t session;
5836 + struct novfs_schandle session;
5837 char *path, *list = NULL, *cp;
5840 @@ -633,19 +528,19 @@ int verify_dentry(struct dentry *dentry,
5843 if (dentry && dentry->d_parent &&
5844 - (dir = dentry->d_parent->d_inode) && (id = dir->FSPRIVATE)) {
5845 + (dir = dentry->d_parent->d_inode) && (id = dir->i_private)) {
5846 parent = dget_parent(dentry);
5848 - info = Novfs_Malloc(sizeof(struct entry_info) + PATH_LENGTH_BUFFER, GFP_KERNEL);
5849 + info = kmalloc(sizeof(struct novfs_entry_info) + PATH_LENGTH_BUFFER, GFP_KERNEL);
5852 - if (Novfs_lock_inode_cache(dir)) {
5853 + if (novfs_lock_inode_cache(dir)) {
5854 name.len = dentry->d_name.len;
5855 name.name = dentry->d_name.name;
5856 - name.hash = Novfs_internal_hash(&name);
5857 - if (!Novfs_get_entry_time(dir, &name, &ino, info, &ctime)) {
5858 + name.hash = novfs_internal_hash(&name);
5859 + if (!novfs_get_entry_time(dir, &name, &ino, info, &ctime)) {
5860 inode = dentry->d_inode;
5861 - if (inode && inode->FSPRIVATE &&
5862 + if (inode && inode->i_private &&
5863 ((inode->i_size != info->size) ||
5864 (inode->i_mtime.tv_sec !=
5866 @@ -654,30 +549,31 @@ int verify_dentry(struct dentry *dentry,
5868 * Values don't match so update.
5870 - ((struct inode_data *) inode->FSPRIVATE)->Flags |= UPDATE_INODE;
5871 + struct inode_data *n_inode = inode->i_private;
5872 + n_inode->Flags |= UPDATE_INODE;
5875 ctime = get_jiffies_64() - ctime;
5876 - if (Flags || ctime < (u64) (File_update_timeout * HZ)) {
5877 + if (Flags || ctime < (u64) (novfs_update_timeout * HZ)) {
5879 - Novfs_unlock_inode_cache(dir);
5880 + novfs_unlock_inode_cache(dir);
5886 - Novfs_unlock_inode_cache(dir);
5887 + novfs_unlock_inode_cache(dir);
5890 if (IS_ROOT(dentry->d_parent)) {
5891 - session = Scope_Get_SessionId(Scope_Get_ScopefromName(&dentry->d_name));
5893 - session = Scope_Get_SessionId(id->Scope);
5895 + session = novfs_scope_get_sessionId(
5896 + novfs_get_scope_from_name(&dentry->d_name));
5898 + session = novfs_scope_get_sessionId(id->Scope);
5900 if (!SC_PRESENT(session)) {
5901 - id->Scope = Scope_Get_ScopefromPath(dentry);
5902 - session = Scope_Get_SessionId(id->Scope);
5903 + id->Scope = novfs_get_scope(dentry);
5904 + session = novfs_scope_get_sessionId(id->Scope);
5908 @@ -685,62 +581,65 @@ int verify_dentry(struct dentry *dentry,
5910 if (IS_ROOT(dentry->d_parent)) {
5911 DbgPrint("verify_dentry: parent is Root directory\n");
5912 - list = Scope_Get_ScopeUsers();
5913 + list = novfs_get_scopeusers();
5915 - iLock = Novfs_lock_inode_cache(dir);
5916 - Novfs_invalidate_inode_cache(dir);
5917 + iLock = novfs_lock_inode_cache(dir);
5918 + novfs_invalidate_inode_cache(dir);
5924 name.len = strlen(cp);
5925 - name.hash = Novfs_internal_hash(&name);
5926 + name.hash = novfs_internal_hash(&name);
5927 cp += (name.len + 1);
5929 - if (Novfs_get_entry(dir, &name, &ino, info)) {
5930 + if (novfs_get_entry(dir, &name, &ino, info)) {
5931 info->mode = S_IFDIR | 0700;
5933 info->atime = info->ctime = info->mtime = CURRENT_TIME;
5934 - ino = (ino_t)atomic_inc_return(&Novfs_Inode_Number);
5935 - Novfs_add_inode_entry(dir, &name, ino, info);
5936 + ino = (ino_t)atomic_inc_return(&novfs_Inode_Number);
5937 + novfs_add_inode_entry(dir, &name, ino, info);
5941 - Novfs_free_invalid_entries(dir);
5942 + novfs_free_invalid_entries(dir);
5946 - Novfs_dget_path(dentry, info->name,
5947 + novfs_dget_path(dentry, info->name,
5948 PATH_LENGTH_BUFFER);
5950 if (dentry->d_name.len <=
5951 NW_MAX_PATH_LENGTH) {
5953 - Novfs_internal_hash
5954 + novfs_internal_hash
5956 name.len = dentry->d_name.len;
5957 name.name = dentry->d_name.name;
5959 - retVal = Novfs_Get_File_Info(path, info, &session);
5961 + novfs_get_file_info(path,
5967 - (File_update_timeout
5968 + (novfs_update_timeout
5971 - Novfs_lock_inode_cache
5972 + novfs_lock_inode_cache
5974 - if (Novfs_update_entry
5975 + if (novfs_update_entry
5980 ino = dentry->d_inode->i_ino;
5982 - ino = (ino_t)atomic_inc_return(&Novfs_Inode_Number);
5983 + ino = (ino_t)atomic_inc_return(&novfs_Inode_Number);
5985 - Novfs_add_inode_entry
5986 + novfs_add_inode_entry
5990 @@ -758,14 +657,14 @@ int verify_dentry(struct dentry *dentry,
5995 - ((struct inode_data *) dentry->d_inode->FSPRIVATE)->Scope = id->Scope;
5997 + ((struct inode_data *) dentry->d_inode->i_private)->Scope = id->Scope;
6000 } else if (-EINTR != retVal) {
6002 - iLock = Novfs_lock_inode_cache(dir);
6003 - Novfs_remove_inode_entry(dir, &name, 0);
6004 + iLock = novfs_lock_inode_cache(dir);
6005 + novfs_remove_inode_entry(dir, &name, 0);
6007 && !(dentry->d_inode->i_flags & S_DEAD)) {
6008 dentry->d_inode->i_flags |= S_DEAD;
6009 @@ -789,7 +688,7 @@ int verify_dentry(struct dentry *dentry,
6013 - Novfs_unlock_inode_cache(dir);
6014 + novfs_unlock_inode_cache(dir);
6018 @@ -804,67 +703,37 @@ int verify_dentry(struct dentry *dentry,
6022 -/*++======================================================================*/
6023 -struct dentry *Novfs_d_lookup(struct dentry *Parent, struct qstr *Name)
6035 - *========================================================================*/
6037 - return (d_lookup(Parent, Name));
6040 -/*++======================================================================*/
6041 -int Novfs_d_add(struct dentry *Parent, struct dentry *d, struct inode *i, int a)
6053 - *========================================================================*/
6054 +static int novfs_d_add(struct dentry *Parent, struct dentry *d, struct inode *i, int a)
6057 struct inode_data *id = NULL;
6061 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6062 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6064 - path = Novfs_dget_path(d, buf, PATH_LENGTH_BUFFER);
6065 + path = novfs_dget_path(d, buf, PATH_LENGTH_BUFFER);
6067 - DbgPrint("Novfs_d_add: inode=0x%p ino=%d path %s\n", i,
6068 + DbgPrint("novfs_d_add: inode=0x%p ino=%d path %s\n", i,
6074 - if (Parent && Parent->d_inode && Parent->d_inode->FSPRIVATE) {
6075 - id = (struct inode_data *) Parent->d_inode->FSPRIVATE;
6076 + if (Parent && Parent->d_inode && Parent->d_inode->i_private) {
6077 + id = (struct inode_data *) Parent->d_inode->i_private;
6080 if (id && id->Scope) {
6083 - scope = Scope_Get_ScopefromPath(d);
6084 + scope = novfs_get_scope(d);
6087 - ((struct inode_data *) i->FSPRIVATE)->Scope = scope;
6088 + ((struct inode_data *) i->i_private)->Scope = scope;
6090 - d->d_time = jiffies + (File_update_timeout * HZ);
6091 + d->d_time = jiffies + (novfs_update_timeout * HZ);
6095 @@ -874,29 +743,14 @@ int Novfs_d_add(struct dentry *Parent, s
6099 -/*++======================================================================*/
6100 -int Novfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
6102 - * Arguments: struct dentry *dentry - pointer to dentry to revalidate.
6103 - * struct nameidata *nd - pointer to nameidata.
6105 - * Returns: zero - dentry is not valid.
6106 - * !zero - valid entry
6114 - *========================================================================*/
6115 +int novfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
6119 struct inode_data *id;
6122 - DbgPrint("Novfs_d_revalidate: 0x%p %.*s\n"
6123 + DbgPrint("novfs_d_revalidate: 0x%p %.*s\n"
6126 dentry, dentry->d_name.len, dentry->d_name.name,
6127 @@ -908,7 +762,7 @@ int Novfs_d_revalidate(struct dentry *de
6128 if (dentry->d_inode &&
6130 (dir = dentry->d_parent->d_inode) &&
6131 - (id = dir->FSPRIVATE)) {
6132 + (id = dir->i_private)) {
6134 * Check timer to see if in valid time limit
6136 @@ -919,20 +773,20 @@ int Novfs_d_revalidate(struct dentry *de
6137 name.len = dentry->d_name.len;
6138 name.name = dentry->d_name.name;
6140 - Novfs_internal_hash(&dentry->d_name);
6141 + novfs_internal_hash(&dentry->d_name);
6144 if (0 == verify_dentry(dentry, 0)) {
6145 - if (Novfs_lock_inode_cache(dir)) {
6146 - if (Novfs_lookup_inode_cache
6147 + if (novfs_lock_inode_cache(dir)) {
6148 + if (novfs_lookup_inode_cache
6152 - (File_update_timeout
6153 + (novfs_update_timeout
6157 - Novfs_unlock_inode_cache(dir);
6158 + novfs_unlock_inode_cache(dir);
6162 @@ -949,26 +803,13 @@ int Novfs_d_revalidate(struct dentry *de
6166 - DbgPrint("Novfs_d_revalidate: return 0x%x %.*s\n", retCode,
6167 + DbgPrint("novfs_d_revalidate: return 0x%x %.*s\n", retCode,
6168 dentry->d_name.len, dentry->d_name.name);
6173 -/*++======================================================================*/
6174 -unsigned long Novfs_internal_hash(struct qstr *name)
6186 - *========================================================================*/
6187 +static unsigned long novfs_internal_hash(struct qstr *name)
6189 unsigned long hash = 0;
6190 unsigned int len = name->len;
6191 @@ -984,48 +825,22 @@ unsigned long Novfs_internal_hash(struct
6195 -/*++======================================================================*/
6196 -int Novfs_d_hash(struct dentry *dentry, struct qstr *name)
6208 - *========================================================================*/
6209 +int novfs_d_hash(struct dentry *dentry, struct qstr *name)
6211 - DbgPrint("Novfs_d_hash: %.*s\n", name->len, name->name);
6212 + DbgPrint("novfs_d_hash: %.*s\n", name->len, name->name);
6214 - name->hash = Novfs_internal_hash(name);
6215 + name->hash = novfs_internal_hash(name);
6220 -/*++======================================================================*/
6221 -int Novfs_d_strcmp(struct qstr *s1, struct qstr *s2)
6233 - *========================================================================*/
6234 +int novfs_d_strcmp(struct qstr *s1, struct qstr *s2)
6237 unsigned char *str1, *str2;
6240 - DbgPrint("Novfs_d_strcmp: s1=%.*s s2=%.*s\n", s1->len, s1->name,
6241 + DbgPrint("novfs_d_strcmp: s1=%.*s s2=%.*s\n", s1->len, s1->name,
6244 if (s1->len && (s1->len == s2->len) && (s1->hash == s2->hash)) {
6245 @@ -1042,51 +857,25 @@ int Novfs_d_strcmp(struct qstr *s1, stru
6249 - DbgPrint("Novfs_d_strcmp: retCode=0x%x\n", retCode);
6250 + DbgPrint("novfs_d_strcmp: retCode=0x%x\n", retCode);
6254 -/*++======================================================================*/
6255 -int Novfs_d_compare(struct dentry *parent, struct qstr *s1, struct qstr *s2)
6267 - *========================================================================*/
6268 +int novfs_d_compare(struct dentry *parent, struct qstr *s1, struct qstr *s2)
6272 - retCode = Novfs_d_strcmp(s1, s2);
6273 + retCode = novfs_d_strcmp(s1, s2);
6275 - DbgPrint("Novfs_d_compare: retCode=0x%x\n", retCode);
6276 + DbgPrint("novfs_d_compare: retCode=0x%x\n", retCode);
6280 -/*++======================================================================*/
6281 -int Novfs_d_delete(struct dentry *dentry)
6293 - *========================================================================*/
6294 +int novfs_d_delete(struct dentry *dentry)
6298 - DbgPrint("Novfs_d_delete: 0x%p %.*s\n"
6299 + DbgPrint("novfs_d_delete: 0x%p %.*s\n"
6302 dentry, dentry->d_name.len, dentry->d_name.name,
6303 @@ -1101,42 +890,16 @@ int Novfs_d_delete(struct dentry *dentry
6307 -/*++======================================================================*/
6308 -void Novfs_d_release(struct dentry *dentry)
6320 - *========================================================================*/
6321 +void novfs_d_release(struct dentry *dentry)
6323 - DbgPrint("Novfs_d_release: 0x%p %.*s\n", dentry, dentry->d_name.len,
6324 + DbgPrint("novfs_d_release: 0x%p %.*s\n", dentry, dentry->d_name.len,
6325 dentry->d_name.name);
6328 -/*++======================================================================*/
6329 -void Novfs_d_iput(struct dentry *dentry, struct inode *inode)
6341 - *========================================================================*/
6342 +void novfs_d_iput(struct dentry *dentry, struct inode *inode)
6345 - ("Novfs_d_iput: Inode=0x%p Ino=%d Dentry=0x%p i_state=%d Name=%.*s\n",
6346 + ("novfs_d_iput: Inode=0x%p Ino=%d Dentry=0x%p i_state=%d Name=%.*s\n",
6347 inode, inode->i_ino, dentry, inode->i_state, dentry->d_name.len,
6348 dentry->d_name.name);
6350 @@ -1144,37 +907,24 @@ void Novfs_d_iput(struct dentry *dentry,
6354 -/*++======================================================================*/
6355 -int Novfs_dir_open(struct inode *dir, struct file *file)
6367 - *========================================================================*/
6368 +int novfs_dir_open(struct inode *dir, struct file *file)
6371 - FilePrivate2 *file_private = NULL;
6372 + struct file_private *file_private = NULL;
6374 - DbgPrint("Novfs_dir_open: Inode 0x%p %d Name %.*s\n", dir, dir->i_ino,
6375 + DbgPrint("novfs_dir_open: Inode 0x%p %d Name %.*s\n", dir, dir->i_ino,
6376 file->f_dentry->d_name.len, file->f_dentry->d_name.name);
6378 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6379 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6381 - path = Novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6382 + path = novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6384 - DbgPrint("Novfs_dir_open: path %s\n", path);
6385 + DbgPrint("novfs_dir_open: path %s\n", path);
6390 - file_private = Novfs_Malloc(sizeof(FilePrivate2), GFP_KERNEL);
6391 + file_private = kmalloc(sizeof(struct file_private), GFP_KERNEL);
6392 file_private->listedall = 0;
6393 file_private->enumHandle = NULL;
6395 @@ -1183,25 +933,12 @@ int Novfs_dir_open(struct inode *dir, st
6399 -/*++======================================================================*/
6400 -int Novfs_dir_release(struct inode *dir, struct file *file)
6412 - *========================================================================*/
6413 +int novfs_dir_release(struct inode *dir, struct file *file)
6415 - FilePrivate2 *file_private;
6416 - file_private = (FilePrivate2 *) file->private_data;
6417 + struct file_private *file_private;
6418 + file_private = (struct file_private *) file->private_data;
6420 - DbgPrint("Novfs_dir_release: Inode 0x%p %d Name %.*s\n", dir,
6421 + DbgPrint("novfs_dir_release: Inode 0x%p %d Name %.*s\n", dir,
6422 dir->i_ino, file->f_dentry->d_name.len,
6423 file->f_dentry->d_name.name);
6425 @@ -1213,24 +950,11 @@ int Novfs_dir_release(struct inode *dir,
6429 -/*++======================================================================*/
6430 -loff_t Novfs_dir_lseek(struct file * file, loff_t offset, int origin)
6442 - *========================================================================*/
6443 +loff_t novfs_dir_lseek(struct file * file, loff_t offset, int origin)
6445 - FilePrivate2 *file_private = NULL;
6446 + struct file_private *file_private = NULL;
6448 - DbgPrint("Novfs_dir_lseek: offset %lld %d Name %.*s\n", offset, origin,
6449 + DbgPrint("novfs_dir_lseek: offset %lld %d Name %.*s\n", offset, origin,
6450 file->f_dentry->d_name.len, file->f_dentry->d_name.name);
6451 //printk("<1> seekdir file = %.*s offset = %i\n", file->f_dentry->d_name.len, file->f_dentry->d_name.name, (int)offset);
6453 @@ -1240,7 +964,7 @@ loff_t Novfs_dir_lseek(struct file * fil
6457 - file_private = (FilePrivate2 *) file->private_data;
6458 + file_private = (struct file_private *) file->private_data;
6459 file_private->listedall = 0;
6460 file_private->enumHandle = NULL;
6462 @@ -1248,25 +972,12 @@ loff_t Novfs_dir_lseek(struct file * fil
6463 //return(default_llseek(file, offset, origin));
6466 -/*++======================================================================*/
6467 -ssize_t Novfs_dir_read(struct file * file, char *buf, size_t len, loff_t * off)
6479 - *========================================================================*/
6480 +ssize_t novfs_dir_read(struct file * file, char *buf, size_t len, loff_t * off)
6485 - DbgPrint("Novfs_dir_readdir: dentry path %.*s buf=0x%p len=%d off=%lld\n", file->f_dentry->d_name.len, file->f_dentry->d_name.name, buf, len, *off);
6486 + DbgPrint("novfs_dir_readdir: dentry path %.*s buf=0x%p len=%d off=%lld\n", file->f_dentry->d_name.len, file->f_dentry->d_name.name, buf, len, *off);
6490 @@ -1276,19 +987,19 @@ ssize_t Novfs_dir_read(struct file * fil
6494 - DbgPrint("Novfs_dir_read: %lld %d Name %.*s\n", *off, len,
6495 + DbgPrint("novfs_dir_read: %lld %d Name %.*s\n", *off, len,
6496 file->f_dentry->d_name.len, file->f_dentry->d_name.name);
6497 return (generic_read_dir(file, buf, len, off));
6500 -static void Novfs_Dump_Info(struct entry_info *info)
6501 +static void novfs_Dump_Info(struct novfs_entry_info *info)
6503 char atime_buf[32], mtime_buf[32], ctime_buf[32];
6508 - DbgPrint("Novfs_dir_readdir : Dump_Info info == NULL\n");
6509 + DbgPrint("novfs_dir_readdir : Dump_Info info == NULL\n");
6513 @@ -1304,42 +1015,29 @@ static void Novfs_Dump_Info(struct entry
6514 ctime_r(&info->atime.tv_sec, atime_buf);
6515 ctime_r(&info->mtime.tv_sec, mtime_buf);
6516 ctime_r(&info->ctime.tv_sec, ctime_buf);
6517 - DbgPrint("Novfs_dir_readdir : type = %i\n", info->type);
6518 - DbgPrint("Novfs_dir_readdir : mode = %x\n", info->mode);
6519 - DbgPrint("Novfs_dir_readdir : uid = %d\n", info->uid);
6520 - DbgPrint("Novfs_dir_readdir : gid = %d\n", info->gid);
6521 - DbgPrint("Novfs_dir_readdir : size = %i\n", info->size);
6522 - DbgPrint("Novfs_dir_readdir : atime = %s\n", atime_buf);
6523 - DbgPrint("Novfs_dir_readdir : mtime = %s\n", mtime_buf);
6524 - DbgPrint("Novfs_dir_readdir : ctime = %s\n", ctime_buf);
6525 - DbgPrint("Novfs_dir_readdir : namelength = %i\n", info->namelength);
6526 - DbgPrint("Novfs_dir_readdir : name = %s\n", namebuf);
6527 + DbgPrint("novfs_dir_readdir : type = %i\n", info->type);
6528 + DbgPrint("novfs_dir_readdir : mode = %x\n", info->mode);
6529 + DbgPrint("novfs_dir_readdir : uid = %d\n", info->uid);
6530 + DbgPrint("novfs_dir_readdir : gid = %d\n", info->gid);
6531 + DbgPrint("novfs_dir_readdir : size = %i\n", info->size);
6532 + DbgPrint("novfs_dir_readdir : atime = %s\n", atime_buf);
6533 + DbgPrint("novfs_dir_readdir : mtime = %s\n", mtime_buf);
6534 + DbgPrint("novfs_dir_readdir : ctime = %s\n", ctime_buf);
6535 + DbgPrint("novfs_dir_readdir : namelength = %i\n", info->namelength);
6536 + DbgPrint("novfs_dir_readdir : name = %s\n", namebuf);
6539 -/*++======================================================================*/
6540 void processList(struct file *file, void *dirent, filldir_t filldir, char *list,
6541 - int type, session_t SessionId)
6553 - *========================================================================*/
6554 + int type, struct novfs_schandle SessionId)
6556 unsigned char *path, *buf = NULL, *cp;
6558 - struct entry_info *pinfo = NULL;
6559 + struct novfs_entry_info *pinfo = NULL;
6561 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6562 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6565 - path = Novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6566 + path = novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6570 @@ -1351,14 +1049,14 @@ void processList(struct file *file, void
6574 - DbgPrint("Novfs_dir_readdir : name.name = %s\n",
6575 + DbgPrint("novfs_dir_readdir : name.name = %s\n",
6577 name.len = strlen(cp);
6578 - name.hash = Novfs_internal_hash(&name);
6579 + name.hash = novfs_internal_hash(&name);
6580 cp += (name.len + 1);
6583 - Novfs_Malloc(sizeof(struct entry_info) +
6584 + kmalloc(sizeof(struct novfs_entry_info) +
6585 PATH_LENGTH_BUFFER, GFP_KERNEL);
6586 pinfo->mode = S_IFDIR | 0700;
6588 @@ -1367,7 +1065,7 @@ void processList(struct file *file, void
6589 strcpy(pinfo->name, name.name);
6590 pinfo->namelength = name.len;
6592 - Novfs_Dump_Info(pinfo);
6593 + novfs_Dump_Info(pinfo);
6595 filldir(dirent, pinfo->name, pinfo->namelength,
6596 file->f_pos, file->f_pos, pinfo->mode >> 12);
6597 @@ -1383,26 +1081,28 @@ void processList(struct file *file, void
6600 int processEntries(struct file *file, void *dirent, filldir_t filldir,
6601 - HANDLE * enumHandle, session_t sessionId)
6602 + void ** enumHandle, struct novfs_schandle sessionId)
6604 unsigned char *path = NULL, *buf = NULL;
6605 int count = 0, status = 0;
6606 - struct entry_info *pinfo = NULL;
6607 - struct entry_info *pInfoMem = NULL;
6608 + struct novfs_entry_info *pinfo = NULL;
6609 + struct novfs_entry_info *pInfoMem = NULL;
6611 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6612 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6617 - path = Novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6618 + path = novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6625 - status = Novfs_Get_Directory_ListEx(path, enumHandle, &count, &pinfo, &sessionId);
6627 + novfs_get_dir_listex(path, enumHandle, &count, &pinfo,
6631 if ((count == -1) || (count == 0) || (status != 0)) {
6632 @@ -1416,7 +1116,7 @@ int processEntries(struct file *file, vo
6633 file->f_pos, pinfo->mode >> 12);
6636 - pinfo = (struct entry_info *)(pinfo->name + pinfo->namelength);
6637 + pinfo = (struct novfs_entry_info *) (pinfo->name + pinfo->namelength);
6641 @@ -1424,32 +1124,19 @@ int processEntries(struct file *file, vo
6645 -/*++======================================================================*/
6646 -int Novfs_dir_readdir(struct file *file, void *dirent, filldir_t filldir)
6658 - *========================================================================*/
6659 +int novfs_dir_readdir(struct file *file, void *dirent, filldir_t filldir)
6661 unsigned char *list = NULL;
6662 int status = 0; //-ENOMEM;
6663 struct inode *inode = file->f_dentry->d_inode;
6664 - session_t sessionId;
6665 + struct novfs_schandle sessionId;
6668 - FilePrivate2 *file_private = NULL;
6669 + struct file_private *file_private = NULL;
6672 - file_private = (FilePrivate2 *) file->private_data;
6673 - DbgPrint("Novfs_dir_readdir: Name %.*s\n", file->f_dentry->d_name.len,
6674 + file_private = (struct file_private *) file->private_data;
6675 + DbgPrint("novfs_dir_readdir: Name %.*s\n", file->f_dentry->d_name.len,
6676 file->f_dentry->d_name.name);
6678 //printk("<1> file = %.*s\n", file->f_dentry->d_name.len, file->f_dentry->d_name.name);
6679 @@ -1510,16 +1197,18 @@ int Novfs_dir_readdir(struct file *file,
6682 inode = file->f_dentry->d_inode;
6683 - if (inode && inode->FSPRIVATE) {
6684 + if (inode && inode->i_private) {
6686 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)-> Scope);
6687 + novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->
6689 if (0 == SC_PRESENT(sessionId)) {
6690 - ((struct inode_data *)inode->FSPRIVATE)->Scope =
6691 - Scope_Get_ScopefromPath(file->f_dentry);
6692 + ((struct inode_data *) inode->i_private)->Scope =
6693 + novfs_get_scope(file->f_dentry);
6695 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
6696 + novfs_scope_get_sessionId(((struct inode_data *) inode->
6697 + i_private)->Scope);
6699 - uid = Scope_Get_Uid(((struct inode_data *)inode->FSPRIVATE)->Scope);
6700 + uid = novfs_scope_get_uid(((struct inode_data *) inode->i_private)->Scope);
6702 SC_INITIALIZE(sessionId);
6703 uid = current->euid;
6704 @@ -1530,19 +1219,19 @@ int Novfs_dir_readdir(struct file *file,
6705 IS_ROOT(file->f_dentry->d_parent->d_parent)) // Server
6707 if (IS_ROOT(file->f_dentry)) {
6708 - DbgPrint("Novfs_dir_readdir: Root directory\n");
6709 - list = Scope_Get_ScopeUsers();
6710 + DbgPrint("novfs_dir_readdir: Root directory\n");
6711 + list = novfs_get_scopeusers();
6713 } else if (IS_ROOT(file->f_dentry->d_parent)) {
6715 - ("Novfs_dir_readdir: Parent is Root directory\n");
6716 - Novfs_Get_Connected_Server_List(&list, &sessionId);
6717 + ("novfs_dir_readdir: Parent is Root directory\n");
6718 + novfs_get_servers(&list, sessionId);
6722 - ("Novfs_dir_readdir: Parent-Parent is Root directory\n");
6723 - Novfs_Get_Server_Volume_List(&file->f_dentry->d_name,
6724 - &list, &sessionId);
6725 + ("novfs_dir_readdir: Parent-Parent is Root directory\n");
6726 + novfs_get_vols(&file->f_dentry->d_name,
6727 + &list, sessionId);
6731 @@ -1580,76 +1269,46 @@ int Novfs_dir_readdir(struct file *file,
6735 -/*++======================================================================*/
6736 -int Novfs_dir_fsync(struct file *file, struct dentry *dentry, int datasync)
6748 - *========================================================================*/
6749 +int novfs_dir_fsync(struct file *file, struct dentry *dentry, int datasync)
6751 - DbgPrint("Novfs_dir_fsync: Name %.*s\n", file->f_dentry->d_name.len,
6752 + DbgPrint("novfs_dir_fsync: Name %.*s\n", file->f_dentry->d_name.len,
6753 file->f_dentry->d_name.name);
6754 return (simple_sync_file(file, dentry, datasync));
6757 -/*++======================================================================*/
6758 -ssize_t Novfs_f_read(struct file * file, char *buf, size_t len, loff_t * off)
6770 - *========================================================================*/
6771 +ssize_t novfs_f_read(struct file * file, char *buf, size_t len, loff_t * off)
6773 size_t thisread, totalread = 0;
6774 loff_t offset = *off;
6775 struct inode *inode;
6776 - session_t session;
6777 + struct novfs_schandle session;
6778 struct inode_data *id;
6780 if (file->f_dentry &&
6781 (inode = file->f_dentry->d_inode) &&
6782 - (id = (struct inode_data *)inode->FSPRIVATE)) {
6783 + (id = (struct inode_data *) inode->i_private)) {
6785 - DbgPrint("Novfs_f_read(0x%p 0x%p %d %lld %.*s)\n",
6786 + DbgPrint("novfs_f_read(0x%p 0x%p %d %lld %.*s)\n",
6789 file->f_dentry->d_name.len,
6790 file->f_dentry->d_name.name);
6792 - if (PageCache && !(file->f_flags & O_DIRECT) && id->CacheFlag) {
6793 -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
6794 - totalread = generic_file_read(file, buf, len, off);
6796 + if (novfs_page_cache && !(file->f_flags & O_DIRECT) && id->CacheFlag) {
6797 totalread = do_sync_read(file, buf, len, off);
6800 - session = Scope_Get_SessionId(id->Scope);
6801 + session = novfs_scope_get_sessionId(id->Scope);
6802 if (0 == SC_PRESENT(session)) {
6804 - Scope_Get_ScopefromPath(file->f_dentry);
6805 - session = Scope_Get_SessionId(id->Scope);
6806 + novfs_get_scope(file->f_dentry);
6807 + session = novfs_scope_get_sessionId(id->Scope);
6810 while (len > 0 && (offset < i_size_read(inode))) {
6814 - Novfs_Read_File(file->private_data, buf,
6815 + novfs_read_file(file->private_data, buf,
6818 if (retval || !thisread) {
6819 @@ -1658,7 +1317,7 @@ ssize_t Novfs_f_read(struct file * file,
6823 - DbgPrint("Novfs_f_read thisread = 0x%x\n",
6824 + DbgPrint("novfs_f_read thisread = 0x%x\n",
6828 @@ -1668,77 +1327,60 @@ ssize_t Novfs_f_read(struct file * file,
6832 - DbgPrint("Novfs_f_read return = %d\n", totalread);
6833 + DbgPrint("novfs_f_read return = %d\n", totalread);
6838 -/*++======================================================================*/
6839 -ssize_t Novfs_f_write(struct file * file, const char *buf, size_t len,
6840 +ssize_t novfs_f_write(struct file * file, const char *buf, size_t len,
6853 - *========================================================================*/
6855 ssize_t thiswrite, totalwrite = 0;
6856 loff_t offset = *off;
6857 - session_t session;
6858 + struct novfs_schandle session;
6859 struct inode *inode;
6861 struct inode_data *id;
6863 if (file->f_dentry &&
6864 (inode = file->f_dentry->d_inode) &&
6865 - (id = file->f_dentry->d_inode->FSPRIVATE)) {
6866 - DbgPrint("Novfs_f_write(0x%p 0x%p 0x%p %d %lld %.*s)\n",
6867 + (id = file->f_dentry->d_inode->i_private)) {
6868 + DbgPrint("novfs_f_write(0x%p 0x%p 0x%p %d %lld %.*s)\n",
6869 file->private_data, inode, id->FileHandle, len, offset,
6870 file->f_dentry->d_name.len,
6871 file->f_dentry->d_name.name);
6874 + if (novfs_page_cache &&
6875 !(file->f_flags & O_DIRECT) &&
6876 id->CacheFlag && !(file->f_flags & O_WRONLY)) {
6877 -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
6878 - totalwrite = generic_file_write(file, buf, len, off);
6880 totalwrite = do_sync_write(file, buf, len, off);
6883 if (file->f_flags & O_APPEND) {
6884 offset = i_size_read(inode);
6886 - ("Novfs_f_write appending to end %lld %.*s\n",
6887 + ("novfs_f_write appending to end %lld %.*s\n",
6888 offset, file->f_dentry->d_name.len,
6889 file->f_dentry->d_name.name);
6892 - session = Scope_Get_SessionId(id->Scope);
6893 + session = novfs_scope_get_sessionId(id->Scope);
6894 if (0 == SC_PRESENT(session)) {
6896 - Scope_Get_ScopefromPath(file->f_dentry);
6897 - session = Scope_Get_SessionId(id->Scope);
6898 + novfs_get_scope(file->f_dentry);
6899 + session = novfs_scope_get_sessionId(id->Scope);
6905 - Novfs_Write_File(file->private_data,
6906 + novfs_write_file(file->private_data,
6907 (unsigned char *)buf,
6908 &thiswrite, &offset,
6909 session)) || !thiswrite) {
6910 totalwrite = status;
6913 - DbgPrint("Novfs_f_write thiswrite = 0x%x\n",
6914 + DbgPrint("novfs_f_write thiswrite = 0x%x\n",
6918 @@ -1757,69 +1399,43 @@ ssize_t Novfs_f_write(struct file * file
6922 - DbgPrint("Novfs_f_write return = 0x%x\n", totalwrite);
6923 + DbgPrint("novfs_f_write return = 0x%x\n", totalwrite);
6925 return (totalwrite);
6928 -int Novfs_f_readdir(struct file *file, void *data, filldir_t fill)
6929 +int novfs_f_readdir(struct file *file, void *data, filldir_t fill)
6934 -int Novfs_f_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
6935 +int novfs_f_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
6938 - DbgPrint("Novfs_f_ioctl: file=0x%p cmd=0x%x arg=0x%p\n", file, cmd,
6939 + DbgPrint("novfs_f_ioctl: file=0x%p cmd=0x%x arg=0x%p\n", file, cmd,
6945 -/*++======================================================================*/
6946 -int Novfs_f_mmap(struct file *file, struct vm_area_struct *vma)
6958 - *========================================================================*/
6959 +int novfs_f_mmap(struct file *file, struct vm_area_struct *vma)
6961 int retCode = -EINVAL;
6963 - DbgPrint("Novfs_f_mmap: file=0x%p %.*s\n", file,
6964 + DbgPrint("novfs_f_mmap: file=0x%p %.*s\n", file,
6965 file->f_dentry->d_name.len, file->f_dentry->d_name.name);
6967 retCode = generic_file_mmap(file, vma);
6969 - DbgPrint("Novfs_f_mmap: retCode=0x%x\n", retCode);
6970 + DbgPrint("novfs_f_mmap: retCode=0x%x\n", retCode);
6974 -/*++======================================================================*/
6975 -int Novfs_f_open(struct inode *inode, struct file *file)
6987 - *========================================================================*/
6988 +int novfs_f_open(struct inode *inode, struct file *file)
6990 - struct entry_info *info = NULL;
6991 + struct novfs_entry_info *info = NULL;
6992 int retCode = -ENOENT;
6993 - session_t session;
6994 + struct novfs_schandle session;
6996 struct dentry *parent;
6998 @@ -1827,32 +1443,35 @@ int Novfs_f_open(struct inode *inode, st
7002 - ("Novfs_f_open: inode=0x%p file=0x%p dentry=0x%p dentry->d_inode=0x%p %.*s\n",
7003 + ("novfs_f_open: inode=0x%p file=0x%p dentry=0x%p dentry->d_inode=0x%p %.*s\n",
7004 inode, file, file->f_dentry, file->f_dentry->d_inode,
7005 file->f_dentry->d_name.len, file->f_dentry->d_name.name);
7006 if (file->f_dentry) {
7008 - ("Novfs_f_open: %.*s f_flags=0%o f_mode=0%o i_mode=0%o\n",
7009 + ("novfs_f_open: %.*s f_flags=0%o f_mode=0%o i_mode=0%o\n",
7010 file->f_dentry->d_name.len, file->f_dentry->d_name.name,
7011 file->f_flags, file->f_mode, inode->i_mode);
7014 - if (inode && inode->FSPRIVATE) {
7015 - id = (struct inode_data *) file->f_dentry->d_inode->FSPRIVATE;
7016 - session = Scope_Get_SessionId(id->Scope);
7017 + if (inode && inode->i_private) {
7018 + id = (struct inode_data *) file->f_dentry->d_inode->i_private;
7019 + session = novfs_scope_get_sessionId(id->Scope);
7020 if (0 == SC_PRESENT(session)) {
7021 - id->Scope = Scope_Get_ScopefromPath(file->f_dentry);
7022 - session = Scope_Get_SessionId(id->Scope);
7023 + id->Scope = novfs_get_scope(file->f_dentry);
7024 + session = novfs_scope_get_sessionId(id->Scope);
7027 - info = Novfs_Malloc(sizeof(struct entry_info) + PATH_LENGTH_BUFFER, GFP_KERNEL);
7028 + info = kmalloc(sizeof(struct novfs_entry_info) +
7029 + PATH_LENGTH_BUFFER, GFP_KERNEL);
7032 - Novfs_dget_path(file->f_dentry, info->name,
7033 + novfs_dget_path(file->f_dentry, info->name,
7034 PATH_LENGTH_BUFFER);
7036 if (file->f_flags & O_TRUNC) {
7037 - errInfo = Novfs_Get_File_Info(path, info, &session);
7039 + novfs_get_file_info(path, info,
7042 if (errInfo || info->size == 0) {
7043 // clear O_TRUNC flag, bug #275366
7044 @@ -1861,15 +1480,15 @@ int Novfs_f_open(struct inode *inode, st
7048 - DbgPrint("Novfs_f_open: %s\n", path);
7049 - retCode = Novfs_Open_File(path,
7050 + DbgPrint("novfs_f_open: %s\n", path);
7051 + retCode = novfs_open_file(path,
7055 &file->private_data,
7058 - DbgPrint("Novfs_f_open: 0x%x 0x%p\n", retCode,
7059 + DbgPrint("novfs_f_open: 0x%x 0x%p\n", retCode,
7060 file->private_data);
7063 @@ -1877,28 +1496,31 @@ int Novfs_f_open(struct inode *inode, st
7065 //id->FileHandle = file->private_data;
7067 - Novfs_Get_File_Cache_Flag(path,
7068 + novfs_get_file_cache_flag(path,
7071 - if (!Novfs_Get_File_Info(path, info, &session))
7072 + if (!novfs_get_file_info
7073 + (path, info, session)) {
7074 update_inode(inode, info);
7077 parent = dget_parent(file->f_dentry);
7079 if (parent && parent->d_inode) {
7082 - Novfs_lock_inode_cache(dir);
7083 + novfs_lock_inode_cache(dir);
7085 - if (Novfs_get_entry
7086 + if (novfs_get_entry
7088 &file->f_dentry->d_name,
7090 - ((struct inode_data *)inode->FSPRIVATE)->Flags |=
7091 + ((struct inode_data *) inode->
7092 + i_private)->Flags |=
7096 - Novfs_unlock_inode_cache(dir);
7097 + novfs_unlock_inode_cache(dir);
7101 @@ -1906,25 +1528,12 @@ int Novfs_f_open(struct inode *inode, st
7105 - DbgPrint("Novfs_f_open: retCode=0x%x\n", retCode);
7106 + DbgPrint("novfs_f_open: retCode=0x%x\n", retCode);
7110 -/*++======================================================================*/
7111 -int Novfs_flush_mapping(HANDLE Handle, struct address_space *mapping,
7112 - session_t Session)
7124 - *========================================================================*/
7125 +int novfs_flush_mapping(void *Handle, struct address_space *mapping,
7126 + struct novfs_schandle Session)
7128 struct pagevec pagevec;
7130 @@ -1944,20 +1553,20 @@ int Novfs_flush_mapping(HANDLE Handle, s
7134 - DbgPrint("Novfs_flush_mapping: %u\n", nrpages);
7135 + DbgPrint("novfs_flush_mapping: %u\n", nrpages);
7138 for (i = 0; !rc && (i < nrpages); i++) {
7139 page = pagevec.pages[i];
7141 - DbgPrint("Novfs_flush_mapping: page 0x%p %lu\n",
7142 + DbgPrint("novfs_flush_mapping: page 0x%p %lu\n",
7146 page_cache_get(page);
7147 if (page->mapping == mapping) {
7148 if (clear_page_dirty_for_io(page)) {
7149 - rc = Novfs_Write_Page(Handle,
7150 + rc = novfs_write_page(Handle,
7154 @@ -1978,61 +1587,44 @@ int Novfs_flush_mapping(HANDLE Handle, s
7156 } while (!rc && !done);
7158 - DbgPrint("Novfs_flush_mapping: return %d\n", rc);
7159 + DbgPrint("novfs_flush_mapping: return %d\n", rc);
7164 -/*++======================================================================*/
7165 -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
7166 -int Novfs_f_flush(struct file *file)
7168 -int Novfs_f_flush(struct file *file, fl_owner_t ownid)
7181 - *========================================================================*/
7182 +int novfs_f_flush(struct file *file, fl_owner_t ownid)
7187 struct inode *inode;
7188 - session_t session;
7189 + struct novfs_schandle session;
7190 struct inode_data *id;
7192 - DbgPrint("Novfs_f_flush: Called from 0x%p\n",
7193 + DbgPrint("novfs_f_flush: Called from 0x%p\n",
7194 __builtin_return_address(0));
7195 if (file->f_dentry && (inode = file->f_dentry->d_inode)
7196 - && (id = file->f_dentry->d_inode->FSPRIVATE)) {
7197 + && (id = file->f_dentry->d_inode->i_private)) {
7199 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
7200 inode = file->f_dentry->d_inode;
7202 - ("Novfs_f_flush: %.*s f_flags=0%o f_mode=0%o i_mode=0%o\n",
7203 + ("novfs_f_flush: %.*s f_flags=0%o f_mode=0%o i_mode=0%o\n",
7204 file->f_dentry->d_name.len,
7205 file->f_dentry->d_name.name, file->f_flags,
7206 file->f_mode, inode->i_mode);
7208 - session = Scope_Get_SessionId(id->Scope);
7209 + session = novfs_scope_get_sessionId(id->Scope);
7210 if (0 == SC_PRESENT(session)) {
7212 - Scope_Get_ScopefromPath(file->f_dentry);
7213 - session = Scope_Get_SessionId(id->Scope);
7214 + novfs_get_scope(file->f_dentry);
7215 + session = novfs_scope_get_sessionId(id->Scope);
7219 inode->i_mapping && inode->i_mapping->nrpages) {
7221 - DbgPrint("Novfs_f_flush: %.*s pages=%lu\n",
7222 + DbgPrint("novfs_f_flush: %.*s pages=%lu\n",
7223 file->f_dentry->d_name.len,
7224 file->f_dentry->d_name.name,
7225 inode->i_mapping->nrpages);
7226 @@ -2047,7 +1639,7 @@ int Novfs_f_flush(struct file *file, fl_
7230 - rc = Novfs_flush_mapping(file->
7231 + rc = novfs_flush_mapping(file->
7235 @@ -2062,46 +1654,33 @@ int Novfs_f_flush(struct file *file, fl_
7239 -/*++======================================================================*/
7240 -int Novfs_f_release(struct inode *inode, struct file *file)
7252 - *========================================================================*/
7253 +int novfs_f_release(struct inode *inode, struct file *file)
7255 int retCode = -EACCES;
7256 - session_t session;
7257 + struct novfs_schandle session;
7258 struct inode_data *id;
7260 - DbgPrint("Novfs_f_release: path=%.*s handle=%p\n",
7261 + DbgPrint("novfs_f_release: path=%.*s handle=%p\n",
7262 file->f_dentry->d_name.len,
7263 file->f_dentry->d_name.name, file->private_data);
7265 - if (inode && (id = inode->FSPRIVATE)) {
7266 - session = Scope_Get_SessionId(id->Scope);
7267 + if (inode && (id = inode->i_private)) {
7268 + session = novfs_scope_get_sessionId(id->Scope);
7269 if (0 == SC_PRESENT(session)) {
7270 - id->Scope = Scope_Get_ScopefromPath(file->f_dentry);
7271 - session = Scope_Get_SessionId(id->Scope);
7272 + id->Scope = novfs_get_scope(file->f_dentry);
7273 + session = novfs_scope_get_sessionId(id->Scope);
7276 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
7278 - ("Novfs_f_release: %.*s f_flags=0%o f_mode=0%o i_mode=0%o\n",
7279 + ("novfs_f_release: %.*s f_flags=0%o f_mode=0%o i_mode=0%o\n",
7280 file->f_dentry->d_name.len,
7281 file->f_dentry->d_name.name, file->f_flags,
7282 file->f_mode, inode->i_mode);
7284 if (inode->i_mapping && inode->i_mapping->nrpages) {
7286 - DbgPrint("Novfs_f_release: %.*s pages=%lu\n",
7287 + DbgPrint("novfs_f_release: %.*s pages=%lu\n",
7288 file->f_dentry->d_name.len,
7289 file->f_dentry->d_name.name,
7290 inode->i_mapping->nrpages);
7291 @@ -2111,7 +1690,7 @@ int Novfs_f_release(struct inode *inode,
7292 filemap_fdatawrite(file->f_dentry->
7293 d_inode->i_mapping);
7295 - Novfs_flush_mapping(file->private_data,
7296 + novfs_flush_mapping(file->private_data,
7300 @@ -2123,40 +1702,27 @@ int Novfs_f_release(struct inode *inode,
7301 invalidate_remote_inode(file->f_dentry->d_inode);
7304 - retCode = Novfs_Close_File(file->private_data, session);
7305 + retCode = novfs_close_file(file->private_data, session);
7306 //id->FileHandle = 0;
7311 -int Novfs_f_fsync(struct file *file, struct dentry *dentry, int datasync)
7312 +int novfs_f_fsync(struct file *file, struct dentry *dentry, int datasync)
7317 -/*++======================================================================*/
7318 -int Novfs_f_llseek(struct file *file, loff_t offset, int origin)
7330 - *========================================================================*/
7331 +int novfs_f_llseek(struct file *file, loff_t offset, int origin)
7333 - DbgPrint("Novfs_f_llseek: File=0x%p Name=%.*s offset=%lld origin=%d\n",
7334 + DbgPrint("novfs_f_llseek: File=0x%p Name=%.*s offset=%lld origin=%d\n",
7335 file, file->f_dentry->d_name.len, file->f_dentry->d_name.name,
7337 return (generic_file_llseek(file, offset, origin));
7340 /*++======================================================================*/
7341 -int Novfs_f_lock(struct file *file, int cmd, struct file_lock *lock)
7342 +int novfs_f_lock(struct file *file, int cmd, struct file_lock *lock)
7345 * "file" - pointer to file structure - contains file handle in "file->private_data"
7346 @@ -2179,24 +1745,23 @@ int Novfs_f_lock(struct file *file, int
7347 * but xtier functions in novfsd "NCFsdLockFile" and "NCFsdUnlockFile"
7348 * receive arguments in u64 type.
7352 *========================================================================*/
7356 struct inode *inode;
7357 - session_t session;
7358 + struct novfs_schandle session;
7359 struct inode_data *id;
7362 - DbgPrint("Novfs_f_lock(0x%p): begin in Novfs_f_lock 0x%p\n",
7363 + DbgPrint("novfs_f_lock(0x%p): begin in novfs_f_lock 0x%p\n",
7364 __builtin_return_address(0), file->private_data);
7366 - ("Novfs_f_lock: cmd = %d, F_GETLK = %d, F_SETLK = %d, F_SETLKW = %d\n",
7367 + ("novfs_f_lock: cmd = %d, F_GETLK = %d, F_SETLK = %d, F_SETLKW = %d\n",
7368 cmd, F_GETLK, F_SETLK, F_SETLKW);
7370 - ("Novfs_f_lock: lock->fl_start = 0x%llX, lock->fl_end = 0x%llX\n",
7371 + ("novfs_f_lock: lock->fl_start = 0x%llX, lock->fl_end = 0x%llX\n",
7372 lock->fl_start, lock->fl_end);
7375 @@ -2209,17 +1774,17 @@ int Novfs_f_lock(struct file *file, int
7377 if (file->f_dentry &&
7378 (inode = file->f_dentry->d_inode) &&
7379 - (id = (struct inode_data *)inode->FSPRIVATE)) {
7380 - DbgPrint("Novfs_f_lock: (0x%p 0x%p %.*s)\n",
7381 + (id = (struct inode_data *) inode->i_private)) {
7382 + DbgPrint("novfs_f_lock: (0x%p 0x%p %.*s)\n",
7383 file->private_data, inode,
7384 file->f_dentry->d_name.len,
7385 file->f_dentry->d_name.name);
7387 - session = Scope_Get_SessionId(id->Scope);
7388 + session = novfs_scope_get_sessionId(id->Scope);
7389 if (0 == SC_PRESENT(session)) {
7391 - Scope_Get_ScopefromPath(file->f_dentry);
7392 - session = Scope_Get_SessionId(id->Scope);
7393 + novfs_get_scope(file->f_dentry);
7394 + session = novfs_scope_get_sessionId(id->Scope);
7397 /* fl_type = F_RDLCK, F_WRLCK, F_UNLCK */
7398 @@ -2230,7 +1795,7 @@ int Novfs_f_lock(struct file *file, int
7402 - Novfs_Set_File_Lock(session,
7403 + novfs_set_file_lock(session,
7406 lock->fl_start, len);
7407 @@ -2241,7 +1806,7 @@ int Novfs_f_lock(struct file *file, int
7411 - Novfs_Set_File_Lock(session,
7412 + novfs_set_file_lock(session,
7415 lock->fl_start, len);
7416 @@ -2259,16 +1824,16 @@ int Novfs_f_lock(struct file *file, int
7420 - ("<1> novfs in Novfs_f_lock, not implemented cmd = %d\n",
7421 + ("<1> novfs in novfs_f_lock, not implemented cmd = %d\n",
7424 - ("Novfs_f_lock: novfs in Novfs_f_lock, not implemented cmd = %d\n",
7425 + ("novfs_f_lock: novfs in novfs_f_lock, not implemented cmd = %d\n",
7431 - DbgPrint("Novfs_f_lock: lock->fl_type = %u, err_code 0x%X\n",
7432 + DbgPrint("novfs_f_lock: lock->fl_type = %u, err_code 0x%X\n",
7433 lock->fl_type, err_code);
7435 if ((err_code != 0) && (err_code != -1)
7436 @@ -2283,21 +1848,9 @@ int Novfs_f_lock(struct file *file, int
7439 /*++======================================================================*/
7440 -static void Novfs_copy_cache_pages(struct address_space *mapping,
7441 +static void novfs_copy_cache_pages(struct address_space *mapping,
7442 struct list_head *pages, int bytes_read,
7443 char *data, struct pagevec *plru_pvec)
7455 - *========================================================================*/
7459 @@ -2340,30 +1893,17 @@ static void Novfs_copy_cache_pages(struc
7463 -/*++======================================================================*/
7464 -int Novfs_a_writepage(struct page *page, struct writeback_control *wbc)
7476 - *========================================================================*/
7477 +int novfs_a_writepage(struct page *page, struct writeback_control *wbc)
7479 int retCode = -EFAULT;
7480 struct inode *inode = page->mapping->host;
7481 - struct inode_data *id = inode->FSPRIVATE;
7482 + struct inode_data *id = inode->i_private;
7483 loff_t pos = ((loff_t) page->index << PAGE_CACHE_SHIFT);
7484 - session_t session;
7485 - struct data_list dlst[2];
7486 + struct novfs_schandle session;
7487 + struct novfs_data_list dlst[2];
7488 size_t len = PAGE_CACHE_SIZE;
7490 - session = Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
7491 + session = novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->Scope);
7493 page_cache_get(page);
7495 @@ -2384,7 +1924,7 @@ int Novfs_a_writepage(struct page *page,
7496 len = (size_t) (i_size_read(inode) - pos);
7499 - retCode = Novfs_Write_Pages(id->FileHandle, dlst, 2, len, pos, session);
7500 + retCode = novfs_write_pages(id->FileHandle, dlst, 2, len, pos, session);
7502 SetPageUptodate(page);
7504 @@ -2395,32 +1935,18 @@ int Novfs_a_writepage(struct page *page,
7508 -/*++======================================================================*/
7509 -int Novfs_a_writepages(struct address_space *mapping,
7510 +int novfs_a_writepages(struct address_space *mapping,
7511 struct writeback_control *wbc)
7523 - *========================================================================*/
7526 struct inode *inode = mapping->host;
7527 - session_t session;
7529 + struct novfs_schandle session;
7531 struct inode_data *id = NULL;
7533 - int max_page_lookup = MaxIoSize / PAGE_CACHE_SIZE;
7534 + int max_page_lookup = novfs_max_iosize / PAGE_CACHE_SIZE;
7536 - struct data_list *dlist;
7537 - struct data_list *dlptr;
7538 + struct novfs_data_list *dlist, *dlptr;
7539 struct page **pages;
7541 int dlist_idx, i = 0;
7542 @@ -2430,31 +1956,32 @@ int Novfs_a_writepages(struct address_sp
7544 SC_INITIALIZE(session);
7546 - ("Novfs_a_writepages: inode=0x%p mapping=0x%p wbc=0x%p nr_to_write=%d\n",
7547 + ("novfs_a_writepages: inode=0x%p mapping=0x%p wbc=0x%p nr_to_write=%d\n",
7548 inode, mapping, wbc, wbc->nr_to_write);
7551 DbgPrint(" Inode=0x%p Ino=%d Id=0x%p\n", inode, inode->i_ino,
7552 - inode->FSPRIVATE);
7553 + inode->i_private);
7555 - if (NULL != (id = inode->FSPRIVATE)) {
7556 + if (NULL != (id = inode->i_private)) {
7558 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
7559 - fh = ((struct inode_data *)inode->FSPRIVATE)->FileHandle;
7560 + novfs_scope_get_sessionId(((struct inode_data *) inode->
7561 + i_private)->Scope);
7562 + fh = ((struct inode_data *) inode->i_private)->FileHandle;
7566 - dlist = Novfs_Malloc(sizeof(struct data_list) * max_page_lookup, GFP_KERNEL);
7567 + dlist = kmalloc(sizeof(struct novfs_data_list) * max_page_lookup, GFP_KERNEL);
7569 - Novfs_Malloc(sizeof(struct page *) * max_page_lookup, GFP_KERNEL);
7570 + kmalloc(sizeof(struct page *) * max_page_lookup, GFP_KERNEL);
7574 - ("Novfs_a_writepages: inode=0x%p fh=0x%p dlist=0x%p pages=0x%p %s\n",
7575 + ("novfs_a_writepages: inode=0x%p fh=0x%p dlist=0x%p pages=0x%p %s\n",
7576 inode, fh, dlist, pages, id->Name);
7579 - ("Novfs_a_writepages: inode=0x%p fh=0x%p dlist=0x%p pages=0x%p\n",
7580 + ("novfs_a_writepages: inode=0x%p fh=0x%p dlist=0x%p pages=0x%p\n",
7581 inode, fh, dlist, pages);
7583 if (dlist && pages) {
7584 @@ -2481,13 +2008,13 @@ int Novfs_a_writepages(struct address_sp
7588 - DbgPrint("Novfs_a_writepages1: nr_pages=%d\n",
7589 + DbgPrint("novfs_a_writepages1: nr_pages=%d\n",
7593 sizeof(struct page *) * max_page_lookup);
7595 - AS_TREE_LOCK(&mapping->tree_lock);
7596 + read_lock_irq(&mapping->tree_lock);
7599 * Need to ask for one less then max_page_lookup or we
7600 @@ -2503,7 +2030,7 @@ int Novfs_a_writepages(struct address_sp
7602 PAGECACHE_TAG_DIRTY);
7604 - DbgPrint("Novfs_a_writepages2: nr_pages=%d\n",
7605 + DbgPrint("novfs_a_writepages2: nr_pages=%d\n",
7608 * Check to see if there are dirty pages and there is a valid
7609 @@ -2513,7 +2040,7 @@ int Novfs_a_writepages(struct address_sp
7610 set_bit(AS_EIO, &mapping->flags);
7613 - ("Novfs_a_writepage: set_bit AS_EIO\n");
7614 + ("novfs_a_writepage: set_bit AS_EIO\n");
7618 @@ -2521,7 +2048,7 @@ int Novfs_a_writepages(struct address_sp
7619 page_cache_get(pages[i]);
7622 - AS_TREE_UNLOCK(&mapping->tree_lock);
7623 + read_unlock_irq(&mapping->tree_lock);
7626 index = pages[nr_pages - 1]->index + 1;
7627 @@ -2561,7 +2088,7 @@ int Novfs_a_writepages(struct address_sp
7631 - ("Novfs_a_writepages: pos=0x%llx index=%d page->index=%d next_index=%d\n",
7632 + ("novfs_a_writepages: pos=0x%llx index=%d page->index=%d next_index=%d\n",
7633 pos, index, page->index, next_index);
7635 if (page->index != next_index) {
7636 @@ -2588,11 +2115,11 @@ int Novfs_a_writepages(struct address_sp
7637 dlptr[dlist_idx].rwflag = DLREAD;
7640 - ("Novfs_a_writepages: Add page=0x%p index=0x%lx\n",
7641 + ("novfs_a_writepages: Add page=0x%p index=0x%lx\n",
7645 - DbgPrint("Novfs_a_writepages: dlist_idx=%d\n",
7646 + DbgPrint("novfs_a_writepages: dlist_idx=%d\n",
7649 tsize = dlist_idx * PAGE_CACHE_SIZE;
7650 @@ -2605,7 +2132,7 @@ int Novfs_a_writepages(struct address_sp
7654 - Novfs_Write_Pages(fh, dlist, dlist_idx + 1,
7655 + novfs_write_pages(fh, dlist, dlist_idx + 1,
7656 tsize, pos, session);
7659 @@ -2630,7 +2157,7 @@ int Novfs_a_writepages(struct address_sp
7663 - ("Novfs_a_writepages: release page=0x%p index=0x%lx\n",
7664 + ("novfs_a_writepages: release page=0x%p index=0x%lx\n",
7665 dlptr[dlist_idx - 1].page,
7668 @@ -2649,7 +2176,7 @@ int Novfs_a_writepages(struct address_sp
7669 mapping->writeback_index = index;
7672 - DbgPrint("Novfs_a_writepage: set_bit AS_EIO\n");
7673 + DbgPrint("novfs_a_writepage: set_bit AS_EIO\n");
7674 set_bit(AS_EIO, &mapping->flags);
7677 @@ -2657,25 +2184,12 @@ int Novfs_a_writepages(struct address_sp
7681 - DbgPrint("Novfs_a_writepage: retCode=%d\n", retCode);
7682 + DbgPrint("novfs_a_writepage: retCode=%d\n", retCode);
7687 -/*++======================================================================*/
7688 -int Novfs_a_readpage(struct file *file, struct page *page)
7700 - *========================================================================*/
7701 +int novfs_a_readpage(struct file *file, struct page *page)
7705 @@ -2683,10 +2197,10 @@ int Novfs_a_readpage(struct file *file,
7706 struct dentry *dentry = NULL;
7709 - session_t session;
7710 + struct novfs_schandle session;
7712 SC_INITIALIZE(session);
7713 - DbgPrint("Novfs_a_readpage: File=0x%p Name=%.*s Page=0x%p", file,
7714 + DbgPrint("novfs_a_readpage: File=0x%p Name=%.*s Page=0x%p", file,
7715 file->f_dentry->d_name.len, file->f_dentry->d_name.name, page);
7717 dentry = file->f_dentry;
7718 @@ -2702,14 +2216,16 @@ int Novfs_a_readpage(struct file *file,
7720 DbgPrint(" Inode=0x%p Ino=%d", inode, inode->i_ino);
7722 - if (inode->FSPRIVATE) {
7723 + if (inode->i_private) {
7725 - Scope_Get_SessionId(((struct inode_data *)inode->
7726 - FSPRIVATE)->Scope);
7727 + novfs_scope_get_sessionId(((struct inode_data *) inode->
7728 + i_private)->Scope);
7729 if (0 == SC_PRESENT(session)) {
7730 - ((struct inode_data *)inode->FSPRIVATE)->Scope =
7731 - Scope_Get_ScopefromPath(file->f_dentry);
7732 - session = Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
7733 + ((struct inode_data *) inode->i_private)->Scope =
7734 + novfs_get_scope(file->f_dentry);
7736 + novfs_scope_get_sessionId(((struct inode_data *) inode->
7737 + i_private)->Scope);
7741 @@ -2717,7 +2233,7 @@ int Novfs_a_readpage(struct file *file,
7744 if (!PageUptodate(page)) {
7745 - struct data_list dlst[2];
7746 + struct novfs_data_list dlst[2];
7748 offset = page->index << PAGE_CACHE_SHIFT;
7749 len = PAGE_CACHE_SIZE;
7750 @@ -2730,10 +2246,10 @@ int Novfs_a_readpage(struct file *file,
7751 dlst[1].len = PAGE_CACHE_SIZE;
7752 dlst[1].rwflag = DLWRITE;
7754 - DbgPrint("Novfs_a_readpage: calling= Novfs_Read_Pages %lld\n",
7755 + DbgPrint("novfs_a_readpage: calling= novfs_Read_Pages %lld\n",
7758 - Novfs_Read_Pages(file->private_data, dlst, 2, &len, &offset,
7759 + novfs_read_pages(file->private_data, dlst, 2, &len, &offset,
7761 if (len && (len < PAGE_CACHE_SIZE)) {
7762 pbuf = kmap_atomic(page, KM_USER0);
7763 @@ -2746,31 +2262,18 @@ int Novfs_a_readpage(struct file *file,
7767 - DbgPrint("Novfs_a_readpage: retCode=%d\n", retCode);
7768 + DbgPrint("novfs_a_readpage: retCode=%d\n", retCode);
7773 -/*++======================================================================*/
7774 -int Novfs_a_readpages(struct file *file, struct address_space *mapping,
7775 +int novfs_a_readpages(struct file *file, struct address_space *mapping,
7776 struct list_head *page_lst, unsigned nr_pages)
7788 - *========================================================================*/
7791 struct inode *inode = NULL;
7792 struct dentry *dentry = NULL;
7793 - session_t session;
7794 + struct novfs_schandle session;
7798 @@ -2781,7 +2284,7 @@ int Novfs_a_readpages(struct file *file,
7799 char *rbuf, done = 0;
7800 SC_INITIALIZE(session);
7802 - DbgPrint("Novfs_a_readpages: File=0x%p Name=%.*s Pages=%d\n", file,
7803 + DbgPrint("novfs_a_readpages: File=0x%p Name=%.*s Pages=%d\n", file,
7804 file->f_dentry->d_name.len, file->f_dentry->d_name.name,
7807 @@ -2798,21 +2301,21 @@ int Novfs_a_readpages(struct file *file,
7809 DbgPrint(" Inode=0x%p Ino=%d\n", inode, inode->i_ino);
7811 - if (inode->FSPRIVATE) {
7812 + if (inode->i_private) {
7814 - Scope_Get_SessionId(((struct inode_data *)inode->
7815 - FSPRIVATE)->Scope);
7816 + novfs_scope_get_sessionId(((struct inode_data *) inode->
7817 + i_private)->Scope);
7818 if (0 == SC_PRESENT(session)) {
7819 - ((struct inode_data *) inode->FSPRIVATE)->Scope =
7820 - Scope_Get_ScopefromPath(file->f_dentry);
7821 + ((struct inode_data *) inode->i_private)->Scope =
7822 + novfs_get_scope(file->f_dentry);
7824 - Scope_Get_SessionId(((struct inode_data *) inode->
7825 - FSPRIVATE)->Scope);
7826 + novfs_scope_get_sessionId(((struct inode_data *) inode->
7827 + i_private)->Scope);
7832 - rbuf = (char *)Novfs_Malloc(MaxIoSize, GFP_KERNEL);
7833 + rbuf = kmalloc(novfs_max_iosize, GFP_KERNEL);
7835 pagevec_init(&lru_pvec, 0);
7836 for (page_idx = 0; page_idx < nr_pages && !done;) {
7837 @@ -2832,7 +2335,7 @@ int Novfs_a_readpages(struct file *file,
7839 list_for_each_entry_reverse(tpage, page_lst, lru) {
7840 if ((next_index != tpage->index) ||
7841 - (len >= MaxIoSize - PAGE_SIZE)) {
7842 + (len >= novfs_max_iosize - PAGE_SIZE)) {
7846 @@ -2840,7 +2343,7 @@ int Novfs_a_readpages(struct file *file,
7850 - struct data_list dllst[2];
7851 + struct novfs_data_list dllst[2];
7853 dllst[1].page = NULL;
7854 dllst[1].offset = rbuf;
7855 @@ -2848,12 +2351,12 @@ int Novfs_a_readpages(struct file *file,
7856 dllst[1].rwflag = DLWRITE;
7859 - ("Novfs_a_readpages: calling Novfs_Read_Pages %lld\n",
7860 + ("novfs_a_readpages: calling novfs_Read_Pages %lld\n",
7862 - if (!Novfs_Read_Pages
7863 + if (!novfs_read_pages
7864 (file->private_data, dllst, 2, &len,
7865 &offset, session)) {
7866 - Novfs_copy_cache_pages(mapping,
7867 + novfs_copy_cache_pages(mapping,
7870 page_idx += len >> PAGE_CACHE_SHIFT;
7871 @@ -2886,37 +2389,24 @@ int Novfs_a_readpages(struct file *file,
7875 - DbgPrint("Novfs_a_readpages: retCode=%d\n", retCode);
7876 + DbgPrint("novfs_a_readpages: retCode=%d\n", retCode);
7881 -/*++======================================================================*/
7882 -int Novfs_a_prepare_write(struct file *file, struct page *page, unsigned from,
7883 +int novfs_a_prepare_write(struct file *file, struct page *page, unsigned from,
7896 - *========================================================================*/
7899 loff_t offset = (loff_t) page->index << PAGE_CACHE_SHIFT;
7900 size_t len = PAGE_CACHE_SIZE;
7901 - session_t session;
7902 - struct data_list dllst[2];
7903 + struct novfs_schandle session;
7904 + struct novfs_data_list dllst[2];
7905 struct inode *inode = file->f_dentry->d_inode;
7906 SC_INITIALIZE(session);
7909 - ("Novfs_a_prepare_write: File=0x%p Page=0x%p offset=0x%llx From=%u To=%u filesize=%lld\n",
7910 + ("novfs_a_prepare_write: File=0x%p Page=0x%p offset=0x%llx From=%u To=%u filesize=%lld\n",
7911 file, page, offset, from, to,
7912 i_size_read(file->f_dentry->d_inode));
7913 if (!PageUptodate(page)) {
7914 @@ -2935,12 +2425,18 @@ int Novfs_a_prepare_write(struct file *f
7917 if (file->f_dentry && file->f_dentry->d_inode) {
7918 - if (file->f_dentry->d_inode->FSPRIVATE) {
7919 + if (file->f_dentry->d_inode->i_private) {
7921 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
7922 + novfs_scope_get_sessionId(((struct inode_data *)
7926 if (0 == SC_PRESENT(session)) {
7927 - ((struct inode_data *)inode->FSPRIVATE)->Scope = Scope_Get_ScopefromPath(file->f_dentry);
7928 - session = Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
7929 + ((struct inode_data *) inode->
7930 + i_private)->Scope =
7931 + novfs_get_scope(file->f_dentry);
7933 + novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->Scope);
7937 @@ -2963,9 +2459,9 @@ int Novfs_a_prepare_write(struct file *f
7938 dllst[1].rwflag = DLWRITE;
7941 - ("Novfs_a_prepare_write: calling Novfs_Read_Pages %lld\n",
7942 + ("novfs_a_prepare_write: calling novfs_Read_Pages %lld\n",
7944 - Novfs_Read_Pages(file->private_data, dllst, 2,
7945 + novfs_read_pages(file->private_data, dllst, 2,
7946 &len, &offset, session);
7949 @@ -2987,50 +2483,37 @@ int Novfs_a_prepare_write(struct file *f
7950 memset(adr + to, 0, PAGE_CACHE_SIZE - to);
7951 kunmap_atomic(adr, KM_USER0);
7953 - DbgPrint("Novfs_a_prepare_write: memset 0x%p\n", adr);
7954 + DbgPrint("novfs_a_prepare_write: memset 0x%p\n", adr);
7956 flush_dcache_page(page);
7957 SetPageUptodate(page);
7959 -// DbgPrint("Novfs_a_prepare_write: return %d\n", retVal);
7960 +// DbgPrint("novfs_a_prepare_write: return %d\n", retVal);
7964 -/*++======================================================================*/
7965 -int Novfs_a_commit_write(struct file *file, struct page *page, unsigned offset,
7966 +int novfs_a_commit_write(struct file *file, struct page *page, unsigned offset,
7979 - *========================================================================*/
7982 struct inode *inode = page->mapping->host;
7983 loff_t pos = ((loff_t) page->index << PAGE_CACHE_SHIFT) + to;
7984 - session_t session;
7985 + struct novfs_schandle session;
7986 struct inode_data *id;
7987 - struct data_list dlst[1];
7988 + struct novfs_data_list dlst[1];
7989 size_t len = to - offset;
7991 SC_INITIALIZE(session);
7994 - ("Novfs_a_commit_write: File=0x%p Page=0x%p offset=0x%x To=%u filesize=%lld\n",
7995 + ("novfs_a_commit_write: File=0x%p Page=0x%p offset=0x%x To=%u filesize=%lld\n",
7996 file, page, offset, to, i_size_read(file->f_dentry->d_inode));
7997 if (file->f_dentry->d_inode
7998 - && (id = file->f_dentry->d_inode->FSPRIVATE)) {
7999 - session = Scope_Get_SessionId(id->Scope);
8000 + && (id = file->f_dentry->d_inode->i_private)) {
8001 + session = novfs_scope_get_sessionId(id->Scope);
8002 if (0 == SC_PRESENT(session)) {
8003 - id->Scope = Scope_Get_ScopefromPath(file->f_dentry);
8004 - session = Scope_Get_SessionId(id->Scope);
8005 + id->Scope = novfs_get_scope(file->f_dentry);
8006 + session = novfs_scope_get_sessionId(id->Scope);
8010 @@ -3055,7 +2538,7 @@ int Novfs_a_commit_write(struct file *fi
8011 dlst[0].rwflag = DLREAD;
8014 - Novfs_Write_Pages(id->FileHandle, dlst, 1, len, pos,
8015 + novfs_write_pages(id->FileHandle, dlst, 1, len, pos,
8019 @@ -3067,51 +2550,32 @@ int Novfs_a_commit_write(struct file *fi
8022 /*++======================================================================*/
8023 -ssize_t Novfs_a_direct_IO(int rw, struct kiocb * kiocb,
8024 +ssize_t novfs_a_direct_IO(int rw, struct kiocb * kiocb,
8025 const struct iovec * iov,
8026 loff_t offset, unsigned long nr_segs)
8034 * Notes: This is a dummy function so that we can allow a file
8035 - * to get the direct IO flag set. Novfs_f_read and
8036 - * Novfs_f_write will do the work. Maybe not the best
8037 + * to get the direct IO flag set. novfs_f_read and
8038 + * novfs_f_write will do the work. Maybe not the best
8039 * way to do but it was the easiest to implement.
8043 *========================================================================*/
8048 /*++======================================================================*/
8049 -int Novfs_i_create(struct inode *dir, struct dentry *dentry, int mode,
8050 +int novfs_i_create(struct inode *dir, struct dentry *dentry, int mode,
8051 struct nameidata *nd)
8063 - *========================================================================*/
8066 - struct entry_info info;
8068 - session_t session;
8069 + struct novfs_entry_info info;
8071 + struct novfs_schandle session;
8072 int retCode = -EACCES;
8074 - DbgPrint("Novfs_i_create: mode=0%o flags=0%o %.*s\n", mode,
8075 + DbgPrint("novfs_i_create: mode=0%o flags=0%o %.*s\n", mode,
8076 nd->NDOPENFLAGS, dentry->d_name.len, dentry->d_name.name);
8078 if (IS_ROOT(dentry) || /* Root */
8079 @@ -3122,38 +2586,42 @@ int Novfs_i_create(struct inode *dir, st
8082 if (mode | S_IFREG) {
8083 - if (dir->FSPRIVATE) {
8084 + if (dir->i_private) {
8086 - Scope_Get_SessionId(((struct inode_data *)dir->FSPRIVATE)->
8087 + novfs_scope_get_sessionId(((struct inode_data *) dir->i_private)->
8089 if (0 == SC_PRESENT(session)) {
8090 - ((struct inode_data *) dir->FSPRIVATE)->Scope =
8091 - Scope_Get_ScopefromPath(dentry);
8092 - session = Scope_Get_SessionId(((struct inode_data *)dir->FSPRIVATE)->Scope);
8093 + ((struct inode_data *) dir->i_private)->Scope =
8094 + novfs_get_scope(dentry);
8096 + novfs_scope_get_sessionId(((struct inode_data *) dir->
8097 + i_private)->Scope);
8101 - (char *)Novfs_Malloc(PATH_LENGTH_BUFFER,
8103 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8106 - Novfs_dget_path(dentry, buf,
8107 + novfs_dget_path(dentry, buf,
8108 PATH_LENGTH_BUFFER);
8111 - Novfs_Open_File(path,
8112 + novfs_open_file(path,
8117 if (!retCode && handle) {
8118 - Novfs_Close_File(handle,
8119 + novfs_close_file(handle,
8121 - if (!Novfs_i_mknod
8122 + if (!novfs_i_mknod
8124 mode | S_IFREG, 0)) {
8125 if (dentry->d_inode) {
8126 - ((struct inode_data *)dentry->d_inode->FSPRIVATE)->Flags |= UPDATE_INODE;
8127 + ((struct inode_data *)
8131 + Flags |= UPDATE_INODE;
8135 @@ -3165,20 +2633,7 @@ int Novfs_i_create(struct inode *dir, st
8139 -/*++======================================================================*/
8140 -void update_inode(struct inode *Inode, struct entry_info *Info)
8152 - *========================================================================*/
8153 +void update_inode(struct inode *Inode, struct novfs_entry_info *Info)
8155 static char dbuf[128];
8157 @@ -3219,35 +2674,24 @@ void update_inode(struct inode *Inode, s
8158 Inode->i_mtime = Info->mtime;
8160 if (Inode->i_size && Inode->i_sb->s_blocksize) {
8161 - Inode->i_blocks = (unsigned long) (Info->size >> (loff_t) Inode->i_blkbits);
8163 + (unsigned long) (Info->size >> (loff_t) Inode->i_blkbits);
8164 Inode->i_bytes = Info->size & (Inode->i_sb->s_blocksize - 1);
8166 - DbgPrint("update_inode: i_sb->s_blocksize=%d\n", Inode->i_sb->s_blocksize);
8167 + DbgPrint("update_inode: i_sb->s_blocksize=%d\n",
8168 + Inode->i_sb->s_blocksize);
8169 DbgPrint("update_inode: i_blkbits=%d\n", Inode->i_blkbits);
8170 DbgPrint("update_inode: i_blocks=%d\n", Inode->i_blocks);
8171 DbgPrint("update_inode: i_bytes=%d\n", Inode->i_bytes);
8175 -/*++======================================================================*/
8176 -struct dentry *Novfs_i_lookup(struct inode *dir, struct dentry *dentry,
8177 +struct dentry *novfs_i_lookup(struct inode *dir, struct dentry *dentry,
8178 struct nameidata *nd)
8190 - *========================================================================*/
8192 struct dentry *retVal = ERR_PTR(-ENOENT);
8193 struct dentry *parent;
8194 - struct entry_info *info = NULL;
8195 + struct novfs_entry_info *info = NULL;
8196 struct inode_data *id;
8197 struct inode *inode = NULL;
8198 uid_t uid = current->euid;
8199 @@ -3255,49 +2699,49 @@ struct dentry *Novfs_i_lookup(struct ino
8203 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8204 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8207 - path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8208 + path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8211 - ("Novfs_i_lookup: dir 0x%p %d hash %d inode 0x%0p %s\n",
8212 + ("novfs_i_lookup: dir 0x%p %d hash %d inode 0x%0p %s\n",
8213 dir, dir->i_ino, dentry->d_name.hash,
8214 dentry->d_inode, path);
8219 - ("Novfs_i_lookup: dir 0x%p %d name %.*s hash %d inode 0x%0p\n",
8220 + ("novfs_i_lookup: dir 0x%p %d name %.*s hash %d inode 0x%0p\n",
8221 dir, dir->i_ino, dentry->d_name.len, dentry->d_name.name,
8222 dentry->d_name.hash, dentry->d_inode);
8225 if ((dentry->d_name.len == 7)
8226 && (0 == strncmp(dentry->d_name.name, " !xover", 7))) {
8227 - dentry->d_op = &Novfs_dentry_operations;
8228 + dentry->d_op = &novfs_dentry_operations;
8233 if ((dentry->d_name.len == 7)
8234 && (0 == strncmp(dentry->d_name.name, "z!xover", 7))) {
8235 - dentry->d_op = &Novfs_dentry_operations;
8236 + dentry->d_op = &novfs_dentry_operations;
8242 - if (dir && (id = dir->FSPRIVATE)) {
8243 + if (dir && (id = dir->i_private)) {
8245 if (IS_ROOT(dentry)) {
8246 - DbgPrint("Novfs_i_lookup: Root entry=0x%p\n",
8248 - inode = Novfs_root->d_inode;
8249 + DbgPrint("novfs_i_lookup: Root entry=0x%p\n",
8251 + inode = novfs_root->d_inode;
8255 - Novfs_Malloc(sizeof(struct entry_info) +
8256 + kmalloc(sizeof(struct novfs_entry_info) +
8257 PATH_LENGTH_BUFFER, GFP_KERNEL);
8260 @@ -3305,10 +2749,10 @@ struct dentry *Novfs_i_lookup(struct ino
8261 ERR_PTR(verify_dentry(dentry, 1)))) {
8262 name.name = dentry->d_name.name;
8263 name.len = dentry->d_name.len;
8264 - name.hash = Novfs_internal_hash(&name);
8265 + name.hash = novfs_internal_hash(&name);
8267 - if (Novfs_lock_inode_cache(dir)) {
8268 - if (!Novfs_get_entry
8269 + if (novfs_lock_inode_cache(dir)) {
8270 + if (!novfs_get_entry
8271 (dir, &name, &ino, info)) {
8274 @@ -3319,21 +2763,21 @@ struct dentry *Novfs_i_lookup(struct ino
8278 - Novfs_unlock_inode_cache(dir);
8279 + novfs_unlock_inode_cache(dir);
8282 if (!inode && ino) {
8283 - uid = Scope_Get_Uid(id->Scope);
8284 - if (Novfs_lock_inode_cache(dir)) {
8285 - inode = Novfs_get_inode (dentry->d_sb, info->mode, 0, uid, ino, &name);
8286 + uid = novfs_scope_get_uid(id->Scope);
8287 + if (novfs_lock_inode_cache(dir)) {
8288 + inode = novfs_get_inode (dentry->d_sb, info->mode, 0, uid, ino, &name);
8290 - if (!Novfs_get_entry(dir, &dentry->d_name, &ino, info)) {
8291 + if (!novfs_get_entry(dir, &dentry->d_name, &ino, info)) {
8297 - Novfs_unlock_inode_cache
8298 + novfs_unlock_inode_cache
8302 @@ -3343,10 +2787,10 @@ struct dentry *Novfs_i_lookup(struct ino
8306 - dentry->d_op = &Novfs_dentry_operations;
8307 + dentry->d_op = &novfs_dentry_operations;
8309 parent = dget_parent(dentry);
8310 - Novfs_d_add(dentry->d_parent, dentry, inode, 1);
8311 + novfs_d_add(dentry->d_parent, dentry, inode, 1);
8314 d_add(dentry, inode);
8315 @@ -3357,42 +2801,29 @@ struct dentry *Novfs_i_lookup(struct ino
8319 - ("Novfs_i_lookup: inode=0x%p dentry->d_inode=0x%p return=0x%p\n",
8320 + ("novfs_i_lookup: inode=0x%p dentry->d_inode=0x%p return=0x%p\n",
8321 dir, dentry->d_inode, retVal);
8326 -/*++======================================================================*/
8327 -int Novfs_i_unlink(struct inode *dir, struct dentry *dentry)
8339 - *========================================================================*/
8340 +int novfs_i_unlink(struct inode *dir, struct dentry *dentry)
8342 int retCode = -ENOENT;
8343 struct inode *inode;
8344 - session_t session;
8345 + struct novfs_schandle session;
8349 - DbgPrint("Novfs_i_unlink: dir=0x%p dir->i_ino=%d %.*s\n", dir,
8350 + DbgPrint("novfs_i_unlink: dir=0x%p dir->i_ino=%d %.*s\n", dir,
8351 dir->i_ino, dentry->d_name.len, dentry->d_name.name);
8352 - DbgPrint("Novfs_i_unlink: IS_ROOT(dentry)=%d\n", IS_ROOT(dentry));
8353 - DbgPrint("Novfs_i_unlink: IS_ROOT(dentry->d_parent)=%d\n",
8354 + DbgPrint("novfs_i_unlink: IS_ROOT(dentry)=%d\n", IS_ROOT(dentry));
8355 + DbgPrint("novfs_i_unlink: IS_ROOT(dentry->d_parent)=%d\n",
8356 IS_ROOT(dentry->d_parent));
8357 - DbgPrint("Novfs_i_unlink: IS_ROOT(dentry->d_parent->d_parent)=%d\n",
8358 + DbgPrint("novfs_i_unlink: IS_ROOT(dentry->d_parent->d_parent)=%d\n",
8359 IS_ROOT(dentry->d_parent->d_parent));
8361 - ("Novfs_i_unlink: IS_ROOT(dentry->d_parent->d_parent->d_parent)=%d\n",
8362 + ("novfs_i_unlink: IS_ROOT(dentry->d_parent->d_parent->d_parent)=%d\n",
8363 IS_ROOT(dentry->d_parent->d_parent->d_parent));
8365 if (IS_ROOT(dentry) || /* Root */
8366 @@ -3405,44 +2836,46 @@ int Novfs_i_unlink(struct inode *dir, st
8367 inode = dentry->d_inode;
8370 - ("Novfs_i_unlink: dir=0x%p dir->i_ino=%d inode=0x%p ino=%d\n",
8371 + ("novfs_i_unlink: dir=0x%p dir->i_ino=%d inode=0x%p ino=%d\n",
8372 dir, dir->i_ino, inode, inode->i_ino);
8373 - if (inode->FSPRIVATE) {
8374 + if (inode->i_private) {
8376 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
8377 + novfs_scope_get_sessionId(((struct inode_data *) inode->
8378 + i_private)->Scope);
8379 if (0 == SC_PRESENT(session)) {
8380 - ((struct inode_data *)inode->FSPRIVATE)->Scope = Scope_Get_ScopefromPath(dentry);
8381 - session = Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
8382 + ((struct inode_data *) inode->i_private)->Scope =
8383 + novfs_get_scope(dentry);
8385 + novfs_scope_get_sessionId(((struct inode_data *) inode->
8386 + i_private)->Scope);
8390 - (char *)Novfs_Malloc(PATH_LENGTH_BUFFER,
8392 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8395 - Novfs_dget_path(dentry, buf,
8396 + novfs_dget_path(dentry, buf,
8397 PATH_LENGTH_BUFFER);
8400 - ("Novfs_i_unlink: path %s mode 0%o\n",
8401 + ("novfs_i_unlink: path %s mode 0%o\n",
8402 path, inode->i_mode);
8403 if (IS_ROOT(dentry->d_parent->d_parent)) {
8404 - retCode = do_logout(&dentry->d_name, &session);
8405 + retCode = novfs_daemon_logout(&dentry->d_name, &session);
8408 - Novfs_Delete(path,
8409 + novfs_delete(path,
8414 if (!retCode || IS_DEADDIR(inode)) {
8415 - Novfs_remove_inode_entry(dir,
8416 + novfs_remove_inode_entry(dir,
8422 - Scope_Set_UserSpace(&t64, &t64,
8423 + novfs_scope_set_userspace(&t64, &t64,
8427 @@ -3452,33 +2885,20 @@ int Novfs_i_unlink(struct inode *dir, st
8431 - DbgPrint("Novfs_i_unlink: retCode 0x%x\n", retCode);
8432 + DbgPrint("novfs_i_unlink: retCode 0x%x\n", retCode);
8436 -/*++======================================================================*/
8437 -int Novfs_i_mkdir(struct inode *dir, struct dentry *dentry, int mode)
8449 - *========================================================================*/
8450 +int novfs_i_mkdir(struct inode *dir, struct dentry *dentry, int mode)
8453 - session_t session;
8454 + struct novfs_schandle session;
8456 struct inode *inode;
8457 - struct entry_info info;
8458 + struct novfs_entry_info info;
8461 - DbgPrint("Novfs_i_mkdir: dir=0x%p ino=%d dentry=0x%p %.*s mode=0%lo\n",
8462 + DbgPrint("novfs_i_mkdir: dir=0x%p ino=%d dentry=0x%p %.*s mode=0%lo\n",
8463 dir, dir->i_ino, dentry, dentry->d_name.len,
8464 dentry->d_name.name, mode);
8466 @@ -3491,46 +2911,53 @@ int Novfs_i_mkdir(struct inode *dir, str
8469 mode &= (S_IFMT | S_IRWXU);
8470 - if (dir->FSPRIVATE) {
8471 + if (dir->i_private) {
8473 - Scope_Get_SessionId(((struct inode_data *)dir->FSPRIVATE)->Scope);
8474 + novfs_scope_get_sessionId(((struct inode_data *) dir->i_private)->Scope);
8475 if (0 == SC_PRESENT(session)) {
8476 - ((struct inode_data *)dir->FSPRIVATE)->Scope =
8477 - Scope_Get_ScopefromPath(dentry);
8478 + ((struct inode_data *) dir->i_private)->Scope =
8479 + novfs_get_scope(dentry);
8481 - Scope_Get_SessionId(((struct inode_data *)dir->FSPRIVATE)->Scope);
8482 + novfs_scope_get_sessionId(((struct inode_data *) dir->i_private)->
8486 - uid = Scope_Get_Uid(((struct inode_data *)dir->FSPRIVATE)->Scope);
8487 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8488 + uid = novfs_scope_get_uid(((struct inode_data *) dir->i_private)->Scope);
8489 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8491 - path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8492 + path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8494 - DbgPrint("Novfs_i_mkdir: path %s\n", path);
8495 + DbgPrint("novfs_i_mkdir: path %s\n", path);
8497 - Novfs_Create(path, S_ISDIR(mode), session);
8498 + novfs_create(path, S_ISDIR(mode), session);
8500 - retCode = Novfs_Get_File_Info(path, &info, &session);
8502 + novfs_get_file_info(path, &info,
8505 - retCode = Novfs_i_mknod(dir, dentry, mode, 0);
8507 + novfs_i_mknod(dir, dentry,
8509 inode = dentry->d_inode;
8513 - ((struct inode_data *)inode->FSPRIVATE)->Flags &= ~UPDATE_INODE;
8514 + ((struct inode_data *) inode->
8515 + i_private)->Flags &=
8520 - (File_update_timeout
8521 + (novfs_update_timeout
8524 - Novfs_lock_inode_cache
8525 + novfs_lock_inode_cache
8527 - if (Novfs_update_entry
8528 + if (novfs_update_entry
8532 - Novfs_add_inode_entry
8533 + novfs_add_inode_entry
8537 @@ -3538,7 +2965,7 @@ int Novfs_i_mkdir(struct inode *dir, str
8541 - Novfs_unlock_inode_cache
8542 + novfs_unlock_inode_cache
8546 @@ -3551,39 +2978,13 @@ int Novfs_i_mkdir(struct inode *dir, str
8551 -/*++======================================================================*/
8552 -int Novfs_i_rmdir(struct inode *inode, struct dentry *dentry)
8564 - *========================================================================*/
8566 +int novfs_i_rmdir(struct inode *inode, struct dentry *dentry)
8568 - return (Novfs_i_unlink(inode, dentry));
8569 + return (novfs_i_unlink(inode, dentry));
8572 -/*++======================================================================*/
8573 -int Novfs_i_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
8585 - *========================================================================*/
8586 +int novfs_i_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
8588 struct inode *inode = NULL;
8589 int retCode = -EACCES;
8590 @@ -3597,44 +2998,44 @@ int Novfs_i_mknod(struct inode *dir, str
8594 - if (((struct inode_data *)dir->FSPRIVATE)) {
8595 - uid = Scope_Get_Uid(((struct inode_data *)dir->FSPRIVATE)->Scope);
8596 + if (((struct inode_data *) dir->i_private)) {
8597 + uid = novfs_scope_get_uid(((struct inode_data *) dir->i_private)->Scope);
8598 if (mode & (S_IFREG | S_IFDIR)) {
8600 - Novfs_get_inode(dir->i_sb, mode, dev, uid, 0, &dentry->d_name);
8601 + novfs_get_inode(dir->i_sb, mode, dev, uid, 0, &dentry->d_name);
8605 - struct entry_info info;
8606 + struct novfs_entry_info info;
8608 - dentry->d_op = &Novfs_dentry_operations;
8609 + dentry->d_op = &novfs_dentry_operations;
8610 parent = dget_parent(dentry);
8611 - Novfs_d_add(parent, dentry, inode, 0);
8612 + novfs_d_add(parent, dentry, inode, 0);
8613 memset(&info, 0, sizeof(info));
8614 info.mode = inode->i_mode;
8615 - Novfs_lock_inode_cache(dir);
8616 - Novfs_add_inode_entry(dir, &dentry->d_name, inode->i_ino,
8617 + novfs_lock_inode_cache(dir);
8618 + novfs_add_inode_entry(dir, &dentry->d_name, inode->i_ino,
8620 - Novfs_unlock_inode_cache(dir);
8621 + novfs_unlock_inode_cache(dir);
8627 - DbgPrint("Novfs_i_mknod: return 0x%x\n", retCode);
8628 + DbgPrint("novfs_i_mknod: return 0x%x\n", retCode);
8632 -int Novfs_i_rename(struct inode *odir, struct dentry *od, struct inode *ndir,
8633 +int novfs_i_rename(struct inode *odir, struct dentry *od, struct inode *ndir,
8636 int retCode = -ENOTEMPTY;
8637 char *newpath, *newbuf, *newcon;
8638 char *oldpath, *oldbuf, *oldcon;
8639 struct qstr newname, oldname;
8640 - struct entry_info *info = NULL;
8641 + struct novfs_entry_info *info = NULL;
8643 - session_t session;
8644 + struct novfs_schandle session;
8647 if (IS_ROOT(od) || /* Root */
8648 @@ -3644,29 +3045,29 @@ int Novfs_i_rename(struct inode *odir, s
8652 - DbgPrint("Novfs_i_rename: odir=0x%p ino=%d ndir=0x%p ino=%d\n", odir,
8653 + DbgPrint("novfs_i_rename: odir=0x%p ino=%d ndir=0x%p ino=%d\n", odir,
8654 odir->i_ino, ndir, ndir->i_ino);
8656 - oldbuf = Novfs_Malloc(PATH_LENGTH_BUFFER * 2, GFP_KERNEL);
8657 + oldbuf = kmalloc(PATH_LENGTH_BUFFER * 2, GFP_KERNEL);
8658 newbuf = oldbuf + PATH_LENGTH_BUFFER;
8659 if (oldbuf && newbuf) {
8660 - oldpath = Novfs_dget_path(od, oldbuf, PATH_LENGTH_BUFFER);
8661 - newpath = Novfs_dget_path(nd, newbuf, PATH_LENGTH_BUFFER);
8662 + oldpath = novfs_dget_path(od, oldbuf, PATH_LENGTH_BUFFER);
8663 + newpath = novfs_dget_path(nd, newbuf, PATH_LENGTH_BUFFER);
8664 if (oldpath && newpath) {
8665 oldlen = PATH_LENGTH_BUFFER - (int)(oldpath - oldbuf);
8666 newlen = PATH_LENGTH_BUFFER - (int)(newpath - newbuf);
8669 - ("Novfs_i_rename: od=0x%p od->inode=0x%p od->inode->i_ino=%d %s\n",
8670 + ("novfs_i_rename: od=0x%p od->inode=0x%p od->inode->i_ino=%d %s\n",
8671 od, od->d_inode, od->d_inode->i_ino, oldpath);
8674 - ("Novfs_i_rename: nd=0x%p nd->inode=0x%p nd->inode->i_ino=%d %s\n",
8675 + ("novfs_i_rename: nd=0x%p nd->inode=0x%p nd->inode->i_ino=%d %s\n",
8676 nd, nd->d_inode, nd->d_inode->i_ino,
8680 - ("Novfs_i_rename: nd=0x%p nd->inode=0x%p %s\n",
8681 + ("novfs_i_rename: nd=0x%p nd->inode=0x%p %s\n",
8682 nd, nd->d_inode, newpath);
8685 @@ -3675,9 +3076,9 @@ int Novfs_i_rename(struct inode *odir, s
8687 newcon = strchr(newpath + 1, '\\');
8688 oldcon = strchr(oldpath + 1, '\\');
8689 - DbgPrint("Novfs_i_rename: newcon=0x%p newpath=0x%p\n",
8690 + DbgPrint("novfs_i_rename: newcon=0x%p newpath=0x%p\n",
8692 - DbgPrint("Novfs_i_rename: oldcon=0x%p oldpath=0x%p\n",
8693 + DbgPrint("novfs_i_rename: oldcon=0x%p oldpath=0x%p\n",
8696 if (newcon && oldcon
8697 @@ -3685,8 +3086,8 @@ int Novfs_i_rename(struct inode *odir, s
8698 (int)(oldcon - oldpath))) {
8699 newcon = strchr(newcon + 1, '\\');
8700 oldcon = strchr(oldcon + 1, '\\');
8701 - DbgPrint("Novfs_i_rename2: newcon=0x%p newpath=0x%p\n", newcon, newpath);
8702 - DbgPrint("Novfs_i_rename2: oldcon=0x%p oldpath=0x%p\n", oldcon, oldpath);
8703 + DbgPrint("novfs_i_rename2: newcon=0x%p newpath=0x%p\n", newcon, newpath);
8704 + DbgPrint("novfs_i_rename2: oldcon=0x%p oldpath=0x%p\n", oldcon, oldpath);
8705 if (newcon && oldcon &&
8706 ((int)(newcon - newpath) == (int)(oldcon - oldpath))) {
8707 newname.name = newpath;
8708 @@ -3696,43 +3097,58 @@ int Novfs_i_rename(struct inode *odir, s
8709 oldname.name = oldpath;
8710 oldname.len = (int)(oldcon - oldpath);
8712 - if (!Novfs_d_strcmp(&newname, &oldname)) {
8713 + if (!novfs_d_strcmp(&newname, &oldname)) {
8716 - && od->d_inode->FSPRIVATE) {
8717 + && od->d_inode->i_private) {
8719 - if ((nd->d_inode) &&
8720 - (nd->d_inode->FSPRIVATE)) {
8721 - session = Scope_Get_SessionId(((struct inode_data *)ndir->FSPRIVATE)->Scope);
8722 - if (0 == SC_PRESENT(session)) {
8723 - ((struct inode_data *)ndir->FSPRIVATE)->Scope = Scope_Get_ScopefromPath(nd);
8724 - session = Scope_Get_SessionId(((struct inode_data *)ndir->FSPRIVATE)->Scope);
8729 + novfs_scope_get_sessionId
8730 + (((struct inode_data *) ndir->i_private)->Scope);
8734 + ((struct inode_data *) ndir->i_private)->Scope = novfs_get_scope(nd);
8737 + novfs_scope_get_sessionId
8738 + (((struct inode_data *) ndir->i_private)->Scope);
8741 - retCode = Novfs_Delete(newpath, S_ISDIR(nd->d_inode->i_mode), session);
8752 - session = Scope_Get_SessionId(((struct inode_data *) ndir->FSPRIVATE)->Scope);
8753 + session = novfs_scope_get_sessionId(((struct inode_data *) ndir->i_private)->Scope);
8754 if (0 == SC_PRESENT(session)) {
8755 - ((struct inode_data *)ndir->FSPRIVATE)->Scope = Scope_Get_ScopefromPath(nd);
8756 - session = Scope_Get_SessionId(((struct inode_data *) ndir->FSPRIVATE)->Scope);
8757 + ((struct inode_data *)ndir->i_private)->Scope = novfs_get_scope(nd);
8758 + session = novfs_scope_get_sessionId(((struct inode_data *) ndir->i_private)->Scope);
8760 - retCode = Novfs_Rename_File(S_ISDIR(od->d_inode->i_mode), oldpath, oldlen - 1, newpath, newlen - 1, session);
8761 + retCode = novfs_rename_file(S_ISDIR(od->d_inode->i_mode), oldpath, oldlen - 1, newpath, newlen - 1, session);
8764 - info = (struct entry_info *) oldbuf;
8765 + info = (struct novfs_entry_info *) oldbuf;
8767 - Novfs_remove_inode_entry(odir, &od->d_name, 0);
8768 - Novfs_remove_inode_entry(ndir, &nd->d_name, 0);
8769 - Novfs_Get_File_Info(newpath, info, &session);
8770 - nd->d_time = jiffies + (File_update_timeout * HZ);
8771 + novfs_remove_inode_entry(odir, &od->d_name, 0);
8772 + novfs_remove_inode_entry(ndir, &nd->d_name, 0);
8773 + novfs_get_file_info(newpath, info, session);
8774 + nd->d_time = jiffies + (novfs_update_timeout * HZ);
8776 if (od->d_inode && od->d_inode->i_ino) {
8777 ino = od->d_inode-> i_ino;
8779 - ino = (ino_t)atomic_inc_return(&Novfs_Inode_Number);
8780 + ino = (ino_t)atomic_inc_return(&novfs_Inode_Number);
8782 - Novfs_add_inode_entry(ndir, &nd->d_name, ino, info);
8783 + novfs_add_inode_entry(ndir, &nd->d_name, ino, info);
8787 @@ -3744,44 +3160,12 @@ int Novfs_i_rename(struct inode *odir, s
8791 - DbgPrint("Novfs_i_rename: return %d\n", retCode);
8792 + DbgPrint("novfs_i_rename: return %d\n", retCode);
8796 -/*++======================================================================*/
8797 -int Novfs_i_permission(struct inode *inode, int mask)
8809 - *========================================================================*/
8816 -/*++======================================================================*/
8817 -int Novfs_i_setattr(struct dentry *dentry, struct iattr *attr)
8829 - *========================================================================*/
8830 +int novfs_i_setattr(struct dentry *dentry, struct iattr *attr)
8833 struct inode *inode = dentry->d_inode;
8834 @@ -3789,7 +3173,7 @@ int Novfs_i_setattr(struct dentry *dentr
8837 unsigned int ia_valid = attr->ia_valid;
8838 - session_t session;
8839 + struct novfs_schandle session;
8843 @@ -3800,20 +3184,21 @@ int Novfs_i_setattr(struct dentry *dentr
8847 - if (inode && inode->FSPRIVATE) {
8848 + if (inode && inode->i_private) {
8850 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
8851 + novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->
8853 if (0 == SC_PRESENT(session)) {
8854 - ((struct inode_data *)inode->FSPRIVATE)->Scope =
8855 - Scope_Get_ScopefromPath(dentry);
8856 + ((struct inode_data *) inode->i_private)->Scope =
8857 + novfs_get_scope(dentry);
8859 - Scope_Get_SessionId(((struct inode_data *) inode->
8860 - FSPRIVATE)->Scope);
8861 + novfs_scope_get_sessionId(((struct inode_data *) inode->
8862 + i_private)->Scope);
8865 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8866 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8868 - path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8869 + path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8871 strcpy(atime_buf, "Unspecified");
8872 strcpy(mtime_buf, "Unspecified");
8873 @@ -3831,7 +3216,7 @@ int Novfs_i_setattr(struct dentry *dentr
8876 /* Removed for Bug 132374. jlt */
8877 - DbgPrint("Novfs_i_setattr: %s\n"
8878 + DbgPrint("novfs_i_setattr: %s\n"
8882 @@ -3855,19 +3240,28 @@ int Novfs_i_setattr(struct dentry *dentr
8883 ~(ATTR_FILE | ATTR_SIZE);
8885 ia_valid = attr->ia_valid;
8886 -#if 0 // thanks to vfs changes in our tree...
8887 - retVal = Novfs_Truncate_File_Ex(attr->ia_file->private_data, attr->ia_size, session);
8888 +#if 0 // thanks to vfs changes in our tree...
8890 + novfs_trunc_ex(attr->
8897 inode->i_size = attr->ia_size;
8898 - ((struct inode_data *)inode->FSPRIVATE)->Flags |= UPDATE_INODE;
8899 + ((struct inode_data *) inode->
8900 + i_private)->Flags |=
8908 - Novfs_Set_Attr(path, attr, session))) {
8909 - ((struct inode_data *)inode->FSPRIVATE)->Flags |= UPDATE_INODE;
8910 + novfs_set_attr(path, attr, session))) {
8911 + ((struct inode_data *) inode->i_private)->
8912 + Flags |= UPDATE_INODE;
8914 if (ia_valid & ATTR_ATIME)
8915 inode->i_atime = attr->ia_atime;
8916 @@ -3886,26 +3280,13 @@ int Novfs_i_setattr(struct dentry *dentr
8920 - DbgPrint("Novfs_i_setattr: return 0x%x\n", retVal);
8921 + DbgPrint("novfs_i_setattr: return 0x%x\n", retVal);
8926 -/*++======================================================================*/
8927 -int Novfs_i_getattr(struct vfsmount *mnt, struct dentry *dentry,
8928 +int novfs_i_getattr(struct vfsmount *mnt, struct dentry *dentry,
8929 struct kstat *kstat)
8941 - *========================================================================*/
8945 @@ -3913,32 +3294,32 @@ int Novfs_i_getattr(struct vfsmount *mnt
8947 struct inode *inode = dentry->d_inode;
8949 - struct entry_info info;
8950 + struct novfs_entry_info info;
8952 - session_t session;
8953 + struct novfs_schandle session;
8954 struct inode_data *id;
8956 if (!IS_ROOT(dentry) && !IS_ROOT(dentry->d_parent)) {
8957 SC_INITIALIZE(session);
8958 - id = dentry->d_inode->FSPRIVATE;
8959 + id = dentry->d_inode->i_private;
8961 if (id && (id->Flags & UPDATE_INODE)) {
8962 - session = Scope_Get_SessionId(id->Scope);
8963 + session = novfs_scope_get_sessionId(id->Scope);
8965 if (0 == SC_PRESENT(session)) {
8966 - id->Scope = Scope_Get_ScopefromPath(dentry);
8967 - session = Scope_Get_SessionId(id->Scope);
8968 + id->Scope = novfs_get_scope(dentry);
8969 + session = novfs_scope_get_sessionId(id->Scope);
8973 - (char *)Novfs_Malloc(PATH_LENGTH_BUFFER,
8975 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8978 - Novfs_dget_path(dentry, buf,
8979 + novfs_dget_path(dentry, buf,
8980 PATH_LENGTH_BUFFER);
8982 - retCode = Novfs_Get_File_Info(path, &info, &session);
8984 + novfs_get_file_info(path, &info,
8987 update_inode(inode, &info);
8988 id->Flags &= ~UPDATE_INODE;
8989 @@ -3969,7 +3350,7 @@ int Novfs_i_getattr(struct vfsmount *mnt
8990 ctime_r(&kstat->mtime.tv_sec, mtime_buf);
8991 ctime_r(&kstat->ctime.tv_sec, ctime_buf);
8993 - DbgPrint("Novfs_i_getattr: 0x%x 0x%p <%.*s>\n"
8994 + DbgPrint("novfs_i_getattr: 0x%x 0x%p <%.*s>\n"
8998 @@ -3997,24 +3378,11 @@ int Novfs_i_getattr(struct vfsmount *mnt
9002 -/*++======================================================================*/
9003 -int Novfs_i_getxattr(struct dentry *dentry, const char *name, void *buffer,
9004 +int novfs_i_getxattr(struct dentry *dentry, const char *name, void *buffer,
9017 - *========================================================================*/
9019 struct inode *inode = dentry->d_inode;
9020 - session_t sessionId;
9021 + struct novfs_schandle sessionId;
9022 char *path, *buf, *bufRead;
9025 @@ -4022,44 +3390,53 @@ int Novfs_i_getxattr(struct dentry *dent
9027 SC_INITIALIZE(sessionId);
9029 - DbgPrint("Novfs_i_getxattr: Ian\n"); /*%.*s\n", dentry->d_name.len, dentry->d_name.name); */
9030 + DbgPrint("novfs_i_getxattr: Ian\n"); /*%.*s\n", dentry->d_name.len, dentry->d_name.name); */
9032 - ("Novfs_i_getxattr: dentry->d_name.len %u, dentry->d_name.name %s\n",
9033 + ("novfs_i_getxattr: dentry->d_name.len %u, dentry->d_name.name %s\n",
9034 dentry->d_name.len, dentry->d_name.name);
9035 - DbgPrint("Novfs_i_getxattr: name %s\n", name);
9036 - DbgPrint("Novfs_i_getxattr: size %u\n", buffer_size);
9037 + DbgPrint("novfs_i_getxattr: name %s\n", name);
9038 + DbgPrint("novfs_i_getxattr: size %u\n", buffer_size);
9040 - if (inode && inode->FSPRIVATE) {
9041 + if (inode && inode->i_private) {
9043 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
9044 - DbgPrint("Novfs_i_getxattr: SessionId = %u\n", sessionId);
9045 + novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->
9047 + DbgPrint("novfs_i_getxattr: SessionId = %u\n", sessionId);
9048 //if (0 == sessionId)
9049 if (0 == SC_PRESENT(sessionId)) {
9050 - ((struct inode_data *) inode->FSPRIVATE)->Scope = Scope_Get_ScopefromPath(dentry);
9051 - sessionId = Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
9052 - DbgPrint("Novfs_i_getxattr: SessionId = %u\n",
9053 + ((struct inode_data *) inode->i_private)->Scope =
9054 + novfs_get_scope(dentry);
9056 + novfs_scope_get_sessionId(((struct inode_data *) inode->
9057 + i_private)->Scope);
9058 + DbgPrint("novfs_i_getxattr: SessionId = %u\n",
9064 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9065 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9067 - path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9068 + path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9070 - bufRead = (char *)Novfs_Malloc(XA_BUFFER, GFP_KERNEL);
9071 + bufRead = kmalloc(XA_BUFFER, GFP_KERNEL);
9073 - retxcode = Novfs_GetX_File_Info(path, name, bufRead, XA_BUFFER, &dataLen, &sessionId);
9074 - DbgPrint("Novfs_i_getxattr: after Novfs_GetX_File_Info retxcode = %d\n", retxcode);
9076 + novfs_getx_file_info(path, name, bufRead,
9077 + XA_BUFFER, &dataLen,
9080 + ("novfs_i_getxattr: after novfs_GetX_File_Info retxcode = %d\n",
9083 - mydump(64, bufRead);
9084 + novfs_dump(64, bufRead);
9085 if (buffer_size != 0) {
9086 if (buffer_size >= dataLen) {
9087 memcpy(buffer, bufRead,
9091 - ("Novfs_i_getxattr: (!!!) not enough buffer_size. buffer_size = %d, dataLen = %d\n",
9092 + ("novfs_i_getxattr: (!!!) not enough buffer_size. buffer_size = %d, dataLen = %d\n",
9096 @@ -4086,25 +3463,12 @@ int Novfs_i_getxattr(struct dentry *dent
9100 -/*++======================================================================*/
9101 -int Novfs_i_setxattr(struct dentry *dentry, const char *name, const void *value,
9102 +int novfs_i_setxattr(struct dentry *dentry, const char *name, const void *value,
9103 size_t value_size, int flags)
9115 - *========================================================================*/
9118 struct inode *inode = dentry->d_inode;
9119 - session_t sessionId;
9120 + struct novfs_schandle sessionId;
9122 unsigned long bytesWritten = 0;
9124 @@ -4112,42 +3476,42 @@ int Novfs_i_setxattr(struct dentry *dent
9126 SC_INITIALIZE(sessionId);
9128 - DbgPrint("Novfs_i_setxattr: Ian\n"); /*%.*s\n", dentry->d_name.len, dentry->d_name.name); */
9129 + DbgPrint("novfs_i_setxattr: Ian\n"); /*%.*s\n", dentry->d_name.len, dentry->d_name.name); */
9131 - ("Novfs_i_setxattr: dentry->d_name.len %u, dentry->d_name.name %s\n",
9132 + ("novfs_i_setxattr: dentry->d_name.len %u, dentry->d_name.name %s\n",
9133 dentry->d_name.len, dentry->d_name.name);
9134 - DbgPrint("Novfs_i_setxattr: name %s\n", name);
9135 - DbgPrint("Novfs_i_setxattr: value_size %u\n", value_size);
9136 - DbgPrint("Novfs_i_setxattr: flags %d\n", flags);
9137 + DbgPrint("novfs_i_setxattr: name %s\n", name);
9138 + DbgPrint("novfs_i_setxattr: value_size %u\n", value_size);
9139 + DbgPrint("novfs_i_setxattr: flags %d\n", flags);
9141 - if (inode && inode->FSPRIVATE) {
9142 + if (inode && inode->i_private) {
9144 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->
9145 + novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->
9147 - DbgPrint("Novfs_i_setxattr: SessionId = %u\n", sessionId);
9148 + DbgPrint("novfs_i_setxattr: SessionId = %u\n", sessionId);
9149 //if (0 == sessionId)
9150 if (0 == SC_PRESENT(sessionId)) {
9151 - ((struct inode_data *)inode->FSPRIVATE)->Scope =
9152 - Scope_Get_ScopefromPath(dentry);
9153 + ((struct inode_data *) inode->i_private)->Scope =
9154 + novfs_get_scope(dentry);
9156 - Scope_Get_SessionId(((struct inode_data *)inode->
9157 - FSPRIVATE)->Scope);
9158 - DbgPrint("Novfs_i_setxattr: SessionId = %u\n",
9159 + novfs_scope_get_sessionId(((struct inode_data *) inode->
9160 + i_private)->Scope);
9161 + DbgPrint("novfs_i_setxattr: SessionId = %u\n",
9166 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9167 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9169 - path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9170 + path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9173 - Novfs_SetX_File_Info(path, name, value, value_size,
9174 + novfs_setx_file_info(path, name, value, value_size,
9175 &bytesWritten, flags,
9180 - ("Novfs_i_setxattr: bytesWritten = %u\n",
9181 + ("novfs_i_setxattr: bytesWritten = %u\n",
9185 @@ -4164,53 +3528,59 @@ int Novfs_i_setxattr(struct dentry *dent
9189 -int Novfs_i_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
9190 +int novfs_i_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
9192 struct inode *inode = dentry->d_inode;
9193 - session_t sessionId;
9194 + struct novfs_schandle sessionId;
9195 char *path, *buf, *bufList;
9200 SC_INITIALIZE(sessionId);
9202 - DbgPrint("Novfs_i_listxattr: Ian\n"); //%.*s\n", dentry->d_name.len, dentry->d_name.name);
9203 + DbgPrint("novfs_i_listxattr: Ian\n"); //%.*s\n", dentry->d_name.len, dentry->d_name.name);
9205 - ("Novfs_i_listxattr: dentry->d_name.len %u, dentry->d_name.name %s\n",
9206 + ("novfs_i_listxattr: dentry->d_name.len %u, dentry->d_name.name %s\n",
9207 dentry->d_name.len, dentry->d_name.name);
9208 - DbgPrint("Novfs_i_listxattr: size %u\n", buffer_size);
9209 + DbgPrint("novfs_i_listxattr: size %u\n", buffer_size);
9211 - if (inode && inode->FSPRIVATE) {
9212 + if (inode && inode->i_private) {
9214 - Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)-> Scope);
9215 - DbgPrint("Novfs_i_listxattr: SessionId = %u\n", sessionId);
9216 + novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->
9218 + DbgPrint("novfs_i_listxattr: SessionId = %u\n", sessionId);
9219 //if (0 == sessionId)
9220 if (0 == SC_PRESENT(sessionId)) {
9221 - ((struct inode_data *)inode->FSPRIVATE)->Scope = Scope_Get_ScopefromPath(dentry);
9222 - sessionId = Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
9223 - DbgPrint("Novfs_i_listxattr: SessionId = %u\n",
9224 + ((struct inode_data *) inode->i_private)->Scope =
9225 + novfs_get_scope(dentry);
9227 + novfs_scope_get_sessionId(((struct inode_data *) inode->
9228 + i_private)->Scope);
9229 + DbgPrint("novfs_i_listxattr: SessionId = %u\n",
9235 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9236 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9238 - path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9239 + path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9241 - bufList = (char *)Novfs_Malloc(XA_BUFFER, GFP_KERNEL);
9242 + bufList = kmalloc(XA_BUFFER, GFP_KERNEL);
9244 - retxcode = Novfs_ListX_File_Info(path, bufList, XA_BUFFER, &dataLen, &sessionId);
9246 + novfs_listx_file_info(path, bufList,
9247 + XA_BUFFER, &dataLen,
9250 - mydump(64, bufList);
9251 + novfs_dump(64, bufList);
9252 if (buffer_size != 0) {
9253 if (buffer_size >= dataLen) {
9254 memcpy(buffer, bufList,
9258 - ("Novfs_i_listxattr: (!!!) not enough buffer_size. buffer_size = %d, dataLen = %d\n",
9259 + ("novfs_i_listxattr: (!!!) not enough buffer_size. buffer_size = %d, dataLen = %d\n",
9260 buffer_size, dataLen);
9263 @@ -4236,120 +3606,92 @@ int Novfs_i_listxattr(struct dentry *den
9267 -int Novfs_i_revalidate(struct dentry *dentry)
9268 +int novfs_i_revalidate(struct dentry *dentry)
9271 - DbgPrint("Novfs_i_revalidate: name %.*s\n", dentry->d_name.len,
9272 + DbgPrint("novfs_i_revalidate: name %.*s\n", dentry->d_name.len,
9273 dentry->d_name.name);
9278 -void Novfs_read_inode(struct inode *inode)
9279 +void novfs_read_inode(struct inode *inode)
9281 - DbgPrint("Novfs_read_inode: 0x%p %d\n", inode, inode->i_ino);
9282 + DbgPrint("novfs_read_inode: 0x%p %d\n", inode, inode->i_ino);
9285 -void Novfs_write_inode(struct inode *inode)
9286 +void novfs_write_inode(struct inode *inode)
9288 - DbgPrint("Novfs_write_inode: Inode=0x%p Ino=%d\n", inode, inode->i_ino);
9289 + DbgPrint("novfs_write_inode: Inode=0x%p Ino=%d\n", inode, inode->i_ino);
9292 -int Novfs_notify_change(struct dentry *dentry, struct iattr *attr)
9293 +int novfs_notify_change(struct dentry *dentry, struct iattr *attr)
9295 struct inode *inode = dentry->d_inode;
9298 - ("Novfs_notify_change: Dentry=0x%p Name=%.*s Inode=0x%p Ino=%d ia_valid=0x%x\n",
9299 + ("novfs_notify_change: Dentry=0x%p Name=%.*s Inode=0x%p Ino=%d ia_valid=0x%x\n",
9300 dentry, dentry->d_name.len, dentry->d_name.name, inode,
9301 inode->i_ino, attr->ia_valid);
9305 -/*++======================================================================*/
9306 -void Novfs_clear_inode(struct inode *inode)
9308 - * Arguments: sb - pointer to the super_block
9309 - * buf - pointer to the statfs buffer
9313 - * Abstract: Called when statfs(2) system called.
9317 - * Environment: Superblock operation
9319 - *========================================================================*/
9320 +void novfs_clear_inode(struct inode *inode)
9324 - if (inode->FSPRIVATE) {
9325 - struct inode_data *id = inode->FSPRIVATE;
9326 + if (inode->i_private) {
9327 + struct inode_data *id = inode->i_private;
9330 - ("Novfs_clear_inode: inode=0x%p ino=%d Scope=0x%p Name=%s\n",
9331 + ("novfs_clear_inode: inode=0x%p ino=%d Scope=0x%p Name=%s\n",
9332 inode, inode->i_ino, id->Scope, id->Name);
9334 - Novfs_free_inode_cache(inode);
9335 + novfs_free_inode_cache(inode);
9337 down(&InodeList_lock);
9338 list_del(&id->IList);
9339 up(&InodeList_lock);
9341 - kfree(inode->FSPRIVATE);
9342 - inode->FSPRIVATE = NULL;
9343 + kfree(inode->i_private);
9344 + inode->i_private = NULL;
9346 remove_inode_hash(inode);
9349 - DbgPrint("Novfs_clear_inode: inode=0x%p ino=%d\n", inode,
9350 + DbgPrint("novfs_clear_inode: inode=0x%p ino=%d\n", inode,
9355 -/*++======================================================================*/
9356 -int Novfs_show_options(struct seq_file *s, struct vfsmount *m)
9362 - * Abstract: Called when /proc/mounts is read
9368 - *========================================================================*/
9369 +/* Called when /proc/mounts is read */
9370 +int novfs_show_options(struct seq_file *s, struct vfsmount *m)
9372 char *buf, *path, *tmp;
9374 - buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9375 + buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9377 struct path my_path;
9379 my_path.dentry = m->mnt_root;
9380 path = d_path(&my_path, buf, PATH_LENGTH_BUFFER);
9382 - if (!Novfs_CurrentMount
9383 - || (Novfs_CurrentMount
9384 - && strcmp(Novfs_CurrentMount, path))) {
9385 - DbgPrint("Novfs_show_options: %.*s %.*s %s\n",
9386 + if (!novfs_current_mnt
9387 + || (novfs_current_mnt
9388 + && strcmp(novfs_current_mnt, path))) {
9389 + DbgPrint("novfs_show_options: %.*s %.*s %s\n",
9390 m->mnt_root->d_name.len,
9391 m->mnt_root->d_name.name,
9392 m->mnt_mountpoint->d_name.len,
9393 m->mnt_mountpoint->d_name.name, path);
9395 - (char *)Novfs_Malloc(PATH_LENGTH_BUFFER -
9396 + tmp = kmalloc(PATH_LENGTH_BUFFER -
9401 - path = Novfs_CurrentMount;
9402 - Novfs_CurrentMount = tmp;
9403 - Daemon_SetMountPoint
9404 - (Novfs_CurrentMount);
9405 + path = novfs_current_mnt;
9406 + novfs_current_mnt = tmp;
9407 + novfs_daemon_set_mnt_point(novfs_current_mnt);
9411 @@ -4362,37 +3704,17 @@ int Novfs_show_options(struct seq_file *
9415 -/*++======================================================================*/
9416 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9417 -int Novfs_statfs(struct dentry *de, struct kstatfs *buf)
9419 -int Novfs_statfs(struct super_block *sb, struct kstatfs *buf)
9422 - * Arguments: sb - pointer to the super_block
9423 - * buf - pointer to the statfs buffer
9427 - * Abstract: Called when statfs(2) system called.
9431 - * Environment: Superblock operation
9433 - *========================================================================*/
9434 +/* Called when statfs(2) system called. */
9435 +int novfs_statfs(struct dentry *de, struct kstatfs *buf)
9437 uint64_t td, fd, te, fe;
9439 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9440 struct super_block *sb = de->d_sb;
9443 - DbgPrint("Novfs_statfs:\n");
9444 + DbgPrint("novfs_statfs:\n");
9446 td = fd = te = fe = 0;
9448 - Scope_Get_UserSpace(&td, &fd, &te, &fe);
9449 + novfs_scope_get_userspace(&td, &fd, &te, &fe);
9451 DbgPrint("td=%llu\n", td);
9452 DbgPrint("fd=%llu\n", fd);
9453 @@ -4430,7 +3752,7 @@ int Novfs_statfs(struct super_block *sb,
9457 -struct inode *Novfs_get_inode(struct super_block *sb, int mode, int dev,
9458 +struct inode *novfs_get_inode(struct super_block *sb, int mode, int dev,
9459 uid_t Uid, ino_t ino, struct qstr *name)
9461 struct inode *inode = new_inode(sb);
9462 @@ -4440,37 +3762,32 @@ struct inode *Novfs_get_inode(struct sup
9463 inode->i_mode = mode;
9466 - /* bug # 340510 tells us to comment this out... */
9467 -//#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
9468 -// inode->i_blksize = sb->s_blocksize;
9470 -// inode->i_sb->s_blocksize = sb->s_blocksize;
9472 + inode->i_sb->s_blocksize = sb->s_blocksize;
9473 inode->i_blkbits = sb->s_blocksize_bits;
9474 inode->i_blocks = 0;
9476 - inode->i_ino = (ino) ? ino : (ino_t)atomic_inc_return(&Novfs_Inode_Number);
9478 - inode->i_mapping->a_ops = &Novfs_aops;
9479 + inode->i_ino = (ino) ? ino : (ino_t)atomic_inc_return(&novfs_Inode_Number);
9480 + if (novfs_page_cache) {
9481 + inode->i_mapping->a_ops = &novfs_aops;
9483 - inode->i_mapping->a_ops = &Novfs_nocache_aops;
9484 + inode->i_mapping->a_ops = &novfs_nocache_aops;
9486 - inode->i_mapping->backing_dev_info = &Novfs_backing_dev_info;
9487 + inode->i_mapping->backing_dev_info = &novfs_backing_dev_info;
9488 inode->i_atime.tv_sec = 0;
9489 inode->i_atime.tv_nsec = 0;
9490 inode->i_mtime = inode->i_ctime = inode->i_atime;
9492 - DbgPrint("Novfs_get_inode: Inode=0x%p I_ino=%d len=%d\n", inode,
9493 + DbgPrint("novfs_get_inode: Inode=0x%p I_ino=%d len=%d\n", inode,
9494 inode->i_ino, name->len);
9497 - (inode->FSPRIVATE =
9498 - Novfs_Malloc(sizeof(struct inode_data) + name->len,
9499 + (inode->i_private =
9500 + kmalloc(sizeof(struct inode_data) + name->len,
9502 struct inode_data *id;
9503 - id = inode->FSPRIVATE;
9504 + id = inode->i_private;
9506 - DbgPrint("Novfs_get_inode: FSPRIVATE 0x%p\n", id);
9507 + DbgPrint("novfs_get_inode: i_private 0x%p\n", id);
9511 @@ -4494,7 +3811,7 @@ struct inode *Novfs_get_inode(struct sup
9512 memcpy(id->Name, name->name, name->len);
9513 id->Name[name->len] = '\0';
9515 - DbgPrint("Novfs_get_inode: name %s\n", id->Name);
9516 + DbgPrint("novfs_get_inode: name %s\n", id->Name);
9519 insert_inode_hash(inode);
9520 @@ -4502,19 +3819,15 @@ struct inode *Novfs_get_inode(struct sup
9521 switch (mode & S_IFMT) {
9524 - inode->i_op = &Novfs_file_inode_operations;
9525 - inode->i_fop = &Novfs_file_operations;
9526 + inode->i_op = &novfs_file_inode_operations;
9527 + inode->i_fop = &novfs_file_operations;
9531 - inode->i_op = &Novfs_inode_operations;
9532 - inode->i_fop = &Novfs_dir_operations;
9533 -// Again bug #340510
9534 -//#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
9535 -// inode->i_blksize = 0;
9537 -// inode->i_sb->s_blocksize = 0;
9539 + inode->i_op = &novfs_inode_operations;
9540 + inode->i_fop = &novfs_dir_operations;
9542 + inode->i_sb->s_blocksize = 0;
9543 inode->i_blkbits = 0;
9546 @@ -4523,63 +3836,63 @@ struct inode *Novfs_get_inode(struct sup
9550 - DbgPrint("Novfs_get_inode: size=%lld\n", inode->i_size);
9551 - DbgPrint("Novfs_get_inode: mode=0%o\n", inode->i_mode);
9552 - DbgPrint("Novfs_get_inode: i_sb->s_blocksize=%d\n",
9553 + DbgPrint("novfs_get_inode: size=%lld\n", inode->i_size);
9554 + DbgPrint("novfs_get_inode: mode=0%o\n", inode->i_mode);
9555 + DbgPrint("novfs_get_inode: i_sb->s_blocksize=%d\n",
9556 inode->i_sb->s_blocksize);
9557 - DbgPrint("Novfs_get_inode: i_blkbits=%d\n", inode->i_blkbits);
9558 - DbgPrint("Novfs_get_inode: i_blocks=%d\n", inode->i_blocks);
9559 - DbgPrint("Novfs_get_inode: i_bytes=%d\n", inode->i_bytes);
9560 + DbgPrint("novfs_get_inode: i_blkbits=%d\n", inode->i_blkbits);
9561 + DbgPrint("novfs_get_inode: i_blocks=%d\n", inode->i_blocks);
9562 + DbgPrint("novfs_get_inode: i_bytes=%d\n", inode->i_bytes);
9565 - DbgPrint("Novfs_get_inode: 0x%p %d\n", inode, inode->i_ino);
9566 + DbgPrint("novfs_get_inode: 0x%p %d\n", inode, inode->i_ino);
9570 -int Novfs_fill_super(struct super_block *SB, void *Data, int Silent)
9571 +int novfs_fill_super(struct super_block *SB, void *Data, int Silent)
9573 struct inode *inode;
9574 struct dentry *server, *tree;
9576 - struct entry_info info;
9577 + struct novfs_entry_info info;
9579 SB->s_blocksize = PAGE_CACHE_SIZE;
9580 SB->s_blocksize_bits = PAGE_CACHE_SHIFT;
9581 SB->s_maxbytes = 0xFFFFFFFFFFFFFFFFULL; /* Max file size */
9582 - SB->s_op = &Novfs_ops;
9583 + SB->s_op = &novfs_ops;
9584 SB->s_flags |= (MS_NODIRATIME | MS_NODEV | MS_POSIXACL);
9585 SB->s_magic = NOVFS_MAGIC;
9590 - inode = Novfs_get_inode(SB, S_IFDIR | 0777, 0, 0, 0, &name);
9591 + inode = novfs_get_inode(SB, S_IFDIR | 0777, 0, 0, 0, &name);
9596 - Novfs_root = d_alloc_root(inode);
9597 + novfs_root = d_alloc_root(inode);
9599 - if (!Novfs_root) {
9600 + if (!novfs_root) {
9604 - Novfs_root->d_time = jiffies + (File_update_timeout * HZ);
9605 + novfs_root->d_time = jiffies + (novfs_update_timeout * HZ);
9607 inode->i_atime = inode->i_ctime = inode->i_mtime = CURRENT_TIME;
9609 - SB->s_root = Novfs_root;
9610 + SB->s_root = novfs_root;
9612 - DbgPrint("Novfs_fill_super: root 0x%p\n", Novfs_root);
9613 + DbgPrint("novfs_fill_super: root 0x%p\n", novfs_root);
9616 - Novfs_root->d_op = &Novfs_dentry_operations;
9618 + novfs_root->d_op = &novfs_dentry_operations;
9620 name.name = SERVER_DIRECTORY_NAME;
9621 name.len = strlen(SERVER_DIRECTORY_NAME);
9622 - name.hash = Novfs_internal_hash(&name);
9623 + name.hash = novfs_internal_hash(&name);
9625 - inode = Novfs_get_inode(SB, S_IFDIR | 0777, 0, 0, 0, &name);
9626 + inode = novfs_get_inode(SB, S_IFDIR | 0777, 0, 0, 0, &name);
9628 info.mode = inode->i_mode;
9629 info.namelength = 0;
9630 @@ -4590,14 +3903,14 @@ int Novfs_fill_super(struct super_block
9631 inode->i_ctime = info.ctime =
9632 inode->i_mtime = info.mtime = CURRENT_TIME;
9634 - server = d_alloc(Novfs_root, &name);
9635 + server = d_alloc(novfs_root, &name);
9637 - server->d_op = &Novfs_dentry_operations;
9638 + server->d_op = &novfs_dentry_operations;
9639 server->d_time = 0xffffffff;
9640 d_add(server, inode);
9641 - DbgPrint("Novfs_fill_super: d_add %s 0x%p\n",
9642 + DbgPrint("novfs_fill_super: d_add %s 0x%p\n",
9643 SERVER_DIRECTORY_NAME, server);
9644 - Novfs_add_inode_entry(Novfs_root->d_inode,
9645 + novfs_add_inode_entry(novfs_root->d_inode,
9646 &name, inode->i_ino,
9649 @@ -4605,9 +3918,9 @@ int Novfs_fill_super(struct super_block
9651 name.name = TREE_DIRECTORY_NAME;
9652 name.len = strlen(TREE_DIRECTORY_NAME);
9653 - name.hash = Novfs_internal_hash(&name);
9654 + name.hash = novfs_internal_hash(&name);
9656 - inode = Novfs_get_inode(SB, S_IFDIR | 0777, 0, 0, 0, &name);
9657 + inode = novfs_get_inode(SB, S_IFDIR | 0777, 0, 0, 0, &name);
9659 info.mode = inode->i_mode;
9660 info.namelength = 0;
9661 @@ -4617,15 +3930,15 @@ int Novfs_fill_super(struct super_block
9662 inode->i_atime = info.atime =
9663 inode->i_ctime = info.ctime =
9664 inode->i_mtime = info.mtime = CURRENT_TIME;
9665 - tree = d_alloc(Novfs_root, &name);
9666 + tree = d_alloc(novfs_root, &name);
9668 - tree->d_op = &Novfs_dentry_operations;
9669 + tree->d_op = &novfs_dentry_operations;
9670 tree->d_time = 0xffffffff;
9673 - DbgPrint("Novfs_fill_super: d_add %s 0x%p\n",
9674 + DbgPrint("novfs_fill_super: d_add %s 0x%p\n",
9675 TREE_DIRECTORY_NAME, tree);
9676 - Novfs_add_inode_entry(Novfs_root->d_inode,
9677 + novfs_add_inode_entry(novfs_root->d_inode,
9678 &name, inode->i_ino,
9681 @@ -4635,75 +3948,53 @@ int Novfs_fill_super(struct super_block
9685 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9686 -int Novfs_get_sb(struct file_system_type *Fstype, int Flags,
9687 +static int novfs_get_sb(struct file_system_type *Fstype, int Flags,
9688 const char *Dev_name, void *Data, struct vfsmount *Mnt)
9690 -struct super_block *Novfs_get_sb(struct file_system_type *Fstype, int Flags,
9691 - const char *Dev_name, void *Data)
9694 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9697 - struct super_block *sb;
9700 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9701 - sb = get_sb_nodev(Fstype, Flags, Data, Novfs_fill_super, Mnt);
9703 - sb = get_sb_nodev(Fstype, Flags, Data, Novfs_fill_super);
9706 - DbgPrint("Novfs_get_sb: sb=0x%p Fstype=0x%x Dev_name=%s\n", sb, Fstype,
9710 + DbgPrint("novfs_get_sb: Fstype=0x%x Dev_name=%s\n", Fstype, Dev_name);
9711 + return get_sb_nodev(Fstype, Flags, Data, novfs_fill_super, Mnt);
9714 static void novfs_kill_sb(struct super_block *super)
9716 - /* calling shrink_dcache_sb() fixes novell bugzilla #345179, but I'm
9717 - * not so sure about it... */
9718 - shrink_dcache_sb(super);
9719 kill_litter_super(super);
9722 -ssize_t Novfs_Control_read(struct file *file, char *buf, size_t nbytes,
9723 +ssize_t novfs_Control_read(struct file *file, char *buf, size_t nbytes,
9728 - DbgPrint("Novfs_Control_read: kernel_locked 0x%x\n", kernel_locked());
9729 + DbgPrint("novfs_Control_read: kernel_locked 0x%x\n", kernel_locked());
9734 -ssize_t Novfs_Control_write(struct file * file, const char *buf, size_t nbytes,
9735 +ssize_t novfs_Control_write(struct file * file, const char *buf, size_t nbytes,
9740 - DbgPrint("Novfs_Control_write: kernel_locked 0x%x\n", kernel_locked());
9741 + DbgPrint("novfs_Control_write: kernel_locked 0x%x\n", kernel_locked());
9742 if (buf && nbytes) {
9748 -int Novfs_Control_ioctl(struct inode *inode, struct file *file,
9749 +int novfs_Control_ioctl(struct inode *inode, struct file *file,
9750 unsigned int cmd, unsigned long arg)
9754 - DbgPrint("Novfs_Control_ioctl: kernel_locked 0x%x\n", kernel_locked());
9755 + DbgPrint("novfs_Control_ioctl: kernel_locked 0x%x\n", kernel_locked());
9760 -static struct file_system_type Novfs_fs_type = {
9761 +static struct file_system_type novfs_fs_type = {
9763 - .get_sb = Novfs_get_sb,
9764 + .get_sb = novfs_get_sb,
9765 .kill_sb = novfs_kill_sb,
9766 .owner = THIS_MODULE,
9768 @@ -4718,20 +4009,20 @@ int __init init_novfs(void)
9770 inHAXTime = get_nanosecond_time();
9772 - retCode = Init_Procfs_Interface();
9773 + retCode = novfs_proc_init();
9776 + novfs_profile_init();
9779 DbgPrint("init_novfs: %s %s %s\n", __DATE__, __TIME__,
9780 NOVFS_VERSION_STRING);
9781 - Init_Daemon_Queue();
9783 - retCode = register_filesystem(&Novfs_fs_type);
9784 + novfs_daemon_queue_init();
9785 + novfs_scope_init();
9786 + retCode = register_filesystem(&novfs_fs_type);
9788 - Uninit_Procfs_Interface();
9789 - Uninit_Daemon_Queue();
9791 + novfs_proc_exit();
9792 + novfs_daemon_queue_exit();
9793 + novfs_scope_exit();
9797 @@ -4741,80 +4032,52 @@ void __exit exit_novfs(void)
9799 printk(KERN_INFO "exit_novfs\n");
9802 + novfs_scope_exit();
9803 printk(KERN_INFO "exit_novfs after Scope_Uninit\n");
9805 - Uninit_Daemon_Queue();
9806 + novfs_daemon_queue_exit();
9807 printk(KERN_INFO "exit_novfs after Uninit_Daemon_Queue\n");
9810 - printk(KERN_INFO "exit_novfs after uninit_profile\n");
9811 + novfs_profile_exit();
9812 + printk(KERN_INFO "exit_novfs after profile_exit\n");
9814 - Uninit_Procfs_Interface();
9815 + novfs_proc_exit();
9816 printk(KERN_INFO "exit_novfs Uninit_Procfs_Interface\n");
9818 - unregister_filesystem(&Novfs_fs_type);
9819 + unregister_filesystem(&novfs_fs_type);
9820 printk(KERN_INFO "exit_novfs: Exit\n");
9822 - if (Novfs_CurrentMount) {
9823 - kfree(Novfs_CurrentMount);
9824 - Novfs_CurrentMount = NULL;
9825 + if (novfs_current_mnt) {
9826 + kfree(novfs_current_mnt);
9827 + novfs_current_mnt = NULL;
9831 -int Novfs_lock_inode_cache(struct inode *i)
9834 - * Arguments: struct inode *i - pointer to directory inode
9836 - * Returns: 0 - locked
9839 - * Abstract: Locks the inode cache.
9845 - *========================================================================*/
9846 +int novfs_lock_inode_cache(struct inode *i)
9848 struct inode_data *id;
9851 - DbgPrint("Novfs_lock_inode_cache: 0x%p\n", i);
9852 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
9853 + DbgPrint("novfs_lock_inode_cache: 0x%p\n", i);
9854 + if (i && (id = i->i_private) && id->DirCache.next) {
9855 down(&id->DirCacheLock);
9858 - DbgPrint("Novfs_lock_inode_cache: return %d\n", retVal);
9859 + DbgPrint("novfs_lock_inode_cache: return %d\n", retVal);
9863 -/*++======================================================================*/
9864 -void Novfs_unlock_inode_cache(struct inode *i)
9866 - * Arguments: struct inode *i - pointer to directory inode
9868 - * Returns: nothing
9870 - * Abstract: Unlocks inode cache.
9876 - *========================================================================*/
9877 +void novfs_unlock_inode_cache(struct inode *i)
9879 struct inode_data *id;
9881 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
9882 + if (i && (id = i->i_private) && id->DirCache.next) {
9883 up(&id->DirCacheLock);
9887 -/*++======================================================================*/
9888 -int Novfs_enumerate_inode_cache(struct inode *i, struct list_head **iteration,
9889 - ino_t * ino, struct entry_info *info)
9890 +int novfs_enumerate_inode_cache(struct inode *i, struct list_head **iteration,
9891 + ino_t * ino, struct novfs_entry_info *info)
9893 * Arguments: struct inode *i - pointer to directory inode
9895 @@ -4824,17 +4087,14 @@ int Novfs_enumerate_inode_cache(struct i
9896 * Abstract: Unlocks inode cache.
9898 * Notes: DirCacheLock should be held before calling this routine.
9902 *========================================================================*/
9904 struct inode_data *id;
9905 - struct dir_cache *dc;
9906 + struct novfs_dir_cache *dc;
9907 struct list_head *l = NULL;
9910 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
9911 + if (i && (id = i->i_private) && id->DirCache.next) {
9912 if ((NULL == iteration) || (NULL == *iteration)) {
9913 l = id->DirCache.next;
9915 @@ -4844,7 +4104,7 @@ int Novfs_enumerate_inode_cache(struct i
9916 if (l == &id->DirCache) {
9919 - dc = list_entry(l, struct dir_cache, list);
9920 + dc = list_entry(l, struct novfs_dir_cache, list);
9924 @@ -4865,35 +4125,23 @@ int Novfs_enumerate_inode_cache(struct i
9928 -/*++======================================================================*/
9929 -int Novfs_get_entry(struct inode *i, struct qstr *name, ino_t * ino,
9930 - struct entry_info *info)
9938 - * Notes: DirCacheLock should be held before calling this routine.
9942 - *========================================================================*/
9943 +/* DirCacheLock should be held before calling this routine. */
9944 +int novfs_get_entry(struct inode *i, struct qstr *name, ino_t * ino,
9945 + struct novfs_entry_info *info)
9947 struct inode_data *id;
9948 - struct dir_cache *dc;
9949 + struct novfs_dir_cache *dc;
9954 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
9955 + if (i && (id = i->i_private) && id->DirCache.next) {
9956 if (name && name->len) {
9957 n = (char *)name->name;
9961 - dc = Novfs_lookup_inode_cache(i, name, *ino);
9962 + dc = novfs_lookup_inode_cache(i, name, *ino);
9964 dc->flags |= ENTRY_VALID;
9966 @@ -4910,36 +4158,25 @@ int Novfs_get_entry(struct inode *i, str
9970 - DbgPrint("Novfs_get_entry:\n"
9971 + DbgPrint("novfs_get_entry:\n"
9973 " name: %.*s\n" " ino: %d\n", i, nl, n, *ino);
9975 - DbgPrint("Novfs_get_entry: return %d\n", retVal);
9976 + DbgPrint("novfs_get_entry: return %d\n", retVal);
9980 -int Novfs_get_entry_by_pos(struct inode *i, loff_t pos, ino_t * ino,
9981 - struct entry_info *info)
9989 - * Notes: DirCacheLock should be held before calling this routine.
9993 - *========================================================================*/
9994 + /*DirCacheLock should be held before calling this routine. */
9995 +int novfs_get_entry_by_pos(struct inode *i, loff_t pos, ino_t * ino,
9996 + struct novfs_entry_info *info)
10000 loff_t i_pos = pos - 2;
10001 struct list_head *inter = NULL;
10002 - while (!Novfs_enumerate_inode_cache(i, &inter, ino, info)) {
10003 + while (!novfs_enumerate_inode_cache(i, &inter, ino, info)) {
10005 - ("Novfs_dir_readdir : Novfs_get_entry_by_pos : info->name = %s\n",
10006 + ("novfs_dir_readdir : novfs_get_entry_by_pos : info->name = %s\n",
10008 if (count == i_pos) {
10010 @@ -4951,38 +4188,26 @@ int Novfs_get_entry_by_pos(struct inode
10014 -/*++======================================================================*/
10015 -int Novfs_get_entry_time(struct inode *i, struct qstr *name, ino_t * ino,
10016 - struct entry_info *info, u64 * EntryTime)
10024 - * Notes: DirCacheLock should be held before calling this routine.
10028 - *========================================================================*/
10029 +/* DirCacheLock should be held before calling this routine. */
10030 +int novfs_get_entry_time(struct inode *i, struct qstr *name, ino_t * ino,
10031 + struct novfs_entry_info *info, u64 * EntryTime)
10033 struct inode_data *id;
10034 - struct dir_cache *dc;
10035 + struct novfs_dir_cache *dc;
10037 char *n = "<NULL>";
10040 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10041 + if (i && (id = i->i_private) && id->DirCache.next) {
10042 if (name && name->len) {
10043 n = (char *)name->name;
10046 - DbgPrint("Novfs_get_entry_time:\n"
10047 + DbgPrint("novfs_get_entry_time:\n"
10049 " name: %.*s\n" " ino: %d\n", i, nl, n, *ino);
10051 - dc = Novfs_lookup_inode_cache(i, name, *ino);
10052 + dc = novfs_lookup_inode_cache(i, name, *ino);
10056 @@ -5001,36 +4226,29 @@ int Novfs_get_entry_time(struct inode *i
10060 - DbgPrint("Novfs_get_entry_time: return %d\n", retVal);
10061 + DbgPrint("novfs_get_entry_time: return %d\n", retVal);
10065 -/*++======================================================================*/
10066 -int Novfs_get_remove_entry(struct inode *i, ino_t * ino, struct entry_info *info)
10072 * Abstract: This routine will return the first entry on the list
10073 * and then remove it.
10075 * Notes: DirCacheLock should be held before calling this routine.
10079 - *========================================================================*/
10081 +int novfs_get_remove_entry(struct inode *i, ino_t * ino, struct novfs_entry_info *info)
10083 struct inode_data *id;
10084 - struct dir_cache *dc;
10085 + struct novfs_dir_cache *dc;
10086 struct list_head *l = NULL;
10089 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10090 + if (i && (id = i->i_private) && id->DirCache.next) {
10091 l = id->DirCache.next;
10093 if (l != &id->DirCache) {
10094 - dc = list_entry(l, struct dir_cache, list);
10095 + dc = list_entry(l, struct novfs_dir_cache, list);
10099 @@ -5054,41 +4272,31 @@ int Novfs_get_remove_entry(struct inode
10103 -/*++======================================================================*/
10104 -void Novfs_invalidate_inode_cache(struct inode *i)
10106 - * Arguments: struct inode *i - pointer to directory inode
10108 - * Returns: nothing
10110 * Abstract: Marks all entries in the directory cache as invalid.
10112 * Notes: DirCacheLock should be held before calling this routine.
10116 *========================================================================*/
10117 +void novfs_invalidate_inode_cache(struct inode *i)
10119 struct inode_data *id;
10120 - struct dir_cache *dc;
10121 + struct novfs_dir_cache *dc;
10122 struct list_head *l;
10124 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10125 + if (i && (id = i->i_private) && id->DirCache.next) {
10126 list_for_each(l, &id->DirCache) {
10127 - dc = list_entry(l, struct dir_cache, list);
10128 + dc = list_entry(l, struct novfs_dir_cache, list);
10129 dc->flags &= ~ENTRY_VALID;
10134 /*++======================================================================*/
10135 -static struct dir_cache *Novfs_lookup_inode_cache(struct inode *i, struct qstr *name, ino_t ino)
10136 +struct novfs_dir_cache *novfs_lookup_inode_cache(struct inode *i, struct qstr *name,
10139 - * Arguments: struct inode *i - pointer to directory inode
10140 - * struct qstr *name - pointer to name
10141 - * ino_t - inode number
10143 - * Returns: struct dir_cache entry if match
10144 + * Returns: struct novfs_dir_cache entry if match
10145 * NULL - if there is no match.
10147 * Abstract: Checks a inode directory to see if there are any enties
10148 @@ -5097,25 +4305,22 @@ static struct dir_cache *Novfs_lookup_in
10150 * Notes: DirCacheLock should be held before calling this routine.
10154 *========================================================================*/
10156 struct inode_data *id;
10157 - struct dir_cache *dc;
10158 - struct dir_cache *retVal = NULL;
10159 + struct novfs_dir_cache *dc, *retVal = NULL;
10160 struct list_head *l;
10161 char *n = "<NULL>";
10165 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10166 + if (i && (id = i->i_private) && id->DirCache.next) {
10167 if (name && name->name) {
10169 n = (char *)name->name;
10172 - DbgPrint("Novfs_lookup_inode_cache:\n"
10173 + DbgPrint("novfs_lookup_inode_cache:\n"
10177 @@ -5123,10 +4328,10 @@ static struct dir_cache *Novfs_lookup_in
10178 " ino: %d\n", i, nl, n, hash, nl, ino);
10180 list_for_each(l, &id->DirCache) {
10181 - dc = list_entry(l, struct dir_cache, list);
10182 + dc = list_entry(l, struct novfs_dir_cache, list);
10185 -/* DbgPrint("Novfs_lookup_inode_cache: 0x%p\n" \
10186 +/* DbgPrint("novfs_lookup_inode_cache: 0x%p\n" \
10190 @@ -5149,46 +4354,34 @@ static struct dir_cache *Novfs_lookup_in
10194 - DbgPrint("Novfs_lookup_inode_cache: return 0x%p\n", retVal);
10195 + DbgPrint("novfs_lookup_inode_cache: return 0x%p\n", retVal);
10199 -/*++======================================================================*/
10200 -int Novfs_lookup_validate(struct inode *i, struct qstr *name, ino_t ino)
10202 - * Arguments: struct inode *i - pointer to directory inode
10203 - * struct qstr *name - pointer to name
10204 - * ino_t - inode number
10206 - * Returns: 0 if found
10207 - * !0 if not found
10209 - * Abstract: Checks a inode directory to see if there are any enties
10210 - * matching name or ino. If entry is found the valid bit
10212 + * Checks a inode directory to see if there are any enties matching name
10213 + * or ino. If entry is found the valid bit is set.
10215 - * Notes: DirCacheLock should be held before calling this routine.
10219 - *========================================================================*/
10220 + * DirCacheLock should be held before calling this routine.
10222 +int novfs_lookup_validate(struct inode *i, struct qstr *name, ino_t ino)
10224 struct inode_data *id;
10225 - struct dir_cache *dc;
10226 + struct novfs_dir_cache *dc;
10228 char *n = "<NULL>";
10231 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10232 + if (i && (id = i->i_private) && id->DirCache.next) {
10233 if (name && name->len) {
10234 n = (char *)name->name;
10237 - DbgPrint("Novfs_update_entry:\n"
10238 + DbgPrint("novfs_update_entry:\n"
10240 " name: %.*s\n" " ino: %d\n", i, nl, n, ino);
10242 - dc = Novfs_lookup_inode_cache(i, name, ino);
10243 + dc = novfs_lookup_inode_cache(i, name, ino);
10245 dc->flags |= ENTRY_VALID;
10247 @@ -5197,46 +4390,37 @@ int Novfs_lookup_validate(struct inode *
10251 -/*++======================================================================*/
10252 -int Novfs_add_inode_entry(struct inode *i,
10253 - struct qstr *name, ino_t ino, struct entry_info *info)
10257 - * Returns: -ENOMEM - alloc error.
10260 - * Abstract: Added entry to directory cache.
10262 - * Notes: DirCacheLock should be held before calling this routine.
10265 + * Added entry to directory cache.
10267 - *========================================================================*/
10268 + * DirCacheLock should be held before calling this routine.
10270 +int novfs_add_inode_entry(struct inode *i,
10271 + struct qstr *name, ino_t ino, struct novfs_entry_info *info)
10273 struct inode_data *id;
10274 - struct dir_cache *new;
10275 + struct novfs_dir_cache *new;
10276 int retVal = -ENOMEM;
10277 - struct dir_cache *todel;
10278 + struct novfs_dir_cache *todel;
10279 struct list_head *todeltmp;
10282 - DbgPrint("Novfs_add_inode_entry:\n" " i: %u\n", i);
10283 - if ((id = i->FSPRIVATE)) {
10284 - DbgPrint(" i->FSPRIVATE: %p\n", id);
10285 + DbgPrint("novfs_add_inode_entry:\n" " i: %u\n", i);
10286 + if ((id = i->i_private)) {
10287 + DbgPrint(" i->i_private: %p\n", id);
10288 if (id->DirCache.next)
10289 DbgPrint(" id->DirCache.next: %p\n",
10290 id->DirCache.next);
10294 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10295 - new = Novfs_Malloc(sizeof(struct dir_cache) + name->len, GFP_KERNEL);
10296 + if (i && (id = i->i_private) && id->DirCache.next) {
10297 + new = kmalloc(sizeof(struct novfs_dir_cache) + name->len, GFP_KERNEL);
10302 - DbgPrint("Novfs_add_inode_entry:\n"
10303 + DbgPrint("novfs_add_inode_entry:\n"
10307 @@ -5265,7 +4449,7 @@ int Novfs_add_inode_entry(struct inode *
10309 if (id->cntDC > 20) {
10310 todeltmp = id->DirCache.prev;
10311 - todel = list_entry(todeltmp, struct dir_cache, list);
10312 + todel = list_entry(todeltmp, struct novfs_dir_cache, list);
10314 list_del(&todel->list);
10316 @@ -5274,29 +4458,20 @@ int Novfs_add_inode_entry(struct inode *
10326 -/*++======================================================================*/
10327 -int Novfs_update_entry(struct inode *i, struct qstr *name, ino_t ino,
10328 - struct entry_info *info)
10336 - * Notes: DirCacheLock should be held before calling this routine.
10340 - *========================================================================*/
10341 + * DirCacheLock should be held before calling this routine.
10343 +int novfs_update_entry(struct inode *i, struct qstr *name, ino_t ino,
10344 + struct novfs_entry_info *info)
10346 struct inode_data *id;
10347 - struct dir_cache *dc;
10348 + struct novfs_dir_cache *dc;
10350 char *n = "<NULL>";
10352 @@ -5304,7 +4479,7 @@ int Novfs_update_entry(struct inode *i,
10353 char mtime_buf[32];
10354 char ctime_buf[32];
10356 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10357 + if (i && (id = i->i_private) && id->DirCache.next) {
10359 if (name && name->len) {
10360 n = (char *)name->name;
10361 @@ -5313,7 +4488,7 @@ int Novfs_update_entry(struct inode *i,
10362 ctime_r(&info->atime.tv_sec, atime_buf);
10363 ctime_r(&info->mtime.tv_sec, mtime_buf);
10364 ctime_r(&info->ctime.tv_sec, ctime_buf);
10365 - DbgPrint("Novfs_update_entry:\n"
10366 + DbgPrint("novfs_update_entry:\n"
10370 @@ -5324,7 +4499,7 @@ int Novfs_update_entry(struct inode *i,
10371 i, nl, n, ino, info->size, atime_buf, mtime_buf,
10374 - dc = Novfs_lookup_inode_cache(i, name, ino);
10375 + dc = novfs_lookup_inode_cache(i, name, ino);
10378 dc->flags = ENTRY_VALID;
10379 @@ -5338,7 +4513,7 @@ int Novfs_update_entry(struct inode *i,
10380 ctime_r(&dc->atime.tv_sec, atime_buf);
10381 ctime_r(&dc->mtime.tv_sec, mtime_buf);
10382 ctime_r(&dc->ctime.tv_sec, ctime_buf);
10383 - DbgPrint("Novfs_update_entry entry: 0x%p\n"
10384 + DbgPrint("novfs_update_entry entry: 0x%p\n"
10388 @@ -5356,39 +4531,31 @@ int Novfs_update_entry(struct inode *i,
10389 dc->nameLen, dc->name);
10392 - DbgPrint("Novfs_update_entry: return %d\n", retVal);
10393 + DbgPrint("novfs_update_entry: return %d\n", retVal);
10397 -/*++======================================================================*/
10398 -void Novfs_remove_inode_entry(struct inode *i, struct qstr *name, ino_t ino)
10402 - * Returns: nothing
10404 - * Abstract: Removes entry from directory cache. You can specify a name
10405 - * or an inode number.
10407 - * Notes: DirCacheLock should be held before calling this routine.
10410 + * Removes entry from directory cache. You can specify a name
10411 + * or an inode number.
10413 - *========================================================================*/
10414 + * DirCacheLock should be held before calling this routine.
10416 +void novfs_remove_inode_entry(struct inode *i, struct qstr *name, ino_t ino)
10418 struct inode_data *id;
10419 - struct dir_cache *dc;
10420 + struct novfs_dir_cache *dc;
10421 char *n = "<NULL>";
10424 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10425 - dc = Novfs_lookup_inode_cache(i, name, ino);
10426 + if (i && (id = i->i_private) && id->DirCache.next) {
10427 + dc = novfs_lookup_inode_cache(i, name, ino);
10429 if (name && name->name) {
10431 n = (char *)name->name;
10433 - DbgPrint("Novfs_remove_inode_entry:\n"
10434 + DbgPrint("novfs_remove_inode_entry:\n"
10438 @@ -5411,30 +4578,22 @@ void Novfs_remove_inode_entry(struct ino
10442 -/*++======================================================================*/
10443 -void Novfs_free_invalid_entries(struct inode *i)
10445 - * Arguments: struct inode *i - pointer to directory inode.
10447 - * Returns: nothing
10449 - * Abstract: Frees all invalid entries in the directory cache.
10451 - * Notes: DirCacheLock should be held before calling this routine.
10454 + * Frees all invalid entries in the directory cache.
10456 - *========================================================================*/
10457 + * DirCacheLock should be held before calling this routine.
10459 +void novfs_free_invalid_entries(struct inode *i)
10461 struct inode_data *id;
10462 - struct dir_cache *dc;
10463 + struct novfs_dir_cache *dc;
10464 struct list_head *l;
10466 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10467 + if (i && (id = i->i_private) && id->DirCache.next) {
10468 list_for_each(l, &id->DirCache) {
10469 - dc = list_entry(l, struct dir_cache, list);
10470 + dc = list_entry(l, struct novfs_dir_cache, list);
10471 if (0 == (dc->flags & ENTRY_VALID)) {
10472 - DbgPrint("Novfs_free_invalid_entries:\n"
10473 + DbgPrint("novfs_free_invalid_entries:\n"
10477 @@ -5453,28 +4612,20 @@ void Novfs_free_invalid_entries(struct i
10481 -/*++======================================================================*/
10482 -void Novfs_free_inode_cache(struct inode *i)
10484 - * Arguments: struct inode *i - pointer to directory inode.
10486 - * Returns: nothing
10488 - * Abstract: Frees all entries in the inode cache.
10490 - * Notes: DirCacheLock should be held before calling this routine.
10493 + * Frees all entries in the inode cache.
10495 - *========================================================================*/
10496 + * DirCacheLock should be held before calling this routine.
10498 +void novfs_free_inode_cache(struct inode *i)
10500 struct inode_data *id;
10501 - struct dir_cache *dc;
10502 + struct novfs_dir_cache *dc;
10503 struct list_head *l;
10505 - if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10506 + if (i && (id = i->i_private) && id->DirCache.next) {
10507 list_for_each(l, &id->DirCache) {
10508 - dc = list_entry(l, struct dir_cache, list);
10509 + dc = list_entry(l, struct novfs_dir_cache, list);
10511 list_del(&dc->list);
10513 @@ -5485,12 +4636,12 @@ void Novfs_free_inode_cache(struct inode
10517 -void Novfs_dump_inode(void *pf)
10518 +void novfs_dump_inode(void *pf)
10520 struct inode *inode;
10521 void (*pfunc) (char *Fmt, ...) = pf;
10522 struct inode_data *id;
10523 - struct dir_cache *dc;
10524 + struct novfs_dir_cache *dc;
10525 struct list_head *il, *l;
10526 char atime_buf[32];
10527 char mtime_buf[32];
10528 @@ -5517,13 +4668,14 @@ void Novfs_dump_inode(void *pf)
10529 pfunc(" count=0%o\n", atomic_read(&inode->i_count));
10532 - pfunc(" inode_data: 0x%p Name=%s Scope=0x%p\n", id, id->Name,
10533 + pfunc(" nofs_inode_data: 0x%p Name=%s Scope=0x%p\n", id, id->Name,
10536 if (id->DirCache.next) {
10537 list_for_each(l, &id->DirCache) {
10539 - dc = list_entry(l, struct dir_cache, list);
10540 + dc = list_entry(l, struct novfs_dir_cache,
10542 ctime_r(&dc->atime.tv_sec, atime_buf);
10543 ctime_r(&dc->mtime.tv_sec, mtime_buf);
10544 ctime_r(&dc->ctime.tv_sec, ctime_buf);
10545 --- a/fs/novfs/nwcapi.c
10546 +++ b/fs/novfs/nwcapi.c
10547 @@ -27,16 +27,20 @@
10549 #include "commands.h"
10551 -static void GetUserData(NwcScanConnInfo *connInfo, PXPLAT_CALL_REQUEST cmd, PXPLAT_CALL_REPLY reply);
10552 -static void GetConnData(NwcGetConnInfo *connInfo, PXPLAT_CALL_REQUEST cmd, PXPLAT_CALL_REPLY reply);
10553 +#ifndef strlen_user
10554 +#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
10557 +static void GetUserData(struct nwc_scan_conn_info * connInfo, struct novfs_xplat_call_request *cmd, struct novfs_xplat_call_reply *reply);
10558 +static void GetConnData(struct nwc_get_conn_info * connInfo, struct novfs_xplat_call_request *cmd, struct novfs_xplat_call_reply *reply);
10560 -int NwOpenConnByName(PXPLAT pdata, HANDLE * Handle, session_t Session)
10561 +/*++======================================================================*/
10562 +int novfs_open_conn_by_name(struct novfs_xplat *pdata, void ** Handle, struct novfs_schandle Session)
10564 - PXPLAT_CALL_REQUEST cmd;
10565 - PXPLAT_CALL_REPLY reply;
10566 - PNwdCOpenConnByName openConn, connReply;
10567 - NwcOpenConnByName ocbn;
10568 + struct novfs_xplat_call_request *cmd;
10569 + struct novfs_xplat_call_reply *reply;
10570 + struct nwd_open_conn_by_name *openConn, *connReply;
10571 + struct nwc_open_conn_by_name ocbn;
10573 unsigned long cmdlen, datalen, replylen, cpylen;
10575 @@ -45,15 +49,17 @@ int NwOpenConnByName(PXPLAT pdata, HANDL
10576 datalen = sizeof(*openConn) + strlen_user(ocbn.pName->pString) + strlen_user(ocbn.pServiceType);
10577 cmdlen = datalen + sizeof(*cmd);
10578 cmd = kmalloc(cmdlen, GFP_KERNEL);
10583 cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
10584 cmd->Command.SequenceNumber = 0;
10585 cmd->Command.SessionId = Session;
10586 cmd->NwcCommand = NWC_OPEN_CONN_BY_NAME;
10588 cmd->dataLen = datalen;
10589 - openConn = (PNwdCOpenConnByName) cmd->data;
10590 + openConn = (struct nwd_open_conn_by_name *) cmd->data;
10592 openConn->nameLen = strlen_user(ocbn.pName->pString);
10593 openConn->serviceLen = strlen_user(ocbn.pServiceType);
10594 @@ -64,24 +70,29 @@ int NwOpenConnByName(PXPLAT pdata, HANDL
10595 openConn->oName = sizeof(*openConn);
10597 openConn->oServiceType = openConn->oName + openConn->nameLen;
10598 - cpylen = copy_from_user(data, ocbn.pName->pString, openConn->nameLen);
10600 + copy_from_user(data, ocbn.pName->pString,
10601 + openConn->nameLen);
10602 data += openConn->nameLen;
10603 - cpylen = copy_from_user(data, ocbn.pServiceType, openConn->serviceLen);
10605 + copy_from_user(data, ocbn.pServiceType,
10606 + openConn->serviceLen);
10608 - retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10609 - (void **)&reply, &replylen,
10612 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10613 + (void **)&reply, &replylen,
10617 * we got reply data from the daemon
10619 - connReply = (PNwdCOpenConnByName) reply->data;
10620 + connReply = (struct nwd_open_conn_by_name *) reply->data;
10621 retCode = reply->Reply.ErrorCode;
10624 * we got valid data.
10626 - connReply = (PNwdCOpenConnByName) reply->data;
10627 + connReply = (struct nwd_open_conn_by_name *) reply->data;
10628 ocbn.RetConnHandle = HandletoUint32(connReply->newConnHandle);
10629 *Handle = connReply->newConnHandle;
10631 @@ -92,18 +103,17 @@ int NwOpenConnByName(PXPLAT pdata, HANDL
10637 + return ((int)retCode);
10641 -int NwOpenConnByAddr(PXPLAT pdata, HANDLE * Handle, session_t Session)
10642 +int novfs_open_conn_by_addr(struct novfs_xplat *pdata, void ** Handle, struct novfs_schandle Session)
10644 - PXPLAT_CALL_REQUEST cmd;
10645 - PXPLAT_CALL_REPLY reply;
10646 - PNwdCOpenConnByAddr openConn, connReply;
10647 - NwcOpenConnByAddr ocba;
10648 - NwcTranAddr tranAddr;
10649 + struct novfs_xplat_call_request *cmd;
10650 + struct novfs_xplat_call_reply *reply;
10651 + struct nwd_open_conn_by_addr *openConn, *connReply;
10652 + struct nwc_open_conn_by_addr ocba;
10653 + struct nwc_tran_addr tranAddr;
10655 unsigned long cmdlen, datalen, replylen, cpylen;
10656 char addr[MAX_ADDRESS_LENGTH];
10657 @@ -112,6 +122,7 @@ int NwOpenConnByAddr(PXPLAT pdata, HANDL
10658 datalen = sizeof(*openConn);
10659 cmdlen = datalen + sizeof(*cmd);
10660 cmd = kmalloc(cmdlen, GFP_KERNEL);
10665 @@ -120,69 +131,66 @@ int NwOpenConnByAddr(PXPLAT pdata, HANDL
10666 cmd->Command.SessionId = Session;
10667 cmd->NwcCommand = NWC_OPEN_CONN_BY_ADDRESS;
10668 cmd->dataLen = datalen;
10669 - openConn = (PNwdCOpenConnByAddr) cmd->data;
10670 + openConn = (struct nwd_open_conn_by_addr *) cmd->data;
10672 - cpylen = copy_from_user(&tranAddr, ocba.pTranAddr, sizeof(tranAddr));
10674 + copy_from_user(&tranAddr, ocba.pTranAddr, sizeof(tranAddr));
10676 DbgPrint("NwOpenConnByAddr: tranAddr\n");
10677 - mydump(sizeof(tranAddr), &tranAddr);
10678 + novfs_dump(sizeof(tranAddr), &tranAddr);
10680 openConn->TranAddr.uTransportType = tranAddr.uTransportType;
10681 openConn->TranAddr.uAddressLength = tranAddr.uAddressLength;
10682 memset(addr, 0xcc, sizeof(addr) - 1);
10684 - cpylen = copy_from_user(addr, tranAddr.puAddress, tranAddr.uAddressLength);
10686 + copy_from_user(addr, tranAddr.puAddress,
10687 + tranAddr.uAddressLength);
10689 DbgPrint("NwOpenConnByAddr: addr\n");
10690 - mydump(sizeof(addr), addr);
10691 + novfs_dump(sizeof(addr), addr);
10693 - openConn->TranAddr.oAddress = *(unsigned int*) (&addr[2]);
10694 + openConn->TranAddr.oAddress = *(unsigned int *) (&addr[2]);
10696 - retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10697 - (void **)&reply, &replylen,
10700 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10701 + (void **)&reply, &replylen,
10705 * we got reply data from the daemon
10707 - connReply = (PNwdCOpenConnByAddr) reply->data;
10708 + connReply = (struct nwd_open_conn_by_addr *) reply->data;
10709 retCode = reply->Reply.ErrorCode;
10712 * we got valid data.
10714 - connReply = (PNwdCOpenConnByAddr) reply->data;
10715 - ocba.ConnHandle = HandletoUint32(connReply->ConnHandle);
10716 + connReply = (struct nwd_open_conn_by_addr *) reply->data;
10717 + ocba.ConnHandle =
10718 + HandletoUint32(connReply->ConnHandle);
10719 *Handle = connReply->ConnHandle;
10720 - cpylen = copy_to_user(pdata->reqData, &ocba, sizeof(ocba));
10721 - DbgPrint("New Conn Handle = %X\n", connReply->ConnHandle);
10723 + copy_to_user(pdata->reqData, &ocba,
10725 + DbgPrint("New Conn Handle = %X\n",
10726 + connReply->ConnHandle);
10734 + return (retCode);
10738 -/*++======================================================================*/
10739 -int NwOpenConnByRef(PXPLAT pdata, HANDLE * Handle, session_t Session)
10751 - *========================================================================*/
10753 - PXPLAT_CALL_REQUEST cmd;
10754 - PXPLAT_CALL_REPLY reply;
10755 - PNwdCOpenConnByRef openConn;
10756 - NwcOpenConnByReference ocbr;
10757 +int novfs_open_conn_by_ref(struct novfs_xplat *pdata, void ** Handle, struct novfs_schandle Session)
10759 + struct novfs_xplat_call_request *cmd;
10760 + struct novfs_xplat_call_reply *reply;
10761 + struct nwd_open_conn_by_ref *openConn;
10762 + struct nwc_open_conn_by_ref ocbr;
10763 int retCode = -ENOMEM;
10764 unsigned long cmdlen, datalen, replylen, cpylen;
10766 @@ -198,29 +206,35 @@ int NwOpenConnByRef(PXPLAT pdata, HANDLE
10767 cmd->Command.SessionId = Session;
10768 cmd->NwcCommand = NWC_OPEN_CONN_BY_REFERENCE;
10769 cmd->dataLen = datalen;
10770 - openConn = (PNwdCOpenConnByRef) cmd->data;
10771 + openConn = (struct nwd_open_conn_by_ref *) cmd->data;
10773 - openConn->uConnReference = (HANDLE) (unsigned long) ocbr.uConnReference;
10774 + openConn->uConnReference =
10775 + (void *) (unsigned long) ocbr.uConnReference;
10776 openConn->uConnFlags = ocbr.uConnFlags;
10778 - retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10779 - (void **)&reply, &replylen,
10782 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10783 + (void **)&reply, &replylen,
10787 * we got reply data from the daemon
10789 - openConn = (PNwdCOpenConnByRef) reply->data;
10790 + openConn = (struct nwd_open_conn_by_ref *) reply->data;
10791 retCode = reply->Reply.ErrorCode;
10794 * we got valid data.
10796 - ocbr.ConnHandle = HandletoUint32(openConn->ConnHandle);
10797 + ocbr.ConnHandle =
10798 + HandletoUint32(openConn->ConnHandle);
10799 *Handle = openConn->ConnHandle;
10801 - cpylen = copy_to_user(pdata->reqData, &ocbr, sizeof(ocbr));
10802 - DbgPrint("New Conn Handle = %X\n", openConn->ConnHandle);
10804 + copy_to_user(pdata->reqData, &ocbr,
10806 + DbgPrint("New Conn Handle = %X\n",
10807 + openConn->ConnHandle);
10811 @@ -230,19 +244,17 @@ int NwOpenConnByRef(PXPLAT pdata, HANDLE
10815 -int NwRawSend(PXPLAT pdata, session_t Session)
10816 +int novfs_raw_send(struct novfs_xplat *pdata, struct novfs_schandle Session)
10818 - NwcRequest xRequest;
10819 - PNwcFrag frag = NULL;
10820 - PNwcFrag cFrag = NULL;
10821 - PNwcFrag reqFrag = NULL;
10822 - PXPLAT_CALL_REQUEST cmd;
10823 - PXPLAT_CALL_REPLY reply;
10824 + struct nwc_request xRequest;
10825 + struct nwc_frag *frag, *cFrag, *reqFrag;
10826 + struct novfs_xplat_call_request *cmd;
10827 + struct novfs_xplat_call_reply *reply;
10828 int retCode = -ENOMEM;
10829 unsigned long cmdlen, datalen, replylen, cpylen, totalLen;
10831 - PNwdCNCPReq ncpData;
10832 - PNwdCNCPRep ncpReply;
10833 + struct nwd_ncp_req *ncpData;
10834 + struct nwd_ncp_rep *ncpReply;
10835 unsigned char *reqData;
10836 unsigned long actualReplyLength = 0;
10838 @@ -252,13 +264,18 @@ int NwRawSend(PXPLAT pdata, session_t Se
10840 * Figure out the length of the request
10842 - frag = kmalloc(xRequest.uNumReplyFrags * sizeof(NwcFrag), GFP_KERNEL);
10843 - DbgPrint("[XPLAT RawNCP] - Reply Frag Count 0x%X\n", xRequest.uNumReplyFrags);
10845 + kmalloc(xRequest.uNumReplyFrags * sizeof(struct nwc_frag), GFP_KERNEL);
10847 + DbgPrint("[XPLAT RawNCP] - Reply Frag Count 0x%X\n",
10848 + xRequest.uNumReplyFrags);
10852 + return (retCode);
10854 - cpylen = copy_from_user(frag, xRequest.pReplyFrags, xRequest.uNumReplyFrags * sizeof(NwcFrag));
10856 + copy_from_user(frag, xRequest.pReplyFrags,
10857 + xRequest.uNumReplyFrags * sizeof(struct nwc_frag));
10861 @@ -270,11 +287,17 @@ int NwRawSend(PXPLAT pdata, session_t Se
10863 DbgPrint("[XPLAT - RawNCP] - totalLen = %d\n", totalLen);
10865 - reqFrag = kmalloc(xRequest.uNumRequestFrags * sizeof(NwcFrag), GFP_KERNEL);
10869 + kmalloc(xRequest.uNumRequestFrags * sizeof(struct nwc_frag),
10873 + return (retCode);
10876 - cpylen = copy_from_user(reqFrag, xRequest.pRequestFrags, xRequest.uNumRequestFrags * sizeof(NwcFrag));
10878 + copy_from_user(reqFrag, xRequest.pRequestFrags,
10879 + xRequest.uNumRequestFrags * sizeof(struct nwc_frag));
10881 for (x = 0; x < xRequest.uNumRequestFrags; x++) {
10882 datalen += cFrag->uLength;
10883 @@ -285,12 +308,13 @@ int NwRawSend(PXPLAT pdata, session_t Se
10884 * Allocate the cmd Request
10886 cmdlen = datalen + sizeof(*cmd) + sizeof(*ncpData);
10887 - DbgPrint("[XPLAT RawNCP] - Frag Count 0x%X\n", xRequest.uNumRequestFrags);
10888 + DbgPrint("[XPLAT RawNCP] - Frag Count 0x%X\n",
10889 + xRequest.uNumRequestFrags);
10890 DbgPrint("[XPLAT RawNCP] - Total Command Data Len = %x\n", cmdlen);
10892 cmd = kmalloc(cmdlen, GFP_KERNEL);
10897 cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
10898 cmd->Command.SequenceNumber = 0;
10899 @@ -301,10 +325,10 @@ int NwRawSend(PXPLAT pdata, session_t Se
10900 * build the NCP Request
10902 cmd->dataLen = cmdlen - sizeof(*cmd);
10903 - ncpData = (PNwdCNCPReq) cmd->data;
10904 + ncpData = (struct nwd_ncp_req *) cmd->data;
10905 ncpData->replyLen = totalLen;
10906 ncpData->requestLen = datalen;
10907 - ncpData->ConnHandle = (HANDLE) (unsigned long) xRequest.ConnHandle;
10908 + ncpData->ConnHandle = (void *) (unsigned long) xRequest.ConnHandle;
10909 ncpData->function = xRequest.uFunction;
10911 reqData = ncpData->data;
10912 @@ -312,15 +336,16 @@ int NwRawSend(PXPLAT pdata, session_t Se
10914 for (x = 0; x < xRequest.uNumRequestFrags; x++) {
10916 - copy_from_user(reqData, cFrag->pData,
10918 + copy_from_user(reqData, cFrag->pData,
10920 reqData += cFrag->uLength;
10924 - retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10925 - (void **)&reply, &replylen,
10928 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10929 + (void **)&reply, &replylen,
10931 DbgPrint("RawNCP - reply = %x\n", reply);
10932 DbgPrint("RawNCP - retCode = %x\n", retCode);
10934 @@ -328,11 +353,11 @@ int NwRawSend(PXPLAT pdata, session_t Se
10936 * we got reply data from the daemon
10938 - ncpReply = (PNwdCNCPRep) reply->data;
10939 + ncpReply = (struct nwd_ncp_rep *) reply->data;
10940 retCode = reply->Reply.ErrorCode;
10942 DbgPrint("RawNCP - Reply Frag Count 0x%X\n",
10943 - xRequest.uNumReplyFrags);
10944 + xRequest.uNumReplyFrags);
10947 * We need to copy the reply frags to the packet.
10948 @@ -344,11 +369,14 @@ int NwRawSend(PXPLAT pdata, session_t Se
10949 for (x = 0; x < xRequest.uNumReplyFrags; x++) {
10951 DbgPrint("RawNCP - Copy Frag %d: 0x%X\n", x,
10955 - datalen = min((unsigned long)cFrag->uLength, totalLen);
10957 + min((unsigned long) cFrag->uLength, totalLen);
10959 - cpylen = copy_to_user(cFrag->pData, reqData, datalen);
10961 + copy_to_user(cFrag->pData, reqData,
10963 totalLen -= datalen;
10964 reqData += datalen;
10965 actualReplyLength += datalen;
10966 @@ -362,22 +390,21 @@ int NwRawSend(PXPLAT pdata, session_t Se
10971 xRequest.uActualReplyLength = actualReplyLength;
10972 cpylen = copy_to_user(pdata->reqData, &xRequest, sizeof(xRequest));
10979 + return (retCode);
10982 -int NwConnClose(PXPLAT pdata, HANDLE * Handle, session_t Session)
10983 +int novfs_conn_close(struct novfs_xplat *pdata, void ** Handle, struct novfs_schandle Session)
10985 - PXPLAT_CALL_REQUEST cmd;
10986 - PXPLAT_CALL_REPLY reply;
10988 - PNwdCCloseConn nwdClose;
10989 + struct novfs_xplat_call_request *cmd;
10990 + struct novfs_xplat_call_reply *reply;
10991 + struct nwc_close_conn cc;
10992 + struct nwd_close_conn *nwdClose;
10994 unsigned long cmdlen, datalen, replylen, cpylen;
10996 @@ -388,35 +415,36 @@ int NwConnClose(PXPLAT pdata, HANDLE * H
10997 cmd = kmalloc(cmdlen, GFP_KERNEL);
11001 cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11002 cmd->Command.SequenceNumber = 0;
11003 cmd->Command.SessionId = Session;
11004 cmd->NwcCommand = NWC_CLOSE_CONN;
11006 - nwdClose = (PNwdCCloseConn) cmd->data;
11007 + nwdClose = (struct nwd_close_conn *) cmd->data;
11008 cmd->dataLen = sizeof(*nwdClose);
11009 *Handle = nwdClose->ConnHandle = Uint32toHandle(cc.ConnHandle);
11014 - retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11015 - (void **)&reply, &replylen, 0);
11017 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11018 + (void **)&reply, &replylen, 0);
11020 retCode = reply->Reply.ErrorCode;
11025 + return (retCode);
11029 -int NwSysConnClose(PXPLAT pdata, unsigned long *Handle, session_t Session)
11030 +int novfs_sys_conn_close(struct novfs_xplat *pdata, unsigned long *Handle, struct novfs_schandle Session)
11032 - PXPLAT_CALL_REQUEST cmd;
11033 - PXPLAT_CALL_REPLY reply;
11035 - PNwdCCloseConn nwdClose;
11036 + struct novfs_xplat_call_request *cmd;
11037 + struct novfs_xplat_call_reply *reply;
11038 + struct nwc_close_conn cc;
11039 + struct nwd_close_conn *nwdClose;
11040 unsigned int retCode = 0;
11041 unsigned long cmdlen, datalen, replylen, cpylen;
11043 @@ -424,133 +452,87 @@ int NwSysConnClose(PXPLAT pdata, unsigne
11045 datalen = sizeof(*nwdClose);
11046 cmdlen = datalen + sizeof(*cmd);
11047 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11049 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11050 - cmd->Command.SequenceNumber = 0;
11051 - cmd->Command.SessionId = Session;
11052 - cmd->NwcCommand = NWC_SYS_CLOSE_CONN;
11054 - nwdClose = (PNwdCCloseConn) cmd->data;
11055 - cmd->dataLen = sizeof(*nwdClose);
11056 - nwdClose->ConnHandle = (HANDLE) (unsigned long) cc.ConnHandle;
11057 - *Handle = (unsigned long) cc.ConnHandle;
11058 + cmd = kmalloc(cmdlen, GFP_KERNEL);
11061 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11062 + cmd->Command.SequenceNumber = 0;
11063 + cmd->Command.SessionId = Session;
11064 + cmd->NwcCommand = NWC_SYS_CLOSE_CONN;
11067 - * send the request
11070 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11071 - (void **)&reply, &replylen, 0);
11073 - retCode = reply->Reply.ErrorCode;
11077 + nwdClose = (struct nwd_close_conn *) cmd->data;
11078 + cmd->dataLen = sizeof(*nwdClose);
11079 + nwdClose->ConnHandle = (void *) (unsigned long) cc.ConnHandle;
11080 + *Handle = (unsigned long) cc.ConnHandle;
11083 + * send the request
11086 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0, (void **)&reply, &replylen, 0);
11088 + retCode = reply->Reply.ErrorCode;
11097 -/*++======================================================================*/
11098 -int NwLoginIdentity(PXPLAT pdata, struct schandle *Session)
11110 - *========================================================================*/
11111 +int novfs_login_id(struct novfs_xplat *pdata, struct novfs_schandle Session)
11113 - NwcLoginIdentity lgn, *plgn;
11114 + struct nwc_login_id lgn, *plgn;
11115 int retCode = -ENOMEM;
11116 - NclString server;
11117 - NclString username;
11118 - NclString password;
11119 + struct ncl_string server;
11120 + struct ncl_string username;
11121 + struct ncl_string password;
11122 unsigned long cpylen;
11123 - NwcString nwcStr;
11124 + struct nwc_string nwcStr;
11126 cpylen = copy_from_user(&lgn, pdata->reqData, sizeof(lgn));
11128 DbgPrint("NwLoginIdentity:\n");
11129 - mydump(sizeof(lgn), &lgn);
11130 + novfs_dump(sizeof(lgn), &lgn);
11132 cpylen = copy_from_user(&nwcStr, lgn.pDomainName, sizeof(nwcStr));
11133 DbgPrint("NwLoginIdentity: DomainName\n");
11134 - mydump(sizeof(nwcStr), &nwcStr);
11135 + novfs_dump(sizeof(nwcStr), &nwcStr);
11137 - if ((server.buffer = Novfs_Malloc(nwcStr.DataLen, GFP_KERNEL))) {
11138 + if ((server.buffer = kmalloc(nwcStr.DataLen, GFP_KERNEL))) {
11139 server.type = nwcStr.DataType;
11140 server.len = nwcStr.DataLen;
11141 - if (!copy_from_user
11142 - ((void *)server.buffer, nwcStr.pBuffer, server.len)) {
11143 + if (!copy_from_user((void *)server.buffer, nwcStr.pBuffer, server.len)) {
11144 DbgPrint("NwLoginIdentity: Server\n");
11145 - mydump(server.len, server.buffer);
11146 + novfs_dump(server.len, server.buffer);
11149 - copy_from_user(&nwcStr, lgn.pObjectName,
11151 + cpylen = copy_from_user(&nwcStr, lgn.pObjectName, sizeof(nwcStr));
11152 DbgPrint("NwLoginIdentity: ObjectName\n");
11153 - mydump(sizeof(nwcStr), &nwcStr);
11154 + novfs_dump(sizeof(nwcStr), &nwcStr);
11156 - if ((username.buffer =
11157 - Novfs_Malloc(nwcStr.DataLen, GFP_KERNEL))) {
11158 + if ((username.buffer = kmalloc(nwcStr.DataLen, GFP_KERNEL))) {
11159 username.type = nwcStr.DataType;
11160 username.len = nwcStr.DataLen;
11161 - if (!copy_from_user
11162 - ((void *)username.buffer, nwcStr.pBuffer,
11164 + if (!copy_from_user((void *)username.buffer, nwcStr.pBuffer, username.len)) {
11165 DbgPrint("NwLoginIdentity: User\n");
11166 - mydump(username.len, username.buffer);
11167 + novfs_dump(username.len, username.buffer);
11170 - copy_from_user(&nwcStr,
11173 + cpylen = copy_from_user(&nwcStr, lgn.pPassword, sizeof(nwcStr));
11174 DbgPrint("NwLoginIdentity: Password\n");
11175 - mydump(sizeof(nwcStr), &nwcStr);
11176 + novfs_dump(sizeof(nwcStr), &nwcStr);
11178 - if ((password.buffer =
11179 - Novfs_Malloc(nwcStr.DataLen,
11181 + if ((password.buffer = kmalloc(nwcStr.DataLen, GFP_KERNEL))) {
11182 password.type = nwcStr.DataType;
11183 password.len = nwcStr.DataLen;
11184 - if (!copy_from_user
11185 - ((void *)password.buffer,
11189 - do_login(&server,
11192 - (HANDLE *)&lgn.AuthenticationId,
11194 + if (!copy_from_user((void *)password.buffer, nwcStr.pBuffer, password.len)) {
11195 + retCode = novfs_do_login(&server, &username, &password, (void **)&lgn.AuthenticationId, &Session);
11197 lgn.AuthenticationId = 0;
11201 - (NwcLoginIdentity *)
11204 - copy_to_user(&plgn->
11205 - AuthenticationId,
11207 - AuthenticationId,
11210 - AuthenticationId));
11212 + plgn = (struct nwc_login_id *)pdata->reqData;
11213 + cpylen = copy_to_user(&plgn->AuthenticationId, &lgn.AuthenticationId, sizeof(plgn->AuthenticationId));
11215 - memset(password.buffer, 0,
11217 + memset(password.buffer, 0, password.len);
11218 kfree(password.buffer);
11221 @@ -563,633 +545,504 @@ int NwLoginIdentity(PXPLAT pdata, struct
11225 -/*++======================================================================*/
11226 -int NwAuthConnWithId(PXPLAT pdata, session_t Session)
11238 - *========================================================================*/
11240 - NwcAuthenticateWithId pauth;
11241 - PNwdCAuthenticateWithId pDauth;
11242 - PXPLAT_CALL_REQUEST cmd;
11243 - PXPLAT_CALL_REPLY reply;
11244 +int novfs_auth_conn(struct novfs_xplat *pdata, struct novfs_schandle Session)
11246 + struct nwc_auth_with_id pauth;
11247 + struct nwc_auth_wid *pDauth;
11248 + struct novfs_xplat_call_request *cmd;
11249 + struct novfs_xplat_call_reply *reply;
11250 int retCode = -ENOMEM;
11251 unsigned long cmdlen, datalen, replylen, cpylen;
11253 datalen = sizeof(*pDauth);
11254 cmdlen = datalen + sizeof(*cmd);
11255 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11256 + cmd = kmalloc(cmdlen, GFP_KERNEL);
11261 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11262 - cmd->Command.SequenceNumber = 0;
11263 - cmd->Command.SessionId = Session;
11264 - cmd->NwcCommand = NWC_AUTHENTICATE_CONN_WITH_ID;
11266 - cpylen = copy_from_user(&pauth, pdata->reqData, sizeof(pauth));
11268 - pDauth = (PNwdCAuthenticateWithId) cmd->data;
11269 - cmd->dataLen = datalen;
11270 - pDauth->AuthenticationId = pauth.AuthenticationId;
11271 - pDauth->ConnHandle = (HANDLE) (unsigned long) pauth.ConnHandle;
11274 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11275 - (void **)&reply, &replylen,
11278 - retCode = reply->Reply.ErrorCode;
11282 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11283 + cmd->Command.SequenceNumber = 0;
11284 + cmd->Command.SessionId = Session;
11285 + cmd->NwcCommand = NWC_AUTHENTICATE_CONN_WITH_ID;
11287 + cpylen = copy_from_user(&pauth, pdata->reqData, sizeof(pauth));
11289 + pDauth = (struct nwc_auth_wid *) cmd->data;
11290 + cmd->dataLen = datalen;
11291 + pDauth->AuthenticationId = pauth.AuthenticationId;
11292 + pDauth->ConnHandle = (void *) (unsigned long) pauth.ConnHandle;
11295 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11296 + (void **)&reply, &replylen,
11299 + retCode = reply->Reply.ErrorCode;
11305 -/*++======================================================================*/
11306 -int NwLicenseConn(PXPLAT pdata, session_t Session)
11318 - *========================================================================*/
11320 - PXPLAT_CALL_REQUEST cmd;
11321 - PXPLAT_CALL_REPLY reply;
11322 - NwcLicenseConn lisc;
11323 - PNwdCLicenseConn pDLisc;
11324 +int novfs_license_conn(struct novfs_xplat *pdata, struct novfs_schandle Session)
11326 + struct novfs_xplat_call_request *cmd;
11327 + struct novfs_xplat_call_reply *reply;
11328 + struct nwc_license_conn lisc;
11329 + struct nwc_lisc_id * pDLisc;
11330 int retCode = -ENOMEM;
11331 unsigned long cmdlen, datalen, replylen, cpylen;
11333 datalen = sizeof(*pDLisc);
11334 cmdlen = datalen + sizeof(*cmd);
11335 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11336 + cmd = kmalloc(cmdlen, GFP_KERNEL);
11341 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11342 - cmd->Command.SequenceNumber = 0;
11343 - cmd->Command.SessionId = Session;
11344 - cmd->NwcCommand = NWC_LICENSE_CONN;
11346 - cpylen = copy_from_user(&lisc, pdata->reqData, sizeof(lisc));
11348 - pDLisc = (PNwdCLicenseConn) cmd->data;
11349 - cmd->dataLen = datalen;
11350 - pDLisc->ConnHandle = (HANDLE) (unsigned long) lisc.ConnHandle;
11353 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11354 - (void **)&reply, &replylen,
11357 - retCode = reply->Reply.ErrorCode;
11361 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11362 + cmd->Command.SequenceNumber = 0;
11363 + cmd->Command.SessionId = Session;
11364 + cmd->NwcCommand = NWC_LICENSE_CONN;
11366 + cpylen = copy_from_user(&lisc, pdata->reqData, sizeof(lisc));
11368 + pDLisc = (struct nwc_lisc_id *) cmd->data;
11369 + cmd->dataLen = datalen;
11370 + pDLisc->ConnHandle = (void *) (unsigned long) lisc.ConnHandle;
11373 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11374 + (void **)&reply, &replylen,
11377 + retCode = reply->Reply.ErrorCode;
11384 -/*++======================================================================*/
11385 -int NwLogoutIdentity(PXPLAT pdata, session_t Session)
11397 - *========================================================================*/
11399 - PXPLAT_CALL_REQUEST cmd;
11400 - PXPLAT_CALL_REPLY reply;
11401 - NwcLogoutIdentity logout;
11402 - PNwdCLogoutIdentity pDLogout;
11403 +int novfs_logout_id(struct novfs_xplat *pdata, struct novfs_schandle Session)
11405 + struct novfs_xplat_call_request *cmd;
11406 + struct novfs_xplat_call_reply *reply;
11407 + struct nwc_lo_id logout, *pDLogout;
11408 int retCode = -ENOMEM;
11409 unsigned long cmdlen, datalen, replylen, cpylen;
11411 datalen = sizeof(*pDLogout);
11412 cmdlen = datalen + sizeof(*cmd);
11413 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11414 + cmd = kmalloc(cmdlen, GFP_KERNEL);
11417 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11418 - cmd->Command.SequenceNumber = 0;
11419 - cmd->Command.SessionId = Session;
11420 - cmd->NwcCommand = NWC_LOGOUT_IDENTITY;
11423 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11424 + cmd->Command.SequenceNumber = 0;
11425 + cmd->Command.SessionId = Session;
11426 + cmd->NwcCommand = NWC_LOGOUT_IDENTITY;
11429 - copy_from_user(&logout, pdata->reqData, sizeof(logout));
11431 + copy_from_user(&logout, pdata->reqData, sizeof(logout));
11433 - pDLogout = (PNwdCLogoutIdentity) cmd->data;
11434 - cmd->dataLen = datalen;
11435 - pDLogout->AuthenticationId = logout.AuthenticationId;
11438 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11439 - (void **)&reply, &replylen,
11442 - retCode = reply->Reply.ErrorCode;
11446 + pDLogout = (struct nwc_lo_id *) cmd->data;
11447 + cmd->dataLen = datalen;
11448 + pDLogout->AuthenticationId = logout.AuthenticationId;
11451 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11452 + (void **)&reply, &replylen,
11455 + retCode = reply->Reply.ErrorCode;
11462 -/*++======================================================================*/
11463 -int NwUnlicenseConn(PXPLAT pdata, session_t Session)
11475 - *========================================================================*/
11477 - PXPLAT_CALL_REQUEST cmd;
11478 - PXPLAT_CALL_REPLY reply;
11479 - PNwdCUnlicenseConn pUconn;
11480 - NwcUnlicenseConn ulc;
11481 +int novfs_unlicense_conn(struct novfs_xplat *pdata, struct novfs_schandle Session)
11483 + struct novfs_xplat_call_request *cmd;
11484 + struct novfs_xplat_call_reply *reply;
11485 + struct nwc_unlic_conn *pUconn, ulc;
11486 int retCode = -ENOMEM;
11487 unsigned long cmdlen, datalen, replylen, cpylen;
11489 cpylen = copy_from_user(&ulc, pdata->reqData, sizeof(ulc));
11490 datalen = sizeof(*pUconn);
11491 cmdlen = datalen + sizeof(*cmd);
11492 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11494 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11495 - cmd->Command.SequenceNumber = 0;
11496 - cmd->Command.SessionId = Session;
11497 - cmd->NwcCommand = NWC_UNLICENSE_CONN;
11498 - cmd->dataLen = datalen;
11499 - pUconn = (PNwdCUnlicenseConn) cmd->data;
11501 - pUconn->ConnHandle = (HANDLE) (unsigned long) ulc.ConnHandle;
11503 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11504 - (void **)&reply, &replylen,
11508 - * we got reply data from the daemon
11510 - retCode = reply->Reply.ErrorCode;
11513 + cmd = kmalloc(cmdlen, GFP_KERNEL);
11517 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11518 + cmd->Command.SequenceNumber = 0;
11519 + cmd->Command.SessionId = Session;
11520 + cmd->NwcCommand = NWC_UNLICENSE_CONN;
11521 + cmd->dataLen = datalen;
11522 + pUconn = (struct nwc_unlic_conn *) cmd->data;
11525 + pUconn->ConnHandle = (void *) (unsigned long) ulc.ConnHandle;
11527 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11528 + (void **)&reply, &replylen,
11532 + * we got reply data from the daemon
11534 + retCode = reply->Reply.ErrorCode;
11541 -/*++======================================================================*/
11542 -int NwUnAuthenticate(PXPLAT pdata, session_t Session)
11554 - *========================================================================*/
11556 - PXPLAT_CALL_REQUEST cmd;
11557 - PXPLAT_CALL_REPLY reply;
11558 - NwcUnauthenticate auth;
11559 - PNwdCUnauthenticate pDAuth;
11560 +int novfs_unauthenticate(struct novfs_xplat *pdata, struct novfs_schandle Session)
11562 + struct novfs_xplat_call_request *cmd;
11563 + struct novfs_xplat_call_reply *reply;
11564 + struct nwc_unauthenticate auth, *pDAuth;
11565 int retCode = -ENOMEM;
11566 unsigned long cmdlen, datalen, replylen, cpylen;
11568 datalen = sizeof(*pDAuth);
11569 cmdlen = datalen + sizeof(*cmd);
11570 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11571 + cmd = (struct novfs_xplat_call_request *)kmalloc(cmdlen, GFP_KERNEL);
11574 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11575 - cmd->Command.SequenceNumber = 0;
11576 - cmd->Command.SessionId = Session;
11577 - cmd->NwcCommand = NWC_UNAUTHENTICATE_CONN;
11579 - cpylen = copy_from_user(&auth, pdata->reqData, sizeof(auth));
11581 - pDAuth = (PNwdCUnauthenticate) cmd->data;
11582 - cmd->dataLen = datalen;
11583 - pDAuth->AuthenticationId = auth.AuthenticationId;
11584 - pDAuth->ConnHandle = (HANDLE) (unsigned long) auth.ConnHandle;
11587 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11588 - (void **)&reply, &replylen,
11591 - retCode = reply->Reply.ErrorCode;
11597 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11598 + cmd->Command.SequenceNumber = 0;
11599 + cmd->Command.SessionId = Session;
11600 + cmd->NwcCommand = NWC_UNAUTHENTICATE_CONN;
11602 + cpylen = copy_from_user(&auth, pdata->reqData, sizeof(auth));
11604 + pDAuth = (struct nwc_unauthenticate *) cmd->data;
11605 + cmd->dataLen = datalen;
11606 + pDAuth->AuthenticationId = auth.AuthenticationId;
11607 + pDAuth->ConnHandle = (void *) (unsigned long) auth.ConnHandle;
11610 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11611 + (void **)&reply, &replylen,
11614 + retCode = reply->Reply.ErrorCode;
11622 -/*++======================================================================*/
11623 -int NwGetConnInfo(PXPLAT pdata, session_t Session)
11635 - *========================================================================*/
11637 - PXPLAT_CALL_REQUEST cmd;
11638 - PXPLAT_CALL_REPLY reply;
11639 - NwcGetConnInfo connInfo;
11640 - PNwdCGetConnInfo pDConnInfo;
11641 +int novfs_get_conn_info(struct novfs_xplat *pdata, struct novfs_schandle Session)
11643 + struct novfs_xplat_call_request *cmd;
11644 + struct novfs_xplat_call_reply *reply;
11645 + struct nwc_get_conn_info connInfo;
11646 + struct nwd_conn_info *pDConnInfo;
11647 int retCode = -ENOMEM;
11648 unsigned long cmdlen, replylen, cpylen;
11650 cmdlen = sizeof(*cmd) + sizeof(*pDConnInfo);
11651 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11652 + cmd = kmalloc(cmdlen, GFP_KERNEL);
11654 - copy_from_user(&connInfo, pdata->reqData, sizeof(NwcGetConnInfo));
11655 + copy_from_user(&connInfo, pdata->reqData, sizeof(struct nwc_get_conn_info));
11658 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11659 - cmd->Command.SequenceNumber = 0;
11660 - cmd->Command.SessionId = Session;
11661 - cmd->NwcCommand = NWC_GET_CONN_INFO;
11663 - pDConnInfo = (PNwdCGetConnInfo) cmd->data;
11665 - pDConnInfo->ConnHandle = (HANDLE) (unsigned long) connInfo.ConnHandle;
11666 - pDConnInfo->uInfoLevel = connInfo.uInfoLevel;
11667 - pDConnInfo->uInfoLength = connInfo.uInfoLength;
11668 - cmd->dataLen = sizeof(*pDConnInfo);
11671 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11672 - (void **)&reply, &replylen,
11675 - retCode = reply->Reply.ErrorCode;
11677 - GetConnData(&connInfo, cmd, reply);
11682 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11683 + cmd->Command.SequenceNumber = 0;
11684 + cmd->Command.SessionId = Session;
11685 + cmd->NwcCommand = NWC_GET_CONN_INFO;
11688 + pDConnInfo = (struct nwd_conn_info *) cmd->data;
11690 + pDConnInfo->ConnHandle = (void *) (unsigned long) connInfo.ConnHandle;
11691 + pDConnInfo->uInfoLevel = connInfo.uInfoLevel;
11692 + pDConnInfo->uInfoLength = connInfo.uInfoLength;
11693 + cmd->dataLen = sizeof(*pDConnInfo);
11696 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11697 + (void **)&reply, &replylen,
11700 + retCode = reply->Reply.ErrorCode;
11702 + GetConnData(&connInfo, cmd, reply);
11714 -/*++======================================================================*/
11715 -int NwSetConnInfo(PXPLAT pdata, session_t Session)
11727 - *========================================================================*/
11729 - PXPLAT_CALL_REQUEST cmd;
11730 - PXPLAT_CALL_REPLY reply;
11731 - NwcSetConnInfo connInfo;
11732 - PNwdCSetConnInfo pDConnInfo;
11733 +int novfs_set_conn_info(struct novfs_xplat *pdata, struct novfs_schandle Session)
11735 + struct novfs_xplat_call_request *cmd;
11736 + struct novfs_xplat_call_reply *reply;
11737 + struct nwc_set_conn_info connInfo;
11738 + struct nwd_set_conn_info *pDConnInfo;
11739 int retCode = -ENOMEM;
11740 unsigned long cmdlen, replylen, cpylen;
11742 cmdlen = sizeof(*cmd) + sizeof(*pDConnInfo);
11743 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11744 + cmd = kmalloc(cmdlen, GFP_KERNEL);
11746 - copy_from_user(&connInfo, pdata->reqData, sizeof(NwcSetConnInfo));
11747 + copy_from_user(&connInfo, pdata->reqData, sizeof(struct nwc_set_conn_info));
11750 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11751 - cmd->Command.SequenceNumber = 0;
11752 - cmd->Command.SessionId = Session;
11753 - cmd->NwcCommand = NWC_SET_CONN_INFO;
11755 - pDConnInfo = (PNwdCSetConnInfo) cmd->data;
11757 - pDConnInfo->ConnHandle = (HANDLE) (unsigned long) connInfo.ConnHandle;
11758 - pDConnInfo->uInfoLevel = connInfo.uInfoLevel;
11759 - pDConnInfo->uInfoLength = connInfo.uInfoLength;
11760 - cmd->dataLen = sizeof(*pDConnInfo);
11763 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11764 - (void **)&reply, &replylen,
11767 - retCode = reply->Reply.ErrorCode;
11775 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11776 + cmd->Command.SequenceNumber = 0;
11777 + cmd->Command.SessionId = Session;
11778 + cmd->NwcCommand = NWC_SET_CONN_INFO;
11780 + pDConnInfo = (struct nwd_set_conn_info *) cmd->data;
11782 + pDConnInfo->ConnHandle = (void *) (unsigned long) connInfo.ConnHandle;
11783 + pDConnInfo->uInfoLevel = connInfo.uInfoLevel;
11784 + pDConnInfo->uInfoLength = connInfo.uInfoLength;
11785 + cmd->dataLen = sizeof(*pDConnInfo);
11788 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11789 + (void **)&reply, &replylen,
11792 + retCode = reply->Reply.ErrorCode;
11800 -/*++======================================================================*/
11801 -int NwGetIdentityInfo(PXPLAT pdata, session_t Session)
11813 - *========================================================================*/
11815 - PXPLAT_CALL_REQUEST cmd;
11816 - PXPLAT_CALL_REPLY reply;
11817 - NwcGetIdentityInfo qidInfo, *gId;
11818 - PNwdCGetIdentityInfo idInfo;
11819 - NwcString xferStr;
11820 +int novfs_get_id_info(struct novfs_xplat *pdata, struct novfs_schandle Session)
11822 + struct novfs_xplat_call_request *cmd;
11823 + struct novfs_xplat_call_reply *reply;
11824 + struct nwc_get_id_info qidInfo, *gId;
11825 + struct nwd_get_id_info *idInfo;
11826 + struct nwc_string xferStr;
11828 int retCode = -ENOMEM;
11829 unsigned long cmdlen, replylen, cpylen;
11831 cmdlen = sizeof(*cmd) + sizeof(*idInfo);
11832 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11833 + cmd = kmalloc(cmdlen, GFP_KERNEL);
11834 cpylen = copy_from_user(&qidInfo, pdata->reqData, sizeof(qidInfo));
11837 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11838 - cmd->Command.SequenceNumber = 0;
11839 - cmd->Command.SessionId = Session;
11840 - cmd->NwcCommand = NWC_GET_IDENTITY_INFO;
11842 - idInfo = (PNwdCGetIdentityInfo) cmd->data;
11844 - idInfo->AuthenticationId = qidInfo.AuthenticationId;
11845 - cmd->dataLen = sizeof(*idInfo);
11848 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11849 - (void **)&reply, &replylen,
11852 - retCode = reply->Reply.ErrorCode;
11854 - if (!reply->Reply.ErrorCode) {
11856 - * Save the return info to the user structure.
11858 - gId = pdata->reqData;
11859 - idInfo = (PNwdCGetIdentityInfo) reply->data;
11861 - copy_to_user(&gId->AuthenticationId,
11862 - &idInfo->AuthenticationId,
11867 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11868 + cmd->Command.SequenceNumber = 0;
11869 + cmd->Command.SessionId = Session;
11870 + cmd->NwcCommand = NWC_GET_IDENTITY_INFO;
11872 + idInfo = (struct nwd_get_id_info *) cmd->data;
11874 + idInfo->AuthenticationId = qidInfo.AuthenticationId;
11875 + cmd->dataLen = sizeof(*idInfo);
11878 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11879 + (void **)&reply, &replylen,
11882 + retCode = reply->Reply.ErrorCode;
11884 + if (!reply->Reply.ErrorCode) {
11886 + * Save the return info to the user structure.
11888 + gId = pdata->reqData;
11889 + idInfo = (struct nwd_get_id_info *) reply->data;
11891 + copy_to_user(&gId->AuthenticationId,
11892 + &idInfo->AuthenticationId,
11894 AuthenticationId));
11896 - copy_to_user(&gId->AuthType,
11897 - &idInfo->AuthType,
11898 - sizeof(idInfo->AuthType));
11900 - copy_to_user(&gId->IdentityFlags,
11901 - &idInfo->IdentityFlags,
11902 - sizeof(idInfo->IdentityFlags));
11904 - copy_to_user(&gId->NameType,
11905 - &idInfo->NameType,
11906 - sizeof(idInfo->NameType));
11908 - copy_to_user(&gId->ObjectType,
11909 - &idInfo->ObjectType,
11910 - sizeof(idInfo->ObjectType));
11913 - copy_from_user(&xferStr, gId->pDomainName,
11914 - sizeof(NwcString));
11916 - (char *)((char *)reply->data +
11917 - idInfo->pDomainNameOffset);
11919 - copy_to_user(xferStr.pBuffer, str,
11920 - idInfo->domainLen);
11921 - xferStr.DataType = NWC_STRING_TYPE_ASCII;
11922 - xferStr.DataLen = idInfo->domainLen;
11924 - copy_to_user(gId->pDomainName, &xferStr,
11925 - sizeof(NwcString));
11928 - copy_from_user(&xferStr, gId->pObjectName,
11929 - sizeof(NwcString));
11931 - (char *)((char *)reply->data +
11932 - idInfo->pObjectNameOffset);
11934 - copy_to_user(xferStr.pBuffer, str,
11935 - idInfo->objectLen);
11936 - xferStr.DataLen = idInfo->objectLen - 1;
11937 - xferStr.DataType = NWC_STRING_TYPE_ASCII;
11939 - copy_to_user(gId->pObjectName, &xferStr,
11940 - sizeof(NwcString));
11943 + copy_to_user(&gId->AuthType,
11944 + &idInfo->AuthType,
11945 + sizeof(idInfo->AuthType));
11947 + copy_to_user(&gId->IdentityFlags,
11948 + &idInfo->IdentityFlags,
11949 + sizeof(idInfo->IdentityFlags));
11951 + copy_to_user(&gId->NameType,
11952 + &idInfo->NameType,
11953 + sizeof(idInfo->NameType));
11955 + copy_to_user(&gId->ObjectType,
11956 + &idInfo->ObjectType,
11957 + sizeof(idInfo->ObjectType));
11961 + copy_from_user(&xferStr, gId->pDomainName,
11962 + sizeof(struct nwc_string));
11964 + (char *)((char *)reply->data +
11965 + idInfo->pDomainNameOffset);
11967 + copy_to_user(xferStr.pBuffer, str,
11968 + idInfo->domainLen);
11969 + xferStr.DataType = NWC_STRING_TYPE_ASCII;
11970 + xferStr.DataLen = idInfo->domainLen;
11972 + copy_to_user(gId->pDomainName, &xferStr,
11973 + sizeof(struct nwc_string));
11976 + copy_from_user(&xferStr, gId->pObjectName,
11977 + sizeof(struct nwc_string));
11979 + (char *)((char *)reply->data +
11980 + idInfo->pObjectNameOffset);
11982 + copy_to_user(xferStr.pBuffer, str,
11983 + idInfo->objectLen);
11984 + xferStr.DataLen = idInfo->objectLen - 1;
11985 + xferStr.DataType = NWC_STRING_TYPE_ASCII;
11987 + copy_to_user(gId->pObjectName, &xferStr,
11988 + sizeof(struct nwc_string));
11999 -/*++======================================================================*/
12000 -int NwScanConnInfo(PXPLAT pdata, session_t Session)
12012 - *========================================================================*/
12014 - PXPLAT_CALL_REQUEST cmd;
12015 - PXPLAT_CALL_REPLY reply;
12016 - NwcScanConnInfo connInfo, *rInfo;
12017 - PNwdCScanConnInfo pDConnInfo;
12018 +int novfs_scan_conn_info(struct novfs_xplat *pdata, struct novfs_schandle Session)
12020 + struct novfs_xplat_call_request *cmd;
12021 + struct novfs_xplat_call_reply *reply;
12022 + struct nwc_scan_conn_info connInfo, *rInfo;
12023 + struct nwd_scan_conn_info *pDConnInfo;
12024 int retCode = -ENOMEM;
12025 unsigned long cmdlen, replylen, cpylen;
12026 unsigned char *localData;
12029 - copy_from_user(&connInfo, pdata->reqData, sizeof(NwcScanConnInfo));
12030 + copy_from_user(&connInfo, pdata->reqData, sizeof(struct nwc_scan_conn_info));
12032 cmdlen = sizeof(*cmd) + sizeof(*pDConnInfo) + connInfo.uScanInfoLen;
12033 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12034 + cmd = kmalloc(cmdlen, GFP_KERNEL);
12039 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12040 - cmd->Command.SequenceNumber = 0;
12041 - cmd->Command.SessionId = Session;
12042 - cmd->NwcCommand = NWC_SCAN_CONN_INFO;
12044 - pDConnInfo = (PNwdCScanConnInfo) cmd->data;
12046 - DbgPrint("NwScanConnInfo: Input Data\n");
12047 - DbgPrint("connInfo.uScanIndex = 0x%X\n", connInfo.uScanIndex);
12048 - DbgPrint("connInfo.uConnectionReference = 0x%X\n",
12049 - connInfo.uConnectionReference);
12050 - DbgPrint("connInfo.uScanInfoLevel = 0x%X\n",
12051 - connInfo.uScanInfoLevel);
12052 - DbgPrint("connInfo.uScanInfoLen = 0x%X\n",
12053 - connInfo.uScanInfoLen);
12054 - DbgPrint("connInfo.uReturnInfoLength = 0x%X\n",
12055 - connInfo.uReturnInfoLength);
12056 - DbgPrint("connInfo.uReturnInfoLevel = 0x%X\n",
12057 - connInfo.uReturnInfoLevel);
12058 - DbgPrint("connInfo.uScanFlags = 0x%X\n", connInfo.uScanFlags);
12060 - pDConnInfo->uScanIndex = connInfo.uScanIndex;
12061 - pDConnInfo->uConnectionReference =
12062 - connInfo.uConnectionReference;
12063 - pDConnInfo->uScanInfoLevel = connInfo.uScanInfoLevel;
12064 - pDConnInfo->uScanInfoLen = connInfo.uScanInfoLen;
12065 - pDConnInfo->uReturnInfoLength = connInfo.uReturnInfoLength;
12066 - pDConnInfo->uReturnInfoLevel = connInfo.uReturnInfoLevel;
12067 - pDConnInfo->uScanFlags = connInfo.uScanFlags;
12069 - if (pDConnInfo->uScanInfoLen) {
12070 - localData = (unsigned char *) pDConnInfo;
12071 - pDConnInfo->uScanConnInfoOffset = sizeof(*pDConnInfo);
12072 - localData += pDConnInfo->uScanConnInfoOffset;
12074 - copy_from_user(localData, connInfo.pScanConnInfo,
12075 - connInfo.uScanInfoLen);
12077 - pDConnInfo->uScanConnInfoOffset = 0;
12079 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12080 + cmd->Command.SequenceNumber = 0;
12081 + cmd->Command.SessionId = Session;
12082 + cmd->NwcCommand = NWC_SCAN_CONN_INFO;
12084 + pDConnInfo = (struct nwd_scan_conn_info *) cmd->data;
12086 + DbgPrint("NwScanConnInfo: Input Data\n");
12087 + DbgPrint("connInfo.uScanIndex = 0x%X\n", connInfo.uScanIndex);
12088 + DbgPrint("connInfo.uConnectionReference = 0x%X\n",
12089 + connInfo.uConnectionReference);
12090 + DbgPrint("connInfo.uScanInfoLevel = 0x%X\n",
12091 + connInfo.uScanInfoLevel);
12092 + DbgPrint("connInfo.uScanInfoLen = 0x%X\n",
12093 + connInfo.uScanInfoLen);
12094 + DbgPrint("connInfo.uReturnInfoLength = 0x%X\n",
12095 + connInfo.uReturnInfoLength);
12096 + DbgPrint("connInfo.uReturnInfoLevel = 0x%X\n",
12097 + connInfo.uReturnInfoLevel);
12098 + DbgPrint("connInfo.uScanFlags = 0x%X\n", connInfo.uScanFlags);
12100 + pDConnInfo->uScanIndex = connInfo.uScanIndex;
12101 + pDConnInfo->uConnectionReference =
12102 + connInfo.uConnectionReference;
12103 + pDConnInfo->uScanInfoLevel = connInfo.uScanInfoLevel;
12104 + pDConnInfo->uScanInfoLen = connInfo.uScanInfoLen;
12105 + pDConnInfo->uReturnInfoLength = connInfo.uReturnInfoLength;
12106 + pDConnInfo->uReturnInfoLevel = connInfo.uReturnInfoLevel;
12107 + pDConnInfo->uScanFlags = connInfo.uScanFlags;
12109 + if (pDConnInfo->uScanInfoLen) {
12110 + localData = (unsigned char *) pDConnInfo;
12111 + pDConnInfo->uScanConnInfoOffset = sizeof(*pDConnInfo);
12112 + localData += pDConnInfo->uScanConnInfoOffset;
12114 + copy_from_user(localData, connInfo.pScanConnInfo,
12115 + connInfo.uScanInfoLen);
12117 + pDConnInfo->uScanConnInfoOffset = 0;
12120 + cmd->dataLen = sizeof(*pDConnInfo);
12122 - cmd->dataLen = sizeof(*pDConnInfo);
12124 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12125 + (void **)&reply, &replylen,
12128 + DbgPrint("NwScanConnInfo: Reply recieved\n");
12129 + DbgPrint(" NextIndex = %x\n", connInfo.uScanIndex);
12130 + DbgPrint(" ErrorCode = %x\n", reply->Reply.ErrorCode);
12131 + DbgPrint(" data = %x\n", reply->data);
12134 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12135 - (void **)&reply, &replylen,
12138 - DbgPrint("NwScanConnInfo: Reply recieved\n");
12139 - DbgPrint(" NextIndex = %x\n", connInfo.uScanIndex);
12140 - DbgPrint(" ErrorCode = %x\n", reply->Reply.ErrorCode);
12141 - DbgPrint(" data = %x\n", reply->data);
12143 - pDConnInfo = (PNwdCScanConnInfo) reply->data;
12144 - retCode = (unsigned long) reply->Reply.ErrorCode;
12146 - GetUserData(&connInfo, cmd, reply);
12147 - rInfo = (NwcScanConnInfo *) pdata->repData;
12149 - copy_to_user(pdata->repData,
12150 - &pDConnInfo->uScanIndex,
12151 - sizeof(pDConnInfo->
12152 + pDConnInfo = (struct nwd_scan_conn_info *) reply->data;
12153 + retCode = (unsigned long) reply->Reply.ErrorCode;
12155 + GetUserData(&connInfo, cmd, reply);
12156 + rInfo = (struct nwc_scan_conn_info *) pdata->repData;
12158 + copy_to_user(pdata->repData,
12159 + &pDConnInfo->uScanIndex,
12160 + sizeof(pDConnInfo->
12163 - copy_to_user(&rInfo->uConnectionReference,
12165 - uConnectionReference,
12166 - sizeof(pDConnInfo->
12168 + copy_to_user(&rInfo->uConnectionReference,
12170 + uConnectionReference,
12171 + sizeof(pDConnInfo->
12172 uConnectionReference));
12179 - rInfo = (NwcScanConnInfo *) pdata->reqData;
12181 - copy_to_user(&rInfo->uConnectionReference,
12185 + rInfo = (struct nwc_scan_conn_info *) pdata->reqData;
12187 + copy_to_user(&rInfo->uConnectionReference,
12190 uConnectionReference));
12208 -/*++======================================================================*/
12209 -static void GetUserData(NwcScanConnInfo * connInfo, PXPLAT_CALL_REQUEST cmd, PXPLAT_CALL_REPLY reply)
12211 - * Abstract: Copies the user data out of the scan conn info call.
12213 - *========================================================================*/
12214 + * Copies the user data out of the scan conn info call.
12216 +static void GetUserData(struct nwc_scan_conn_info * connInfo, struct novfs_xplat_call_request *cmd, struct novfs_xplat_call_reply *reply)
12218 unsigned long uLevel;
12219 - PNwdCScanConnInfo pDConnInfo;
12220 + struct nwd_scan_conn_info *pDConnInfo;
12222 unsigned char *srcData = NULL;
12223 unsigned long dataLen = 0, cpylen;
12225 - pDConnInfo = (PNwdCScanConnInfo) reply->data;
12226 + pDConnInfo = (struct nwd_scan_conn_info *) reply->data;
12227 uLevel = pDConnInfo->uReturnInfoLevel;
12229 ("[GetUserData] uLevel = %d, reply = 0x%p, reply->data = 0x%X\n",
12230 @@ -1224,7 +1077,7 @@ static void GetUserData(NwcScanConnInfo
12231 case NWC_CONN_INFO_TRAN_ADDR:
12233 unsigned char *dstData = connInfo->pReturnConnInfo;
12234 - NwcTranAddr tranAddr;
12235 + struct nwc_tran_addr tranAddr;
12237 srcData = (unsigned char *) reply->data;
12238 dataLen = reply->dataLen;
12239 @@ -1238,20 +1091,20 @@ static void GetUserData(NwcScanConnInfo
12243 - ((PNwdCScanConnInfo) srcData)->
12244 + ((struct nwd_scan_conn_info *) srcData)->
12245 uReturnConnInfoOffset;
12247 tranAddr.uTransportType =
12248 - ((PNwdTranAddr) srcData)->uTransportType;
12249 + ((struct nwd_tran_addr *) srcData)->uTransportType;
12250 tranAddr.uAddressLength =
12251 - ((PNwdTranAddr) srcData)->uAddressLength;
12252 + ((struct tagNwdTranAddrEx *) srcData)->uAddressLength;
12255 copy_to_user(dstData, &tranAddr, sizeof(tranAddr));
12257 copy_to_user(tranAddr.puAddress,
12258 - ((PNwdTranAddr) srcData)->Buffer,
12259 - ((PNwdTranAddr) srcData)->
12260 + ((struct tagNwdTranAddrEx *) srcData)->Buffer,
12261 + ((struct tagNwdTranAddrEx *) srcData)->
12265 @@ -1276,20 +1129,18 @@ static void GetUserData(NwcScanConnInfo
12269 -/*++======================================================================*/
12270 -static void GetConnData(NwcGetConnInfo * connInfo, PXPLAT_CALL_REQUEST cmd, PXPLAT_CALL_REPLY reply)
12272 - * Abstract: Copies the user data out of the scan conn info call.
12274 - *========================================================================*/
12275 + * Copies the user data out of the scan conn info call.
12277 +static void GetConnData(struct nwc_get_conn_info * connInfo, struct novfs_xplat_call_request *cmd, struct novfs_xplat_call_reply *reply)
12279 unsigned long uLevel;
12280 - PNwdCGetConnInfo pDConnInfo;
12281 + struct nwd_conn_info * pDConnInfo;
12283 unsigned char *srcData = NULL;
12284 unsigned long dataLen = 0, cpylen;
12286 - pDConnInfo = (PNwdCGetConnInfo) cmd->data;
12287 + pDConnInfo = (struct nwd_conn_info *) cmd->data;
12288 uLevel = pDConnInfo->uInfoLevel;
12291 @@ -1305,7 +1156,7 @@ static void GetConnData(NwcGetConnInfo *
12292 case NWC_CONN_INFO_TRAN_ADDR:
12294 unsigned char *dstData = connInfo->pConnInfo;
12295 - NwcTranAddr tranAddr;
12296 + struct nwc_tran_addr tranAddr;
12298 srcData = (unsigned char *) reply->data;
12300 @@ -1313,16 +1164,16 @@ static void GetConnData(NwcGetConnInfo *
12301 copy_from_user(&tranAddr, dstData,
12303 tranAddr.uTransportType =
12304 - ((PNwdTranAddr) srcData)->uTransportType;
12305 + ((struct tagNwdTranAddrEx *) srcData)->uTransportType;
12306 tranAddr.uAddressLength =
12307 - ((PNwdTranAddr) srcData)->uAddressLength;
12308 + ((struct tagNwdTranAddrEx *) srcData)->uAddressLength;
12311 copy_to_user(dstData, &tranAddr, sizeof(tranAddr));
12313 copy_to_user(tranAddr.puAddress,
12314 - ((PNwdTranAddr) srcData)->Buffer,
12315 - ((PNwdTranAddr) srcData)->
12316 + ((struct tagNwdTranAddrEx *) srcData)->Buffer,
12317 + ((struct tagNwdTranAddrEx *) srcData)->
12321 @@ -1376,343 +1227,282 @@ static void GetConnData(NwcGetConnInfo *
12325 -/*++======================================================================*/
12326 -int NwGetDaemonVersion(PXPLAT pdata, session_t Session)
12338 - *========================================================================*/
12340 - PXPLAT_CALL_REQUEST cmd;
12341 - PXPLAT_CALL_REPLY reply;
12342 - PNwdCGetRequesterVersion pDVersion;
12343 +int novfs_get_daemon_ver(struct novfs_xplat *pdata, struct novfs_schandle Session)
12345 + struct novfs_xplat_call_request *cmd;
12346 + struct novfs_xplat_call_reply *reply;
12347 + struct nwd_get_reqversion *pDVersion;
12348 int retCode = -ENOMEM;
12349 unsigned long cmdlen, datalen, replylen, cpylen;
12351 datalen = sizeof(*pDVersion);
12352 cmdlen = datalen + sizeof(*cmd);
12353 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12356 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12357 - cmd->Command.SequenceNumber = 0;
12358 - cmd->Command.SessionId = Session;
12359 - cmd->NwcCommand = NWC_GET_REQUESTER_VERSION;
12360 - cmdlen = sizeof(*cmd);
12362 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12363 - (void **)&reply, &replylen,
12366 - retCode = reply->Reply.ErrorCode;
12367 - pDVersion = (PNwdCGetRequesterVersion) reply->data;
12369 - copy_to_user(pDVersion, pdata->reqData,
12370 - sizeof(*pDVersion));
12375 - return (retCode);
12378 + cmd = kmalloc(cmdlen, GFP_KERNEL);
12382 -/*++======================================================================*/
12383 -int NwcGetPreferredDSTree(PXPLAT pdata, session_t Session)
12395 - *========================================================================*/
12397 - PXPLAT_CALL_REQUEST cmd;
12398 - PXPLAT_CALL_REPLY reply;
12399 - PNwdCGetPreferredDsTree pDGetTree;
12400 - NwcGetPreferredDsTree xplatCall, *p;
12401 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12402 + cmd->Command.SequenceNumber = 0;
12403 + cmd->Command.SessionId = Session;
12404 + cmd->NwcCommand = NWC_GET_REQUESTER_VERSION;
12405 + cmdlen = sizeof(*cmd);
12407 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12408 + (void **)&reply, &replylen,
12411 + retCode = reply->Reply.ErrorCode;
12412 + pDVersion = (struct nwd_get_reqversion *) reply->data;
12414 + copy_to_user(pDVersion, pdata->reqData,
12415 + sizeof(*pDVersion));
12419 + return (retCode);
12423 +int novfs_get_preferred_DS_tree(struct novfs_xplat *pdata, struct novfs_schandle Session)
12425 + struct novfs_xplat_call_request *cmd;
12426 + struct novfs_xplat_call_reply *reply;
12427 + struct nwd_get_pref_ds_tree *pDGetTree;
12428 + struct nwc_get_pref_ds_tree xplatCall, *p;
12429 int retCode = -ENOMEM;
12430 unsigned long cmdlen, datalen, replylen, cpylen;
12431 unsigned char *dPtr;
12434 copy_from_user(&xplatCall, pdata->reqData,
12435 - sizeof(NwcGetPreferredDsTree));
12436 + sizeof(struct nwc_get_pref_ds_tree));
12437 datalen = sizeof(*pDGetTree) + xplatCall.uTreeLength;
12438 cmdlen = datalen + sizeof(*cmd);
12439 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12440 + cmd = kmalloc(cmdlen, GFP_KERNEL);
12443 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12444 - cmd->Command.SequenceNumber = 0;
12445 - cmd->Command.SessionId = Session;
12446 - cmd->NwcCommand = NWC_GET_PREFERRED_DS_TREE;
12447 - cmdlen = sizeof(*cmd);
12450 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12451 - (void **)&reply, &replylen,
12454 - retCode = reply->Reply.ErrorCode;
12457 - (PNwdCGetPreferredDsTree) reply->data;
12459 - reply->data + pDGetTree->DsTreeNameOffset;
12460 - p = (NwcGetPreferredDsTree *) pdata->reqData;
12463 - ("NwcGetPreferredDSTree: Reply recieved\n");
12464 - DbgPrint(" TreeLen = %x\n",
12465 - pDGetTree->uTreeLength);
12466 - DbgPrint(" TreeName = %s\n", dPtr);
12469 - copy_to_user(p, &pDGetTree->uTreeLength, 4);
12471 - copy_to_user(xplatCall.pDsTreeName, dPtr,
12472 - pDGetTree->uTreeLength);
12478 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12479 + cmd->Command.SequenceNumber = 0;
12480 + cmd->Command.SessionId = Session;
12481 + cmd->NwcCommand = NWC_GET_PREFERRED_DS_TREE;
12482 + cmdlen = sizeof(*cmd);
12485 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12486 + (void **)&reply, &replylen,
12489 + retCode = reply->Reply.ErrorCode;
12492 + (struct nwd_get_pref_ds_tree *) reply->data;
12494 + reply->data + pDGetTree->DsTreeNameOffset;
12495 + p = (struct nwc_get_pref_ds_tree *) pdata->reqData;
12498 + ("NwcGetPreferredDSTree: Reply recieved\n");
12499 + DbgPrint(" TreeLen = %x\n",
12500 + pDGetTree->uTreeLength);
12501 + DbgPrint(" TreeName = %s\n", dPtr);
12504 + copy_to_user(p, &pDGetTree->uTreeLength, 4);
12506 + copy_to_user(xplatCall.pDsTreeName, dPtr,
12507 + pDGetTree->uTreeLength);
12517 -/*++======================================================================*/
12518 -int NwcSetPreferredDSTree(PXPLAT pdata, session_t Session)
12530 - *========================================================================*/
12532 - PXPLAT_CALL_REQUEST cmd;
12533 - PXPLAT_CALL_REPLY reply;
12534 - PNwdCSetPreferredDsTree pDSetTree;
12535 - NwcSetPreferredDsTree xplatCall;
12536 +int novfs_set_preferred_DS_tree(struct novfs_xplat *pdata, struct novfs_schandle Session)
12538 + struct novfs_xplat_call_request *cmd;
12539 + struct novfs_xplat_call_reply *reply;
12540 + struct nwd_set_pref_ds_tree *pDSetTree;
12541 + struct nwc_set_pref_ds_tree xplatCall;
12542 int retCode = -ENOMEM;
12543 unsigned long cmdlen, datalen, replylen, cpylen;
12544 unsigned char *dPtr;
12547 copy_from_user(&xplatCall, pdata->reqData,
12548 - sizeof(NwcSetPreferredDsTree));
12549 + sizeof(struct nwc_set_pref_ds_tree));
12550 datalen = sizeof(*pDSetTree) + xplatCall.uTreeLength;
12551 cmdlen = datalen + sizeof(*cmd);
12552 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12553 + cmd = kmalloc(cmdlen, GFP_KERNEL);
12556 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12557 - cmd->Command.SequenceNumber = 0;
12558 - cmd->Command.SessionId = Session;
12559 - cmd->NwcCommand = NWC_SET_PREFERRED_DS_TREE;
12561 - pDSetTree = (PNwdCSetPreferredDsTree) cmd->data;
12562 - pDSetTree->DsTreeNameOffset = sizeof(*pDSetTree);
12563 - pDSetTree->uTreeLength = xplatCall.uTreeLength;
12567 - dPtr = cmd->data + sizeof(*pDSetTree);
12569 - copy_from_user(dPtr, xplatCall.pDsTreeName,
12570 - xplatCall.uTreeLength);
12571 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12572 + cmd->Command.SequenceNumber = 0;
12573 + cmd->Command.SessionId = Session;
12574 + cmd->NwcCommand = NWC_SET_PREFERRED_DS_TREE;
12577 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12578 - (void **)&reply, &replylen,
12581 - retCode = reply->Reply.ErrorCode;
12585 + pDSetTree = (struct nwd_set_pref_ds_tree *) cmd->data;
12586 + pDSetTree->DsTreeNameOffset = sizeof(*pDSetTree);
12587 + pDSetTree->uTreeLength = xplatCall.uTreeLength;
12589 + dPtr = cmd->data + sizeof(*pDSetTree);
12591 + copy_from_user(dPtr, xplatCall.pDsTreeName,
12592 + xplatCall.uTreeLength);
12595 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12596 + (void **)&reply, &replylen,
12599 + retCode = reply->Reply.ErrorCode;
12607 -/*++======================================================================*/
12608 -int NwcSetDefaultNameCtx(PXPLAT pdata, session_t Session)
12620 - *========================================================================*/
12622 - PXPLAT_CALL_REQUEST cmd;
12623 - PXPLAT_CALL_REPLY reply;
12624 - NwcSetDefaultNameContext xplatCall;
12625 - PNwdCSetDefaultNameContext pDSet;
12626 +int novfs_set_default_ctx(struct novfs_xplat *pdata,
12627 + struct novfs_schandle Session)
12629 + struct novfs_xplat_call_request *cmd;
12630 + struct novfs_xplat_call_reply *reply;
12631 + struct nwc_set_def_name_ctx xplatCall;
12632 + struct nwd_set_def_name_ctx * pDSet;
12633 int retCode = -ENOMEM;
12634 unsigned long cmdlen, datalen, replylen, cpylen;
12635 unsigned char *dPtr;
12638 copy_from_user(&xplatCall, pdata->reqData,
12639 - sizeof(NwcSetDefaultNameContext));
12640 + sizeof(struct nwc_set_def_name_ctx));
12642 sizeof(*pDSet) + xplatCall.uTreeLength + xplatCall.uNameLength;
12643 cmdlen = datalen + sizeof(*cmd);
12644 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12645 + cmd = kmalloc(cmdlen, GFP_KERNEL);
12648 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12649 - cmd->Command.SequenceNumber = 0;
12650 - cmd->Command.SessionId = Session;
12651 - cmd->NwcCommand = NWC_SET_DEFAULT_NAME_CONTEXT;
12653 - sizeof(NwdCSetDefaultNameContext) + xplatCall.uTreeLength +
12654 - xplatCall.uNameLength;
12656 - pDSet = (PNwdCSetDefaultNameContext) cmd->data;
12657 - dPtr = cmd->data;
12659 - pDSet->TreeOffset = sizeof(NwdCSetDefaultNameContext);
12660 - pDSet->uTreeLength = xplatCall.uTreeLength;
12661 - pDSet->NameContextOffset =
12662 - pDSet->TreeOffset + xplatCall.uTreeLength;
12663 - pDSet->uNameLength = xplatCall.uNameLength;
12666 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12667 + cmd->Command.SequenceNumber = 0;
12668 + cmd->Command.SessionId = Session;
12669 + cmd->NwcCommand = NWC_SET_DEFAULT_NAME_CONTEXT;
12671 + sizeof(struct nwd_set_def_name_ctx) +
12672 + xplatCall.uTreeLength + xplatCall.uNameLength;
12674 + pDSet = (struct nwd_set_def_name_ctx *) cmd->data;
12675 + dPtr = cmd->data;
12677 + pDSet->TreeOffset = sizeof(struct nwd_set_def_name_ctx);
12678 + pDSet->uTreeLength = xplatCall.uTreeLength;
12679 + pDSet->NameContextOffset =
12680 + pDSet->TreeOffset + xplatCall.uTreeLength;
12681 + pDSet->uNameLength = xplatCall.uNameLength;
12683 -//sgled cpylen = copy_from_user(dPtr+pDSet->TreeOffset, xplatCall.pTreeName, xplatCall.uTreeLength);
12684 - cpylen = copy_from_user(dPtr + pDSet->TreeOffset, xplatCall.pDsTreeName, xplatCall.uTreeLength); //sgled
12686 - copy_from_user(dPtr + pDSet->NameContextOffset,
12687 - xplatCall.pNameContext,
12688 - xplatCall.uNameLength);
12691 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12692 - (void **)&reply, &replylen,
12695 - retCode = reply->Reply.ErrorCode;
12699 + //sgled cpylen = copy_from_user(dPtr+pDSet->TreeOffset, xplatCall.pTreeName, xplatCall.uTreeLength);
12700 + cpylen = copy_from_user(dPtr + pDSet->TreeOffset, xplatCall.pDsTreeName, xplatCall.uTreeLength); //sgled
12702 + copy_from_user(dPtr + pDSet->NameContextOffset,
12703 + xplatCall.pNameContext,
12704 + xplatCall.uNameLength);
12707 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12708 + (void **)&reply, &replylen,
12711 + retCode = reply->Reply.ErrorCode;
12719 -/*++======================================================================*/
12720 -int NwcGetDefaultNameCtx(PXPLAT pdata, session_t Session)
12732 - *========================================================================*/
12734 - PXPLAT_CALL_REQUEST cmd;
12735 - PXPLAT_CALL_REPLY reply;
12736 - NwcGetDefaultNameContext xplatCall;
12737 - PNwdCGetDefaultNameContext pGet;
12738 +int novfs_get_default_ctx(struct novfs_xplat *pdata,
12739 + struct novfs_schandle Session)
12741 + struct novfs_xplat_call_request *cmd;
12742 + struct novfs_xplat_call_reply *reply;
12743 + struct nwc_get_def_name_ctx xplatCall;
12744 + struct nwd_get_def_name_ctx * pGet;
12746 int retCode = -ENOMEM;
12747 unsigned long cmdlen, replylen, cpylen;
12750 copy_from_user(&xplatCall, pdata->reqData,
12751 - sizeof(NwcGetDefaultNameContext));
12752 + sizeof(struct nwc_get_def_name_ctx));
12754 - sizeof(*cmd) + sizeof(NwdCGetDefaultNameContext) +
12755 + sizeof(*cmd) + sizeof(struct nwd_get_def_name_ctx ) +
12756 xplatCall.uTreeLength;
12757 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12758 + cmd = kmalloc(cmdlen, GFP_KERNEL);
12761 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12762 - cmd->Command.SequenceNumber = 0;
12763 - cmd->Command.SessionId = Session;
12764 - cmd->NwcCommand = NWC_GET_DEFAULT_NAME_CONTEXT;
12766 - sizeof(NwdCGetDefaultNameContext) + xplatCall.uTreeLength;
12768 - pGet = (PNwdCGetDefaultNameContext) cmd->data;
12769 - dPtr = cmd->data;
12771 - pGet->TreeOffset = sizeof(NwdCGetDefaultNameContext);
12772 - pGet->uTreeLength = xplatCall.uTreeLength;
12774 -//sgled cpylen = copy_from_user( dPtr + pGet->TreeOffset, xplatCall.pTreeName, xplatCall.uTreeLength);
12775 - cpylen = copy_from_user(dPtr + pGet->TreeOffset, xplatCall.pDsTreeName, xplatCall.uTreeLength); //sgled
12776 - dPtr[pGet->TreeOffset + pGet->uTreeLength] = 0;
12779 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12780 - (void **)&reply, &replylen,
12783 - retCode = reply->Reply.ErrorCode;
12785 - pGet = (PNwdCGetDefaultNameContext) reply->data;
12788 - ("NwcGetDefaultNameCtx: retCode=0x%x uNameLength1=%d uNameLength2=%d\n",
12789 - retCode, pGet->uNameLength,
12790 - xplatCall.uNameLength);
12791 - if (xplatCall.uNameLength < pGet->uNameLength) {
12792 - pGet->uNameLength =
12793 - xplatCall.uNameLength;
12794 - retCode = NWE_BUFFER_OVERFLOW;
12796 - dPtr = (char *)pGet + pGet->NameContextOffset;
12798 - copy_to_user(xplatCall.pNameContext, dPtr,
12799 - pGet->uNameLength);
12803 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12804 + cmd->Command.SequenceNumber = 0;
12805 + cmd->Command.SessionId = Session;
12806 + cmd->NwcCommand = NWC_GET_DEFAULT_NAME_CONTEXT;
12808 + sizeof(struct nwd_get_def_name_ctx) + xplatCall.uTreeLength;
12810 + pGet = (struct nwd_get_def_name_ctx *) cmd->data;
12811 + dPtr = cmd->data;
12813 + pGet->TreeOffset = sizeof(struct nwd_get_def_name_ctx );
12814 + pGet->uTreeLength = xplatCall.uTreeLength;
12816 + //sgled cpylen = copy_from_user( dPtr + pGet->TreeOffset, xplatCall.pTreeName, xplatCall.uTreeLength);
12817 + cpylen = copy_from_user(dPtr + pGet->TreeOffset, xplatCall.pDsTreeName, xplatCall.uTreeLength); //sgled
12818 + dPtr[pGet->TreeOffset + pGet->uTreeLength] = 0;
12821 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12822 + (void **)&reply, &replylen,
12825 + retCode = reply->Reply.ErrorCode;
12827 + pGet = (struct nwd_get_def_name_ctx *) reply->data;
12831 + ("NwcGetDefaultNameCtx: retCode=0x%x uNameLength1=%d uNameLength2=%d\n",
12832 + retCode, pGet->uNameLength,
12833 + xplatCall.uNameLength);
12834 + if (xplatCall.uNameLength < pGet->uNameLength) {
12835 + pGet->uNameLength =
12836 + xplatCall.uNameLength;
12837 + retCode = NWE_BUFFER_OVERFLOW;
12839 + dPtr = (char *)pGet + pGet->NameContextOffset;
12841 + copy_to_user(xplatCall.pNameContext, dPtr,
12842 + pGet->uNameLength);
12853 -int NwQueryFeature(PXPLAT pdata, session_t Session)
12854 +int novfs_query_feature(struct novfs_xplat *pdata, struct novfs_schandle Session)
12856 - NwcQueryFeature xpCall;
12857 + struct nwc_query_feature xpCall;
12859 unsigned long cpylen;
12862 - copy_from_user(&xpCall, pdata->reqData, sizeof(NwcQueryFeature));
12863 + copy_from_user(&xpCall, pdata->reqData, sizeof(struct nwc_query_feature));
12864 switch (xpCall.Feature) {
12866 case NWC_FEAT_NDS_MTREE:
12867 @@ -1725,372 +1515,306 @@ int NwQueryFeature(PXPLAT pdata, session
12871 -/*++======================================================================*/
12872 -int NwcGetTreeMonitoredConn(PXPLAT pdata, session_t Session)
12884 - *========================================================================*/
12886 - PXPLAT_CALL_REQUEST cmd;
12887 - PXPLAT_CALL_REPLY reply;
12888 - NwcGetTreeMonitoredConnRef xplatCall, *p;
12889 - PNwdCGetTreeMonitoredConnRef pDConnRef;
12890 +int novfs_get_tree_monitored_conn(struct novfs_xplat *pdata,
12891 + struct novfs_schandle Session)
12893 + struct novfs_xplat_call_request *cmd;
12894 + struct novfs_xplat_call_reply *reply;
12895 + struct nwc_get_tree_monitored_conn_ref xplatCall, *p;
12896 + struct nwd_get_tree_monitored_conn_ref *pDConnRef;
12898 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
12901 copy_from_user(&xplatCall, pdata->reqData,
12902 - sizeof(NwcGetTreeMonitoredConnRef));
12903 + sizeof(struct nwc_get_tree_monitored_conn_ref));
12904 datalen = sizeof(*pDConnRef) + xplatCall.pTreeName->DataLen;
12905 cmdlen = datalen + sizeof(*cmd);
12906 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12907 + cmd = kmalloc(cmdlen, GFP_KERNEL);
12910 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12911 - cmd->Command.SequenceNumber = 0;
12912 - cmd->Command.SessionId = Session;
12913 - cmd->NwcCommand = NWC_GET_TREE_MONITORED_CONN_REF;
12915 - pDConnRef = (PNwdCGetTreeMonitoredConnRef) cmd->data;
12916 - pDConnRef->TreeName.boffset = sizeof(*pDConnRef);
12917 - pDConnRef->TreeName.len = xplatCall.pTreeName->DataLen;
12918 - pDConnRef->TreeName.type = xplatCall.pTreeName->DataType;
12922 - dPtr = cmd->data + sizeof(*pDConnRef);
12924 - copy_from_user(dPtr, xplatCall.pTreeName->pBuffer,
12925 - pDConnRef->TreeName.len);
12927 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12928 - (void **)&reply, &replylen,
12931 - pDConnRef = (PNwdCGetTreeMonitoredConnRef) reply->data;
12932 - dPtr = reply->data + pDConnRef->TreeName.boffset;
12933 - p = (NwcGetTreeMonitoredConnRef *) pdata->reqData;
12935 - copy_to_user(&p->uConnReference,
12936 - &pDConnRef->uConnReference, 4);
12937 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
12938 + cmd->Command.SequenceNumber = 0;
12939 + cmd->Command.SessionId = Session;
12940 + cmd->NwcCommand = NWC_GET_TREE_MONITORED_CONN_REF;
12942 - status = reply->Reply.ErrorCode;
12946 + pDConnRef = (struct nwd_get_tree_monitored_conn_ref *) cmd->data;
12947 + pDConnRef->TreeName.boffset = sizeof(*pDConnRef);
12948 + pDConnRef->TreeName.len = xplatCall.pTreeName->DataLen;
12949 + pDConnRef->TreeName.type = xplatCall.pTreeName->DataType;
12952 + dPtr = cmd->data + sizeof(*pDConnRef);
12954 + copy_from_user(dPtr, xplatCall.pTreeName->pBuffer,
12955 + pDConnRef->TreeName.len);
12957 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12958 + (void **)&reply, &replylen,
12961 + pDConnRef = (struct nwd_get_tree_monitored_conn_ref *) reply->data;
12962 + dPtr = reply->data + pDConnRef->TreeName.boffset;
12963 + p = (struct nwc_get_tree_monitored_conn_ref *) pdata->reqData;
12965 + copy_to_user(&p->uConnReference,
12966 + &pDConnRef->uConnReference, 4);
12968 + status = reply->Reply.ErrorCode;
12975 -/*++======================================================================*/
12976 -int NwcEnumIdentities(PXPLAT pdata, session_t Session)
12988 - *========================================================================*/
12990 - PXPLAT_CALL_REQUEST cmd;
12991 - PXPLAT_CALL_REPLY reply;
12992 - NwcEnumerateIdentities xplatCall, *eId;
12993 - PNwdCEnumerateIdentities pEnum;
12994 - NwcString xferStr;
12995 +int novfs_enum_ids(struct novfs_xplat *pdata, struct novfs_schandle Session)
12997 + struct novfs_xplat_call_request *cmd;
12998 + struct novfs_xplat_call_reply *reply;
12999 + struct nwc_enum_ids xplatCall, *eId;
13000 + struct nwd_enum_ids *pEnum;
13001 + struct nwc_string xferStr;
13003 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
13006 copy_from_user(&xplatCall, pdata->reqData,
13007 - sizeof(NwcEnumerateIdentities));
13008 + sizeof(struct nwc_enum_ids));
13009 datalen = sizeof(*pEnum);
13010 cmdlen = datalen + sizeof(*cmd);
13011 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13012 + cmd = kmalloc(cmdlen, GFP_KERNEL);
13015 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13016 - cmd->Command.SequenceNumber = 0;
13017 - cmd->Command.SessionId = Session;
13018 - cmd->NwcCommand = NWC_ENUMERATE_IDENTITIES;
13020 - DbgPrint("NwcEnumIdentities: Send Request\n");
13021 - DbgPrint(" iterator = %x\n", xplatCall.Iterator);
13022 - DbgPrint(" cmdlen = %d\n", cmdlen);
13024 - pEnum = (PNwdCEnumerateIdentities) cmd->data;
13025 - pEnum->Iterator = xplatCall.Iterator;
13027 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13028 - (void **)&reply, &replylen,
13031 - status = reply->Reply.ErrorCode;
13033 - eId = pdata->repData;
13034 - pEnum = (PNwdCEnumerateIdentities) reply->data;
13036 - copy_to_user(&eId->Iterator, &pEnum->Iterator,
13037 - sizeof(pEnum->Iterator));
13038 - DbgPrint("[XPLAT NWCAPI] Found AuthId 0x%X\n",
13039 - pEnum->AuthenticationId);
13041 - copy_to_user(&eId->AuthenticationId,
13042 - &pEnum->AuthenticationId,
13043 - sizeof(pEnum->AuthenticationId));
13045 - copy_to_user(&eId->AuthType, &pEnum->AuthType,
13046 - sizeof(pEnum->AuthType));
13048 - copy_to_user(&eId->IdentityFlags,
13049 - &pEnum->IdentityFlags,
13050 - sizeof(pEnum->IdentityFlags));
13052 - copy_to_user(&eId->NameType, &pEnum->NameType,
13053 - sizeof(pEnum->NameType));
13055 - copy_to_user(&eId->ObjectType, &pEnum->ObjectType,
13056 - sizeof(pEnum->ObjectType));
13060 - copy_from_user(&xferStr, eId->pDomainName,
13061 - sizeof(NwcString));
13063 - (char *)((char *)reply->data +
13064 - pEnum->domainNameOffset);
13065 - DbgPrint("[XPLAT NWCAPI] Found Domain %s\n",
13068 - copy_to_user(xferStr.pBuffer, str,
13069 - pEnum->domainNameLen);
13070 - xferStr.DataType = NWC_STRING_TYPE_ASCII;
13071 - xferStr.DataLen = pEnum->domainNameLen - 1;
13073 - copy_to_user(eId->pDomainName, &xferStr,
13074 - sizeof(NwcString));
13077 - copy_from_user(&xferStr, eId->pObjectName,
13078 - sizeof(NwcString));
13080 - (char *)((char *)reply->data +
13081 - pEnum->objectNameOffset);
13082 - DbgPrint("[XPLAT NWCAPI] Found User %s\n", str);
13084 - copy_to_user(xferStr.pBuffer, str,
13085 - pEnum->objectNameLen);
13086 - xferStr.DataType = NWC_STRING_TYPE_ASCII;
13087 - xferStr.DataLen = pEnum->objectNameLen - 1;
13089 - copy_to_user(eId->pObjectName, &xferStr,
13090 - sizeof(NwcString));
13095 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13096 + cmd->Command.SequenceNumber = 0;
13097 + cmd->Command.SessionId = Session;
13098 + cmd->NwcCommand = NWC_ENUMERATE_IDENTITIES;
13100 + DbgPrint("NwcEnumIdentities: Send Request\n");
13101 + DbgPrint(" iterator = %x\n", xplatCall.Iterator);
13102 + DbgPrint(" cmdlen = %d\n", cmdlen);
13105 + pEnum = (struct nwd_enum_ids *) cmd->data;
13106 + pEnum->Iterator = xplatCall.Iterator;
13108 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13109 + (void **)&reply, &replylen,
13112 + status = reply->Reply.ErrorCode;
13114 + eId = pdata->repData;
13115 + pEnum = (struct nwd_enum_ids *) reply->data;
13117 + copy_to_user(&eId->Iterator, &pEnum->Iterator,
13118 + sizeof(pEnum->Iterator));
13119 + DbgPrint("[XPLAT NWCAPI] Found AuthId 0x%X\n",
13120 + pEnum->AuthenticationId);
13122 + copy_to_user(&eId->AuthenticationId,
13123 + &pEnum->AuthenticationId,
13124 + sizeof(pEnum->AuthenticationId));
13126 + copy_to_user(&eId->AuthType, &pEnum->AuthType,
13127 + sizeof(pEnum->AuthType));
13129 + copy_to_user(&eId->IdentityFlags,
13130 + &pEnum->IdentityFlags,
13131 + sizeof(pEnum->IdentityFlags));
13133 + copy_to_user(&eId->NameType, &pEnum->NameType,
13134 + sizeof(pEnum->NameType));
13136 + copy_to_user(&eId->ObjectType, &pEnum->ObjectType,
13137 + sizeof(pEnum->ObjectType));
13141 + copy_from_user(&xferStr, eId->pDomainName,
13142 + sizeof(struct nwc_string));
13144 + (char *)((char *)reply->data +
13145 + pEnum->domainNameOffset);
13146 + DbgPrint("[XPLAT NWCAPI] Found Domain %s\n",
13149 + copy_to_user(xferStr.pBuffer, str,
13150 + pEnum->domainNameLen);
13151 + xferStr.DataType = NWC_STRING_TYPE_ASCII;
13152 + xferStr.DataLen = pEnum->domainNameLen - 1;
13154 + copy_to_user(eId->pDomainName, &xferStr,
13155 + sizeof(struct nwc_string));
13158 + copy_from_user(&xferStr, eId->pObjectName,
13159 + sizeof(struct nwc_string));
13161 + (char *)((char *)reply->data +
13162 + pEnum->objectNameOffset);
13163 + DbgPrint("[XPLAT NWCAPI] Found User %s\n", str);
13165 + copy_to_user(xferStr.pBuffer, str,
13166 + pEnum->objectNameLen);
13167 + xferStr.DataType = NWC_STRING_TYPE_ASCII;
13168 + xferStr.DataLen = pEnum->objectNameLen - 1;
13170 + copy_to_user(eId->pObjectName, &xferStr,
13171 + sizeof(struct nwc_string));
13182 -/*++======================================================================*/
13183 -int NwcChangeAuthKey(PXPLAT pdata, session_t Session)
13189 - * Abstract: Change the password on the server
13195 - *========================================================================*/
13197 - PXPLAT_CALL_REQUEST cmd;
13198 - PXPLAT_CALL_REPLY reply;
13199 - NwcChangeKey xplatCall;
13200 - PNwdCChangeKey pNewKey;
13201 - NwcString xferStr;
13202 +int novfs_change_auth_key(struct novfs_xplat *pdata, struct novfs_schandle Session)
13204 + struct novfs_xplat_call_request *cmd;
13205 + struct novfs_xplat_call_reply *reply;
13206 + struct nwc_change_key xplatCall;
13207 + struct nwd_change_key *pNewKey;
13208 + struct nwc_string xferStr;
13210 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
13213 - copy_from_user(&xplatCall, pdata->reqData, sizeof(NwcChangeKey));
13214 + copy_from_user(&xplatCall, pdata->reqData, sizeof(struct nwc_change_key));
13217 - sizeof(NwdCChangeKey) + xplatCall.pDomainName->DataLen +
13218 + sizeof(struct nwd_change_key) + xplatCall.pDomainName->DataLen +
13219 xplatCall.pObjectName->DataLen + xplatCall.pNewPassword->DataLen +
13220 xplatCall.pVerifyPassword->DataLen;
13222 cmdlen = sizeof(*cmd) + datalen;
13223 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13224 + cmd = kmalloc(cmdlen, GFP_KERNEL);
13227 - pNewKey = (PNwdCChangeKey) cmd->data;
13228 - cmd->dataLen = datalen;
13229 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13230 - cmd->Command.SequenceNumber = 0;
13231 - cmd->Command.SessionId = Session;
13232 - cmd->NwcCommand = NWC_CHANGE_KEY;
13234 - pNewKey->NameType = xplatCall.NameType;
13235 - pNewKey->ObjectType = xplatCall.ObjectType;
13236 - pNewKey->AuthType = xplatCall.AuthType;
13237 - str = (char *)pNewKey;
13242 - * Get the tree name
13244 - str += sizeof(*pNewKey);
13246 - copy_from_user(&xferStr, xplatCall.pDomainName,
13247 - sizeof(NwcString));
13248 - pNewKey->domainNameOffset = sizeof(*pNewKey);
13249 - cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
13250 - pNewKey->domainNameLen = xferStr.DataLen;
13251 + pNewKey = (struct nwd_change_key *) cmd->data;
13252 + cmd->dataLen = datalen;
13253 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13254 + cmd->Command.SequenceNumber = 0;
13255 + cmd->Command.SessionId = Session;
13256 + cmd->NwcCommand = NWC_CHANGE_KEY;
13259 - * Get the User Name
13261 - str += pNewKey->domainNameLen;
13263 - copy_from_user(&xferStr, xplatCall.pObjectName,
13264 - sizeof(NwcString));
13265 - pNewKey->objectNameOffset =
13266 - pNewKey->domainNameOffset + pNewKey->domainNameLen;
13267 - cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
13268 - pNewKey->objectNameLen = xferStr.DataLen;
13269 + pNewKey->NameType = xplatCall.NameType;
13270 + pNewKey->ObjectType = xplatCall.ObjectType;
13271 + pNewKey->AuthType = xplatCall.AuthType;
13272 + str = (char *)pNewKey;
13275 - * Get the New Password
13277 - str += pNewKey->objectNameLen;
13279 - copy_from_user(&xferStr, xplatCall.pNewPassword,
13280 - sizeof(NwcString));
13281 - pNewKey->newPasswordOffset =
13282 - pNewKey->objectNameOffset + pNewKey->objectNameLen;
13283 - cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
13284 - pNewKey->newPasswordLen = xferStr.DataLen;
13286 + * Get the tree name
13288 + str += sizeof(*pNewKey);
13290 + copy_from_user(&xferStr, xplatCall.pDomainName,
13291 + sizeof(struct nwc_string));
13292 + pNewKey->domainNameOffset = sizeof(*pNewKey);
13293 + cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
13294 + pNewKey->domainNameLen = xferStr.DataLen;
13297 - * Get the Verify Password
13299 - str += pNewKey->newPasswordLen;
13301 - copy_from_user(&xferStr, xplatCall.pVerifyPassword,
13302 - sizeof(NwcString));
13303 - pNewKey->verifyPasswordOffset =
13304 - pNewKey->newPasswordOffset + pNewKey->newPasswordLen;
13305 - cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
13306 - pNewKey->verifyPasswordLen = xferStr.DataLen;
13309 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13310 - (void **)&reply, &replylen,
13313 - status = reply->Reply.ErrorCode;
13316 - memset(cmd, 0, cmdlen);
13318 + * Get the User Name
13320 + str += pNewKey->domainNameLen;
13322 + copy_from_user(&xferStr, xplatCall.pObjectName,
13323 + sizeof(struct nwc_string));
13324 + pNewKey->objectNameOffset =
13325 + pNewKey->domainNameOffset + pNewKey->domainNameLen;
13326 + cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
13327 + pNewKey->objectNameLen = xferStr.DataLen;
13331 + * Get the New Password
13333 + str += pNewKey->objectNameLen;
13335 + copy_from_user(&xferStr, xplatCall.pNewPassword,
13336 + sizeof(struct nwc_string));
13337 + pNewKey->newPasswordOffset =
13338 + pNewKey->objectNameOffset + pNewKey->objectNameLen;
13339 + cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
13340 + pNewKey->newPasswordLen = xferStr.DataLen;
13343 + * Get the Verify Password
13345 + str += pNewKey->newPasswordLen;
13347 + copy_from_user(&xferStr, xplatCall.pVerifyPassword,
13348 + sizeof(struct nwc_string));
13349 + pNewKey->verifyPasswordOffset =
13350 + pNewKey->newPasswordOffset + pNewKey->newPasswordLen;
13351 + cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
13352 + pNewKey->verifyPasswordLen = xferStr.DataLen;
13355 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13356 + (void **)&reply, &replylen,
13359 + status = reply->Reply.ErrorCode;
13362 + memset(cmd, 0, cmdlen);
13368 -/*++======================================================================*/
13369 -int NwcSetPrimaryConn(PXPLAT pdata, session_t Session)
13375 - * Abstract: Set the primary connection Id
13381 - *========================================================================*/
13383 - PXPLAT_CALL_REQUEST cmd;
13384 - PXPLAT_CALL_REPLY reply;
13385 - NwcSetPrimaryConnection xplatCall;
13386 - PNwdCSetPrimaryConnection pConn;
13387 +int novfs_set_pri_conn(struct novfs_xplat *pdata, struct novfs_schandle Session)
13389 + struct novfs_xplat_call_request *cmd;
13390 + struct novfs_xplat_call_reply *reply;
13391 + struct nwc_set_primary_conn xplatCall;
13392 + struct nwd_set_primary_conn *pConn;
13393 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
13396 copy_from_user(&xplatCall, pdata->reqData,
13397 - sizeof(NwcSetPrimaryConnection));
13398 + sizeof(struct nwc_set_primary_conn));
13400 - datalen = sizeof(NwdCSetPrimaryConnection);
13401 + datalen = sizeof(struct nwd_set_primary_conn);
13402 cmdlen = sizeof(*cmd) + datalen;
13403 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13405 - pConn = (PNwdCSetPrimaryConnection) cmd->data;
13406 - cmd->dataLen = datalen;
13407 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13408 - cmd->Command.SequenceNumber = 0;
13409 - cmd->Command.SessionId = Session;
13410 - cmd->NwcCommand = NWC_SET_PRIMARY_CONN;
13411 - pConn->ConnHandle = (HANDLE) (unsigned long) xplatCall.ConnHandle;
13413 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13414 - (void **)&reply, &replylen,
13418 - status = reply->Reply.ErrorCode;
13421 + cmd = kmalloc(cmdlen, GFP_KERNEL);
13427 + pConn = (struct nwd_set_primary_conn *) cmd->data;
13428 + cmd->dataLen = datalen;
13429 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13430 + cmd->Command.SequenceNumber = 0;
13431 + cmd->Command.SessionId = Session;
13432 + cmd->NwcCommand = NWC_SET_PRIMARY_CONN;
13433 + pConn->ConnHandle = (void *) (unsigned long) xplatCall.ConnHandle;
13435 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13436 + (void **)&reply, &replylen,
13440 + status = reply->Reply.ErrorCode;
13447 -/*++======================================================================*/
13448 -int NwcGetPrimaryConn(PXPLAT pdata, session_t Session)
13454 - * Abstract: Get the Primary connection
13460 - *========================================================================*/
13461 +int novfs_get_pri_conn(struct novfs_xplat *pdata, struct novfs_schandle Session)
13463 - XPLAT_CALL_REQUEST cmd;
13464 - PXPLAT_CALL_REPLY reply;
13465 + struct novfs_xplat_call_request cmd;
13466 + struct novfs_xplat_call_reply *reply;
13467 unsigned long status = -ENOMEM, cmdlen, replylen, cpylen;
13469 - cmdlen = (unsigned long) (&((PXPLAT_CALL_REQUEST) 0)->data);
13470 + cmdlen = (unsigned long) (&((struct novfs_xplat_call_request *) 0)->data);
13473 cmd.Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13474 @@ -2099,15 +1823,15 @@ int NwcGetPrimaryConn(PXPLAT pdata, sess
13475 cmd.NwcCommand = NWC_GET_PRIMARY_CONN;
13478 - Queue_Daemon_Command((void *)&cmd, cmdlen, NULL, 0, (void **)&reply,
13479 - &replylen, INTERRUPTIBLE);
13480 + Queue_Daemon_Command((void *)&cmd, cmdlen, NULL, 0, (void **)&reply,
13481 + &replylen, INTERRUPTIBLE);
13484 status = reply->Reply.ErrorCode;
13487 - copy_to_user(pdata->repData, reply->data,
13488 - sizeof(unsigned long));
13489 + copy_to_user(pdata->repData, reply->data,
13490 + sizeof(unsigned long));
13494 @@ -2116,26 +1840,13 @@ int NwcGetPrimaryConn(PXPLAT pdata, sess
13498 -/*++======================================================================*/
13499 -int NwcSetMapDrive(PXPLAT pdata, session_t Session)
13505 - * Abstract: Get the Primary connection
13511 - *========================================================================*/
13512 +int novfs_set_map_drive(struct novfs_xplat *pdata, struct novfs_schandle Session)
13515 - PXPLAT_CALL_REQUEST cmd;
13516 - PXPLAT_CALL_REPLY reply;
13517 + struct novfs_xplat_call_request *cmd;
13518 + struct novfs_xplat_call_reply *reply;
13519 unsigned long status = 0, datalen, cmdlen, replylen, cpylen;
13520 - NwcMapDriveEx symInfo;
13521 + struct nwc_map_drive_ex symInfo;
13523 DbgPrint("Call to NwcSetMapDrive\n");
13524 cpylen = copy_from_user(&symInfo, pdata->reqData, sizeof(symInfo));
13525 @@ -2151,53 +1862,41 @@ int NwcSetMapDrive(PXPLAT pdata, session
13526 DbgPrint(" symInfo.linkOffsetLength = %d\n", symInfo.linkOffsetLength);
13527 DbgPrint(" pdata->datalen = %d\n", pdata->reqLen);
13529 - mydump(sizeof(symInfo), &symInfo);
13530 + novfs_dump(sizeof(symInfo), &symInfo);
13534 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13536 - cmd->dataLen = datalen;
13537 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13538 - cmd->Command.SequenceNumber = 0;
13539 - cmd->Command.SessionId = Session;
13540 - cmd->NwcCommand = NWC_MAP_DRIVE;
13542 - cpylen = copy_from_user(cmd->data, pdata->reqData, datalen);
13544 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13545 - (void **)&reply, &replylen,
13549 - status = reply->Reply.ErrorCode;
13553 + cmd = kmalloc(cmdlen, GFP_KERNEL);
13557 + cmd->dataLen = datalen;
13558 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13559 + cmd->Command.SequenceNumber = 0;
13560 + cmd->Command.SessionId = Session;
13561 + cmd->NwcCommand = NWC_MAP_DRIVE;
13563 + cpylen = copy_from_user(cmd->data, pdata->reqData, datalen);
13565 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13566 + (void **)&reply, &replylen,
13570 + status = reply->Reply.ErrorCode;
13578 -/*++======================================================================*/
13579 -int NwcUnMapDrive(PXPLAT pdata, session_t Session)
13585 - * Abstract: Get the Primary connection
13591 - *========================================================================*/
13592 +int novfs_unmap_drive(struct novfs_xplat *pdata, struct novfs_schandle Session)
13594 - PXPLAT_CALL_REQUEST cmd;
13595 - PXPLAT_CALL_REPLY reply;
13596 + struct novfs_xplat_call_request *cmd;
13597 + struct novfs_xplat_call_reply *reply;
13598 unsigned long status = 0, datalen, cmdlen, replylen, cpylen;
13599 - NwcUnmapDriveEx symInfo;
13600 + struct nwc_unmap_drive_ex symInfo;
13602 DbgPrint("Call to NwcUnMapDrive\n");
13604 @@ -2206,47 +1905,34 @@ int NwcUnMapDrive(PXPLAT pdata, session_
13605 datalen = sizeof(symInfo) + symInfo.linkLen;
13608 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13610 - cmd->dataLen = datalen;
13611 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13612 - cmd->Command.SequenceNumber = 0;
13613 - cmd->Command.SessionId = Session;
13614 - cmd->NwcCommand = NWC_UNMAP_DRIVE;
13616 - cpylen = copy_from_user(cmd->data, pdata->reqData, datalen);
13618 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13619 - (void **)&reply, &replylen,
13623 - status = reply->Reply.ErrorCode;
13628 + cmd = kmalloc(cmdlen, GFP_KERNEL);
13632 + cmd->dataLen = datalen;
13633 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13634 + cmd->Command.SequenceNumber = 0;
13635 + cmd->Command.SessionId = Session;
13636 + cmd->NwcCommand = NWC_UNMAP_DRIVE;
13638 + cpylen = copy_from_user(cmd->data, pdata->reqData, datalen);
13640 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13641 + (void **)&reply, &replylen,
13645 + status = reply->Reply.ErrorCode;
13652 -/*++======================================================================*/
13653 -int NwcEnumerateDrives(PXPLAT pdata, session_t Session)
13659 - * Abstract: Get the Primary connection
13665 - *========================================================================*/
13666 +int novfs_enum_drives(struct novfs_xplat *pdata, struct novfs_schandle Session)
13668 - PXPLAT_CALL_REQUEST cmd;
13669 - PXPLAT_CALL_REPLY reply;
13670 + struct novfs_xplat_call_request *cmd;
13671 + struct novfs_xplat_call_reply *reply;
13672 unsigned long status = 0, cmdlen, replylen, cpylen;
13673 unsigned long offset;
13675 @@ -2254,284 +1940,266 @@ int NwcEnumerateDrives(PXPLAT pdata, ses
13676 DbgPrint("Call to NwcEnumerateDrives\n");
13678 cmdlen = sizeof(*cmd);
13679 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13681 - cmd->dataLen = 0;
13682 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13683 - cmd->Command.SequenceNumber = 0;
13684 - cmd->Command.SessionId = Session;
13685 - cmd->NwcCommand = NWC_ENUMERATE_DRIVES;
13687 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13688 - (void **)&reply, &replylen,
13692 - status = reply->Reply.ErrorCode;
13693 - DbgPrint("Status Code = 0x%X\n", status);
13696 - sizeof(((PNwcGetMappedDrives) pdata->
13697 - repData)->MapBuffLen);
13698 - cp = reply->data;
13700 - ((PNwcGetMappedDrives) pdata->repData)->
13703 - copy_to_user(pdata->repData, cp, offset);
13706 - copy_to_user(((PNwcGetMappedDrives) pdata->
13707 - repData)->MapBuffer, cp,
13708 - min(replylen - offset,
13709 - reply->dataLen - offset));
13711 + cmd = kmalloc(cmdlen, GFP_KERNEL);
13716 + cmd->dataLen = 0;
13717 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13718 + cmd->Command.SequenceNumber = 0;
13719 + cmd->Command.SessionId = Session;
13720 + cmd->NwcCommand = NWC_ENUMERATE_DRIVES;
13722 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13723 + (void **)&reply, &replylen,
13727 + status = reply->Reply.ErrorCode;
13728 + DbgPrint("Status Code = 0x%X\n", status);
13731 + sizeof(((struct nwc_get_mapped_drives *) pdata->
13732 + repData)->MapBuffLen);
13733 + cp = reply->data;
13735 + ((struct nwc_get_mapped_drives *) pdata->repData)->
13738 + copy_to_user(pdata->repData, cp, offset);
13741 + copy_to_user(((struct nwc_get_mapped_drives *) pdata->
13742 + repData)->MapBuffer, cp,
13743 + min(replylen - offset,
13744 + reply->dataLen - offset));
13755 -/*++======================================================================*/
13756 -int NwcGetBroadcastMessage(PXPLAT pdata, session_t Session)
13762 - * Abstract: Get the Primary connection
13768 - *========================================================================*/
13769 +int novfs_get_bcast_msg(struct novfs_xplat *pdata, struct novfs_schandle Session)
13771 - PXPLAT_CALL_REQUEST cmd;
13772 - PXPLAT_CALL_REPLY reply;
13773 + struct novfs_xplat_call_request *cmd;
13774 + struct novfs_xplat_call_reply *reply;
13775 unsigned long cmdlen, replylen;
13776 int status = 0x8866, cpylen;
13777 - NwcGetBroadcastNotification msg;
13778 - PNwdCGetBroadcastNotification dmsg;
13779 + struct nwc_get_bcast_notification msg;
13780 + struct nwd_get_bcast_notification *dmsg;
13782 cmdlen = sizeof(*cmd) + sizeof(*dmsg);
13783 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13785 + cmd = kmalloc(cmdlen, GFP_KERNEL);
13789 - cpylen = copy_from_user(&msg, pdata->reqData, sizeof(msg));
13790 - cmd->dataLen = sizeof(*dmsg);
13791 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13792 - cmd->Command.SequenceNumber = 0;
13793 - cmd->Command.SessionId = Session;
13795 - cmd->NwcCommand = NWC_GET_BROADCAST_MESSAGE;
13796 - dmsg = (PNwdCGetBroadcastNotification) cmd->data;
13797 - dmsg->uConnReference = (HANDLE) (unsigned long) msg.uConnReference;
13800 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13801 - (void **)&reply, &replylen,
13805 - status = reply->Reply.ErrorCode;
13808 - char *cp = pdata->repData;
13811 - (PNwdCGetBroadcastNotification) reply->data;
13812 - if (pdata->repLen < dmsg->messageLen) {
13813 - dmsg->messageLen = pdata->repLen;
13815 - msg.messageLen = dmsg->messageLen;
13816 - cpylen = offsetof(NwcGetBroadcastNotification, message);
13818 - cpylen = copy_to_user(pdata->repData, &msg, cpylen);
13819 - cpylen = copy_to_user(cp, dmsg->message, msg.messageLen);
13821 - msg.messageLen = 0;
13822 - msg.message[0] = 0;
13823 - cpylen = offsetof(NwcGetBroadcastNotification, message);
13824 - cpylen = copy_to_user(pdata->repData, &msg, sizeof(msg));
13826 + cpylen = copy_from_user(&msg, pdata->reqData, sizeof(msg));
13827 + cmd->dataLen = sizeof(*dmsg);
13828 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13829 + cmd->Command.SequenceNumber = 0;
13830 + cmd->Command.SessionId = Session;
13832 + cmd->NwcCommand = NWC_GET_BROADCAST_MESSAGE;
13833 + dmsg = (struct nwd_get_bcast_notification *) cmd->data;
13834 + dmsg->uConnReference = (void *) (unsigned long) msg.uConnReference;
13837 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13838 + (void **)&reply, &replylen,
13842 + status = reply->Reply.ErrorCode;
13846 + char *cp = pdata->repData;
13849 + (struct nwd_get_bcast_notification *) reply->data;
13850 + if (pdata->repLen < dmsg->messageLen) {
13851 + dmsg->messageLen = pdata->repLen;
13853 + msg.messageLen = dmsg->messageLen;
13856 + nwc_get_bcast_notification,
13860 + copy_to_user(pdata->repData, &msg, cpylen);
13862 + copy_to_user(cp, dmsg->message,
13865 + msg.messageLen = 0;
13866 + msg.message[0] = 0;
13867 + cpylen = offsetof(struct
13868 + nwc_get_bcast_notification,
13871 + copy_to_user(pdata->repData, &msg,
13882 -int NwdSetKeyValue(PXPLAT pdata, session_t Session)
13883 +int novfs_set_key_value(struct novfs_xplat *pdata, struct novfs_schandle Session)
13885 - PXPLAT_CALL_REQUEST cmd;
13886 - PXPLAT_CALL_REPLY reply;
13887 - NwcSetKey xplatCall;
13888 - PNwdCSetKey pNewKey;
13889 - NwcString cstrObjectName, cstrPassword;
13890 + struct novfs_xplat_call_request *cmd;
13891 + struct novfs_xplat_call_reply *reply;
13892 + struct nwc_set_key xplatCall;
13893 + struct nwd_set_key *pNewKey;
13894 + struct nwc_string cstrObjectName, cstrPassword;
13896 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
13898 - cpylen = copy_from_user(&xplatCall, pdata->reqData, sizeof(NwcSetKey));
13899 + cpylen = copy_from_user(&xplatCall, pdata->reqData, sizeof(struct nwc_set_key));
13901 copy_from_user(&cstrObjectName, xplatCall.pObjectName,
13902 - sizeof(NwcString));
13903 + sizeof(struct nwc_string));
13905 copy_from_user(&cstrPassword, xplatCall.pNewPassword,
13906 - sizeof(NwcString));
13907 + sizeof(struct nwc_string));
13910 - sizeof(NwdCSetKey) + cstrObjectName.DataLen + cstrPassword.DataLen;
13911 + sizeof(struct nwd_set_key ) + cstrObjectName.DataLen + cstrPassword.DataLen;
13913 cmdlen = sizeof(*cmd) + datalen;
13914 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13915 + cmd = kmalloc(cmdlen, GFP_KERNEL);
13918 - pNewKey = (PNwdCSetKey) cmd->data;
13919 - cmd->dataLen = datalen;
13920 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13921 - cmd->Command.SequenceNumber = 0;
13922 - cmd->Command.SessionId = Session;
13923 - cmd->NwcCommand = NWC_SET_KEY;
13925 - pNewKey->ObjectType = xplatCall.ObjectType;
13926 - pNewKey->AuthenticationId = xplatCall.AuthenticationId;
13927 - pNewKey->ConnHandle = (HANDLE) (unsigned long) xplatCall.ConnHandle;
13928 - str = (char *)pNewKey;
13933 - * Get the User Name
13935 - str += sizeof(NwdCSetKey);
13937 - copy_from_user(str, cstrObjectName.pBuffer,
13938 - cstrObjectName.DataLen);
13939 + pNewKey = (struct nwd_set_key *) cmd->data;
13940 + cmd->dataLen = datalen;
13941 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13942 + cmd->Command.SequenceNumber = 0;
13943 + cmd->Command.SessionId = Session;
13944 + cmd->NwcCommand = NWC_SET_KEY;
13946 - str += pNewKey->objectNameLen = cstrObjectName.DataLen;
13947 - pNewKey->objectNameOffset = sizeof(NwdCSetKey);
13948 + pNewKey->ObjectType = xplatCall.ObjectType;
13949 + pNewKey->AuthenticationId = xplatCall.AuthenticationId;
13950 + pNewKey->ConnHandle = (void *) (unsigned long) xplatCall.ConnHandle;
13951 + str = (char *)pNewKey;
13954 - * Get the Verify Password
13957 - copy_from_user(str, cstrPassword.pBuffer,
13958 - cstrPassword.DataLen);
13960 + * Get the User Name
13962 + str += sizeof(struct nwd_set_key );
13964 + copy_from_user(str, cstrObjectName.pBuffer,
13965 + cstrObjectName.DataLen);
13967 - pNewKey->newPasswordLen = cstrPassword.DataLen;
13968 - pNewKey->newPasswordOffset =
13969 - pNewKey->objectNameOffset + pNewKey->objectNameLen;
13972 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13973 - (void **)&reply, &replylen,
13976 - status = reply->Reply.ErrorCode;
13979 - memset(cmd, 0, cmdlen);
13982 + str += pNewKey->objectNameLen = cstrObjectName.DataLen;
13983 + pNewKey->objectNameOffset = sizeof(struct nwd_set_key );
13986 + * Get the Verify Password
13989 + copy_from_user(str, cstrPassword.pBuffer,
13990 + cstrPassword.DataLen);
13992 + pNewKey->newPasswordLen = cstrPassword.DataLen;
13993 + pNewKey->newPasswordOffset =
13994 + pNewKey->objectNameOffset + pNewKey->objectNameLen;
13997 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13998 + (void **)&reply, &replylen,
14001 + status = reply->Reply.ErrorCode;
14008 -/*++======================================================================*/
14009 -int NwdVerifyKeyValue(PXPLAT pdata, session_t Session)
14015 - * Abstract: Change the password on the server
14021 - *========================================================================*/
14023 - PXPLAT_CALL_REQUEST cmd;
14024 - PXPLAT_CALL_REPLY reply;
14025 - NwcVerifyKey xplatCall;
14026 - PNwdCVerifyKey pNewKey;
14027 - NwcString xferStr;
14028 +int novfs_verify_key_value(struct novfs_xplat *pdata, struct novfs_schandle Session)
14030 + struct novfs_xplat_call_request *cmd;
14031 + struct novfs_xplat_call_reply *reply;
14032 + struct nwc_verify_key xplatCall;
14033 + struct nwd_verify_key *pNewKey;
14034 + struct nwc_string xferStr;
14036 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
14039 - copy_from_user(&xplatCall, pdata->reqData, sizeof(NwcVerifyKey));
14040 + copy_from_user(&xplatCall, pdata->reqData, sizeof(struct nwc_verify_key));
14043 - sizeof(NwdCVerifyKey) + xplatCall.pDomainName->DataLen +
14044 + sizeof(struct nwd_verify_key) + xplatCall.pDomainName->DataLen +
14045 xplatCall.pObjectName->DataLen + xplatCall.pVerifyPassword->DataLen;
14047 cmdlen = sizeof(*cmd) + datalen;
14048 - cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
14049 + cmd = (struct novfs_xplat_call_request *)kmalloc(cmdlen, GFP_KERNEL);
14052 - pNewKey = (PNwdCVerifyKey) cmd->data;
14053 - cmd->dataLen = datalen;
14054 - cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
14055 - cmd->Command.SequenceNumber = 0;
14056 - cmd->Command.SessionId = Session;
14057 - cmd->NwcCommand = NWC_VERIFY_KEY;
14059 - pNewKey->NameType = xplatCall.NameType;
14060 - pNewKey->ObjectType = xplatCall.ObjectType;
14061 - pNewKey->AuthType = xplatCall.AuthType;
14062 - str = (char *)pNewKey;
14067 - * Get the tree name
14069 - str += sizeof(*pNewKey);
14071 - copy_from_user(&xferStr, xplatCall.pDomainName,
14072 - sizeof(NwcString));
14073 - pNewKey->domainNameOffset = sizeof(*pNewKey);
14074 - cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
14075 - pNewKey->domainNameLen = xferStr.DataLen;
14076 + pNewKey = (struct nwd_verify_key *) cmd->data;
14077 + cmd->dataLen = datalen;
14078 + cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
14079 + cmd->Command.SequenceNumber = 0;
14080 + cmd->Command.SessionId = Session;
14081 + cmd->NwcCommand = NWC_VERIFY_KEY;
14084 - * Get the User Name
14086 - str += pNewKey->domainNameLen;
14088 - copy_from_user(&xferStr, xplatCall.pObjectName,
14089 - sizeof(NwcString));
14090 - pNewKey->objectNameOffset =
14091 - pNewKey->domainNameOffset + pNewKey->domainNameLen;
14092 - cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
14093 - pNewKey->objectNameLen = xferStr.DataLen;
14094 + pNewKey->NameType = xplatCall.NameType;
14095 + pNewKey->ObjectType = xplatCall.ObjectType;
14096 + pNewKey->AuthType = xplatCall.AuthType;
14097 + str = (char *)pNewKey;
14100 - * Get the Verify Password
14102 - str += pNewKey->objectNameLen;
14104 - copy_from_user(&xferStr, xplatCall.pVerifyPassword,
14105 - sizeof(NwcString));
14106 - pNewKey->verifyPasswordOffset =
14107 - pNewKey->objectNameOffset + pNewKey->objectNameLen;
14108 - cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
14109 - pNewKey->verifyPasswordLen = xferStr.DataLen;
14112 - Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
14113 - (void **)&reply, &replylen,
14116 - status = reply->Reply.ErrorCode;
14119 - memset(cmd, 0, cmdlen);
14123 + * Get the tree name
14125 + str += sizeof(*pNewKey);
14127 + copy_from_user(&xferStr, xplatCall.pDomainName,
14128 + sizeof(struct nwc_string));
14129 + pNewKey->domainNameOffset = sizeof(*pNewKey);
14130 + cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
14131 + pNewKey->domainNameLen = xferStr.DataLen;
14134 + * Get the User Name
14136 + str += pNewKey->domainNameLen;
14138 + copy_from_user(&xferStr, xplatCall.pObjectName,
14139 + sizeof(struct nwc_string));
14140 + pNewKey->objectNameOffset =
14141 + pNewKey->domainNameOffset + pNewKey->domainNameLen;
14142 + cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
14143 + pNewKey->objectNameLen = xferStr.DataLen;
14146 + * Get the Verify Password
14148 + str += pNewKey->objectNameLen;
14150 + copy_from_user(&xferStr, xplatCall.pVerifyPassword,
14151 + sizeof(struct nwc_string));
14152 + pNewKey->verifyPasswordOffset =
14153 + pNewKey->objectNameOffset + pNewKey->objectNameLen;
14154 + cpylen = copy_from_user(str, xferStr.pBuffer, xferStr.DataLen);
14155 + pNewKey->verifyPasswordLen = xferStr.DataLen;
14158 + Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
14159 + (void **)&reply, &replylen,
14162 + status = reply->Reply.ErrorCode;
14168 --- a/fs/novfs/nwcapi.h
14169 +++ b/fs/novfs/nwcapi.h
14170 @@ -109,14 +109,14 @@
14172 #define IOC_XPLAT 0x4a540002
14174 -typedef struct _XPLAT_ {
14175 +struct novfs_xplat {
14177 unsigned long reqLen;
14179 unsigned long repLen;
14186 N_EXTERN_LIBRARY(NWRCODE)
14187 @@ -326,66 +326,30 @@ N_EXTERN_LIBRARY(NWRCODE)
14189 //===[ Type definitions ]==================================================
14192 -// Connection Handle returned from all OpenConnByXXXX calls
14195 -typedef u32 NW_CONN_HANDLE, *PNW_CONN_HANDLE;
14198 -// Authentication Id returned from the NwcCreateAuthenticationId call
14201 -typedef u32 AUTHEN_ID, *PAUTHEN_ID;
14204 // Structure for defining what a transport
14205 // address looks like
14208 -typedef struct tagNwcTranAddr {
14209 +struct nwc_tran_addr {
14210 u32 uTransportType;
14211 u32 uAddressLength;
14212 unsigned char *puAddress;
14215 -} NwcTranAddr, *PNwcTranAddr;
14218 -// Structure for defining what a new transport
14219 -// address looks like
14222 -typedef struct tagNwcTranAddrEx {
14223 - u32 uTransportType;
14224 - u32 uAddressLength;
14225 - unsigned char buBuffer[MAX_ADDRESS_LENGTH];
14227 -} NwcTranAddrEx, *PNwcTranAddrEx;
14229 -typedef struct tagNwcReferral {
14231 - PNwcTranAddrEx pAddrs;
14233 -} NwcReferral, *PNwcReferral;
14235 -typedef struct tagNwcServerVersion {
14236 - u32 uMajorVersion;
14237 - u16 uMinorVersion;
14240 -} NwcServerVersion, *PNwcServerVersion;
14242 -typedef struct tagNwcConnString {
14243 +struct nwc_conn_string {
14246 u32 uNameFormatType;
14248 -} NwcConnString, *PNwcConnString;
14251 //#if defined(NTYPES_H)
14252 //typedef NWCString NwcString, *PNwcString;
14254 -typedef struct tagNwcString {
14255 +struct nwc_string {
14259 @@ -393,36 +357,18 @@ typedef struct tagNwcString {
14263 -} NwcString, *PNwcString;
14268 -// Structure used in NDS Resolve name
14271 -#define RESOLVE_INFO_SVC_V1_00 0x00FE0001
14273 -typedef struct tagNwcResolveInfo {
14274 - u32 uResolveInfoVersion;
14278 - u32 luResolveType;
14280 - u32 luResolvedOffset;
14281 - u32 luDerefNameLen;
14283 -} NwcResolveInfo, *PNwcResolveInfo;
14286 // Definition of a fragment for the Raw NCP requests
14289 -typedef struct tagNwcFrag {
14294 -} NwcFrag, *PNwcFrag;
14298 // Current connection information available for
14299 @@ -432,62 +378,6 @@ typedef struct tagNwcFrag {
14300 #define NW_INFO_BUFFER_SIZE NW_MAX_TREE_NAME_LEN + \
14301 NW_MAX_TREE_NAME_LEN + \
14302 NW_MAX_SERVICE_TYPE_LEN
14304 -typedef struct tagNwcConnInfo {
14305 - u32 uInfoVersion;
14306 - u32 uAuthenticationState;
14307 - u32 uBroadcastState;
14308 - u32 uConnectionReference;
14309 - u32 TreeNameOffset;
14310 - u32 uSecurityState;
14311 - u32 uConnectionNumber;
14313 - u32 ServerNameOffset;
14315 - u32 uMaxPacketSize;
14316 - u32 uLicenseState;
14317 - u32 uPublicState;
14319 - u32 ServiceTypeOffset;
14322 - u32 uDisconnected;
14323 - NwcServerVersion serverVersion;
14324 - NwcTranAddrEx tranAddress;
14325 - unsigned char buBuffer[NW_INFO_BUFFER_SIZE];
14327 -} NwcConnInfo, *PNwcConnInfo;
14330 -// Get Browse Connection References
14333 -typedef struct _GetBrowseConnectionsRec {
14336 - u32 numConnectionsReturned;
14337 - u32 numConnectionsAvailable;
14338 - u32 connReferences[1];
14340 -} GetBrowseConnectionRec, *PGetBrowseConnectionRec;
14342 -//++=======================================================================
14343 -// API Name: NwcClearBroadcastMessage
14345 -// Arguments In: NONE
14347 -// Arguments Out: NONE
14349 -// Returns: STATUS_SUCCESS
14351 -// Abstract: This API is clears the broadcast message buffer.
14355 -// Environment: PASSIVE_LEVEL, LINUX
14357 -//=======================================================================--
14359 //++=======================================================================
14360 // API Name: NwcCloseConn
14362 @@ -514,10 +404,10 @@ typedef struct _GetBrowseConnectionsRec
14364 //=======================================================================--
14366 -typedef struct tagNwcCloseConn {
14367 - NW_CONN_HANDLE ConnHandle;
14368 +struct nwc_close_conn {
14371 -} NwcCloseConn, *PNwcCloseConn;
14374 //++=======================================================================
14375 // API Name: NwcConvertLocalFileHandle
14376 @@ -548,11 +438,11 @@ typedef struct tagNwcCloseConn {
14378 //=======================================================================--
14380 -typedef struct tagNwcConvertLocalHandle {
14381 +struct nwc_convert_local_handle {
14382 u32 uConnReference;
14383 unsigned char NetWareHandle[6];
14385 -} NwcConvertLocalHandle, *PNwcConvertLocalHandle;
14388 //++=======================================================================
14389 // API Name: NwcConvertNetWareHandle
14390 @@ -592,121 +482,13 @@ typedef struct tagNwcConvertLocalHandle
14391 // Environment: PASSIVE_LEVEL, LINUX
14393 //=======================================================================--
14394 -typedef struct tagNwcConvertNetWareHandle {
14395 - NW_CONN_HANDLE ConnHandle;
14396 +struct nwc_convert_netware_handle {
14399 unsigned char NetWareHandle[6];
14401 -} NwcConvertNetWareHandle, *PNwcConvertNetWareHandle;
14404 -//++=======================================================================
14405 -// API Name: NwcFragmentRequest
14407 -// Arguments In: ConnHandle
14408 -// The connection handle the request is being
14412 -// The NCP function to be called, should be 104
14413 -// for NDS fragger/defragger requests.
14416 -// The NCP subfunction to be called, should be
14417 -// 2 for NDS fragger/defragger requests.
14420 -// The actual operation to be completed on the
14421 -// server backend.
14424 -// Currently not implemented. Reserved for
14427 -// uNumRequestFrags
14428 -// The number of fragments that the request packet
14429 -// has been broken into.
14432 -// List of fragments that make up the request packet.
14433 -// Each fragment includes the length of the fragment
14434 -// data and a pointer to the data.
14437 -// The number of fragments the reply packet has been
14440 -// Arguments Out: pReplyFrags
14441 -// List of fragments that make up the reply packet.
14442 -// Each fragment includes the length of the fragment
14443 -// data and a pointer to the data.
14445 -// uActualReplyLength
14446 -// Total size of the reply packet after any header
14447 -// and tail information is removed.
14449 -// Returns: STATUS_SUCCESS
14450 -// NWE_ACCESS_VIOLATION
14451 -// NWE_CONN_INVALID
14453 -// Abstract: API for sending large NCP/NDS packets that are
14454 -// larger than the max MTU size for the underlying
14459 -// Environment: PASSIVE_LEVEL, LINUX
14461 -//=======================================================================--
14462 -typedef struct tagNwcFragmentRequest {
14463 - NW_CONN_HANDLE ConnHandle;
14465 - u32 uSubFunction;
14468 - u32 uNumRequestFrags;
14469 - PNwcFrag pRequestFrags;
14470 - u32 uNumReplyFrags;
14471 - PNwcFrag pReplyFrags;
14472 - u32 uActualReplyLength;
14473 -} NwcFragmentRequest, *PNwcFragmentRequest;
14475 -//++=======================================================================
14476 -// API Name: NwcGetBroadcastMessage
14478 -// Arguments In: uMessageFlags - Not currently used.
14480 -// uConnReference - connection reference for
14481 -// pending message.
14483 -// messageLen - length of message buffer.
14485 -// message - message buffer
14487 -// Arguments Out: messageLen - length of the message
14489 -// Returns: STATUS_SUCCESS
14490 -// NWE_ACCESS_VIOLATION
14491 -// NWE_NO_MORE_ENTRIES
14493 -// Abstract: This API is used for notifying a caller of pending
14494 -// broadcast messages on the server.
14498 -// Environment: PASSIVE_LEVEL, LINUX
14500 -//=======================================================================--
14503 -typedef struct tagNwcGetBroadcastMessage
14505 - u32 uMessageFlags;
14506 - u32 uConnReference;
14508 - unsigned char message[255];
14510 -} NwcGetBroadcastMessage, *PNwcGetBroadcastMessage;
14513 //++=======================================================================
14514 // API Name: NwcGetConnInfo
14515 @@ -746,13 +528,13 @@ typedef struct tagNwcGetBroadcastMess
14517 //=======================================================================--
14519 -typedef struct tagNwcGetConnInfo {
14520 - NW_CONN_HANDLE ConnHandle;
14521 +struct nwc_get_conn_info {
14527 -} NwcGetConnInfo, *PNwcGetConnInfo;
14530 //++=======================================================================
14531 // API Name: NwcGetDefaultNameContext
14532 @@ -785,14 +567,14 @@ typedef struct tagNwcGetConnInfo {
14534 //=======================================================================--
14536 -typedef struct tagNwcGetDefaultNameContext {
14537 +struct nwc_get_def_name_ctx {
14539 unsigned char *pDsTreeName;
14541 // unsigned short *pNameContext;
14542 unsigned char *pNameContext;
14544 -} NwcGetDefaultNameContext, *PNwcGetDefaultNameContext;
14547 //++=======================================================================
14548 // API Name: NwcGetTreeMonitoredConnReference
14549 @@ -817,86 +599,12 @@ typedef struct tagNwcGetDefaultNameConte
14551 //=======================================================================--
14553 -typedef struct tagNwcGetTreeMonitoredConnRef {
14554 - PNwcString pTreeName;
14555 +struct nwc_get_tree_monitored_conn_ref {
14556 + struct nwc_string *pTreeName;
14557 u32 uConnReference;
14559 -} NwcGetTreeMonitoredConnRef, *PNwcGetTreeMonitoredConnRef;
14562 -//++=======================================================================
14563 -// API Name: NwcGetNumberConns
14565 -// Arguments In: NONE
14567 -// Arguments Out: uMaxConns - The maximum number of connections
14568 -// supported by the redirector. -1 for dynamic.
14570 -// uPublicConns - The current number of public
14573 -// uTasksPrivateConns - The current number of private
14574 -// connections that are owned by the calling process.
14576 -// uOtherPrivateConns - The current number of private
14577 -// connections that are not owned by the calling
14580 -// Returns: STATUS_SUCCESS
14581 -// NWE_ACCESS_VIOLATION
14582 -// NWE_RESOURCE_LOCK
14584 -// Abstract: This API returns the current number of connections
14585 -// as well as the maximum number of supported
14586 -// connections. If the requester/redirector supports
14587 -// a dynamic connection table, -1 will be returned
14588 -// in the uMaxConns field.
14592 -// Environment: PASSIVE_LEVEL, LINUX
14594 -//=======================================================================--
14596 -typedef struct tagNwcGetNumberConns {
14598 - u32 uPublicConns;
14599 - u32 uTasksPrivateConns;
14600 - u32 uOtherPrivateConns;
14602 -} NwcGetNumberConns, *PNwcGetNumberConns;
14604 -//++=======================================================================
14605 -// API Name: NwcGetPreferredServer
14607 -// Arguments In: uServerNameLength - On input, this is the length
14608 -// in bytes of the server buffer. On output, this is
14609 -// the actual length of the server name string in bytes.
14611 -// Arguments Out: pServerName - The buffer to copy the preferred server
14614 -// Returns: STATUS_SUCCESS
14615 -// NWE_ACCESS_VIOLATION
14616 -// NWE_BUFFER_OVERFLOW
14617 -// NWE_OBJECT_NOT_FOUND
14618 -// NWE_PARAM_INVALID
14619 -// NWE_RESOURCE_LOCK
14621 -// Abstract: This API returns the configured preferred bindery
14622 -// server previously set either by configuration or
14623 -// by calling NwcSetPreferredServer.
14627 -// Environment: PASSIVE_LEVEL, LINUX
14629 -//=======================================================================--
14631 -typedef struct tagNwcGetPreferredServer {
14632 - u32 uServerNameLength;
14633 - char *pServerName;
14635 -} NwcGetPreferredServer, *PNwcGetPreferredServer;
14637 //++=======================================================================
14638 // API Name: NwcGetPreferredDsTree
14639 @@ -923,63 +631,10 @@ typedef struct tagNwcGetPreferredServer
14640 // Environment: PASSIVE_LEVEL, LINUX
14642 //=======================================================================--
14643 -typedef struct tagNwcGetPreferredDsTree {
14644 +struct nwc_get_pref_ds_tree {
14646 unsigned char *pDsTreeName;
14647 -} NwcGetPreferredDsTree, *PNwcGetPreferredDsTree;
14649 -//++=======================================================================
14650 -// API Name: NwcGetPrimaryConnection
14652 -// Arguments In: NONE
14654 -// Arguments Out: uConnReference - Reference to the primary connection.
14656 -// Returns: STATUS_SUCCESS
14657 -// NWE_ACCESS_VIOLATION
14658 -// NWE_CONN_PRIMARY_NOT_SET
14660 -// Abstract: This API returns the reference to the current primary
14661 -// connection in the redirector.
14665 -// Environment: PASSIVE_LEVEL, LINUX
14667 -//=======================================================================--
14669 -typedef struct tagNwcGetPrimaryConnection {
14670 - u32 uConnReference;
14672 -} NwcGetPrimaryConnection, *PNwcGetPrimaryConnection;
14674 -//++=======================================================================
14675 -// API Name: NwcGetRequesterVersion
14677 -// Arguments In: NONE
14679 -// Arguments Out: uMajorVersion
14683 -// Returns: STATUS_SUCCESS
14684 -// NWE_ACCESS_VIOLATION
14686 -// Abstract: This API returns the major version, minor version and
14687 -// revision of the requester/redirector.
14691 -// Environment: PASSIVE_LEVEL, LINUX
14693 -//=======================================================================--
14695 -typedef struct tagNwcGetRequesterVersion {
14696 - u32 uMajorVersion;
14697 - u32 uMinorVersion;
14700 -} NwcGetRequesterVersion, *PNwcGetRequesterVersion;
14703 //++=======================================================================
14704 // API Name: NwcLicenseConn
14705 @@ -1007,115 +662,10 @@ typedef struct tagNwcGetRequesterVersion
14707 //=======================================================================--
14709 -typedef struct tagNwcLicenseConn {
14710 - NW_CONN_HANDLE ConnHandle;
14712 -} NwcLicenseConn, *PNwcLicenseConn;
14714 -//++=======================================================================
14715 -// API Name: NwcMakeConnPermanent
14717 -// Arguments In: ConnHandle - An open connection handle associated
14718 -// with the connection to be made permanent.
14720 -// Arguments Out: NONE
14722 -// Returns: NWE_ACCESS_VIOLATION
14723 -// NWE_CONN_INVALID
14724 -// NWE_INVALID_OWNER
14726 -// Abstract: This API is used to keep the connection from being
14727 -// destroyed until a NwcSysCloseConn request is made
14728 -// on the connection. This allows the connection to
14729 -// remain after all processes that have the
14730 -// connection open terminate.
14734 -// Environment: PASSIVE_LEVEL, LINUX
14736 -//=======================================================================--
14738 -typedef struct tagNwcMakeConnPermanent {
14739 - NW_CONN_HANDLE ConnHandle;
14741 -} NwcMakeConnPermanent, *PNwcMakeConnPermanent;
14743 -//++=======================================================================
14744 -// API Name: NwcMapDrive
14746 -// Arguments In: ConnHandle - The connection handle of the server
14747 -// to where the drive is to be mapped.
14749 -// LocalUID - Local user ID
14751 -// LocalPathLen - Length of local/link directory path string,
14752 -// including nul terminator.
14754 -// LocalPathOffset - Offset of local directory path that will
14755 -// be mapped to NetWare directory path.
14757 -// NetWarePathLen - Offset of NetWare directory path,
14758 -// including nul terminator.
14760 -// NetWarePathOffset - Offset of NetWare directory path in
14763 -// Arguments Out: NONE
14765 -// Returns: STATUS_SUCCESS
14766 -// NWE_ACCESS_VIOLATION
14767 -// NWE_CONN_INVALID
14768 -// NWE_INSUFFICIENT_RESOURCES
14769 -// NWE_STRING_TRANSLATION
14771 -// Abstract: This API maps the target drive to the specified
14776 -// Environment: PASSIVE_LEVEL, LINUX
14778 -//=======================================================================--
14780 -typedef struct tagNwcMapDrive {
14781 - NW_CONN_HANDLE ConnHandle;
14784 - u32 LinkPathOffset;
14786 - u32 DestPathOffset;
14787 +struct nwc_license_conn {
14791 -} NwcMapDrive, *PNwcMapDrive;
14793 -//++=======================================================================
14794 -// API Name: NwcUnmapDrive
14796 -// Arguments In: LinkPathLen - Length of local/link path string,
14797 -// including nul terminator.
14799 -// LinkPath - Local/link path in structure
14802 -// Arguments Out: NONE
14804 -// Returns: STATUS_SUCCESS
14805 -// NWE_ACCESS_VIOLATION
14806 -// NWE_PARAM_INVALID
14808 -// Abstract: This API deletes a network drive mapping.
14812 -// Environment: PASSIVE_LEVEL, LINUX
14814 -//=======================================================================--
14816 -typedef struct tagNwcUnmapDrive {
14818 - unsigned char LinkPath[1];
14820 -} NwcUnmapDrive, *PNwcUnmapDrive;
14822 //++=======================================================================
14823 // API Name: NWCGetMappedDrives
14824 @@ -1136,26 +686,11 @@ typedef struct tagNwcUnmapDrive {
14826 //=======================================================================--
14828 -typedef struct tagNwcMapDriveElem {
14829 - u32 ElemLen; // Lenght of drive element
14830 - u32 ConnRefernce; // Connection reference
14831 - u32 LinkPathLen; // Local/link dir path, length includes nul
14832 - unsigned char LinkPath[1]; // LinkPath[LinkPathLen]
14833 -// u32 DirPathLen; // NetWare dir path, length includes nul (vol:path)
14834 -// unsigned char DirPath[DirPathLen]; // NetWarePath[DirPathLen]
14835 -} NwcMapDriveElem, *PNwcMapDriveElem;
14837 -typedef struct tagNwcMapDriveBuff {
14838 - u32 MapCount; // Number of mapped drives
14839 - NwcMapDriveElem MapDriveElem[1]; // MapDriveElem[MapCount]
14841 -} NwcMapDriveBuff, *PNwcMapDriveBuff;
14843 -typedef struct tagNwcGetMappedDrives {
14844 +struct nwc_get_mapped_drives {
14845 u32 MapBuffLen; // Buffer length (actual buffer size returned)
14846 - PNwcMapDriveBuff MapBuffer; // Pointer to map buffer
14847 + struct nwc_mapped_drive_buf *MapBuffer; // Pointer to map buffer
14849 -} NwcGetMappedDrives, *PNwcGetMappedDrives;
14852 //++=======================================================================
14853 // API Name: NwcGetMountPath
14854 @@ -1178,39 +713,11 @@ typedef struct tagNwcGetMappedDrives {
14856 //=======================================================================--
14858 -typedef struct tagNwcGetMountPath {
14859 +struct nwc_get_mount_path {
14861 unsigned char *pMountPath;
14863 -} NwcGetMountPath, *PNwcGetMountPath;
14865 -//++=======================================================================
14866 -// API Name: NwcMonitorConn
14868 -// Arguments In: ConnHandle - The handle associated with the connection
14869 -// that is to be marked as the monitored connection.
14871 -// Arguments Out: NONE
14873 -// Returns: STATUS_SUCCESS
14874 -// NWE_ACCESS_VIOLATION
14875 -// NWE_RESOURCE_LOCK
14876 -// NWE_CONN_INVALID
14879 -// Abstract: This call marks the connection associated with the
14880 -// connection handle as monitored.
14884 -// Environment: PASSIVE_LEVEL, LINUX
14886 -//=======================================================================--
14888 -typedef struct tagNwcMonitorConn {
14889 - NW_CONN_HANDLE ConnHandle;
14891 -} NwcMonitorConn, *PNwcMonitorConn;
14894 //++=======================================================================
14895 // API Name: NwcOpenConnByAddr
14896 @@ -1244,13 +751,13 @@ typedef struct tagNwcMonitorConn {
14898 //=======================================================================--
14900 -typedef struct tagNwcOpenConnByAddr {
14901 +struct nwc_open_conn_by_addr {
14902 char *pServiceType;
14904 - PNwcTranAddr pTranAddr;
14905 - NW_CONN_HANDLE ConnHandle;
14906 + struct nwc_tran_addr *pTranAddr;
14909 -} NwcOpenConnByAddr, *PNwcOpenConnByAddr;
14912 //++=======================================================================
14913 // API Name: NwcOpenConnByName
14914 @@ -1304,15 +811,15 @@ typedef struct tagNwcOpenConnByAddr {
14916 //=======================================================================--
14918 -typedef struct tagNwcOpenConnByName {
14919 - NW_CONN_HANDLE ConnHandle;
14920 - PNwcConnString pName;
14921 +struct nwc_open_conn_by_name {
14923 + struct nwc_conn_string *pName;
14924 char *pServiceType;
14927 - NW_CONN_HANDLE RetConnHandle;
14928 + u32 RetConnHandle;
14930 -} NwcOpenConnByName, *PNwcOpenConnByName;
14933 //++=======================================================================
14934 // API Name: NwcOpenConnByReference
14935 @@ -1346,12 +853,12 @@ typedef struct tagNwcOpenConnByName {
14937 //=======================================================================--
14939 -typedef struct tagNwcOpenConnByReference {
14940 +struct nwc_open_conn_by_ref {
14941 u32 uConnReference;
14943 - NW_CONN_HANDLE ConnHandle;
14946 -} NwcOpenConnByReference, *PNwcOpenConnByReference;
14949 //++=======================================================================
14950 // API Name: NwcRawRequest
14951 @@ -1390,55 +897,16 @@ typedef struct tagNwcOpenConnByReference
14953 //=======================================================================--
14955 -typedef struct tagNwcRequest {
14956 - NW_CONN_HANDLE ConnHandle;
14957 +struct nwc_request {
14960 u32 uNumRequestFrags;
14961 - PNwcFrag pRequestFrags;
14962 + struct nwc_frag *pRequestFrags;
14963 u32 uNumReplyFrags;
14964 - PNwcFrag pReplyFrags;
14965 + struct nwc_frag *pReplyFrags;
14966 u32 uActualReplyLength;
14968 -} NwcRequest, *PNwcRequest;
14970 -//++=======================================================================
14971 -// API Name: NwcRawRequestAll
14973 -// Arguments In: uFunction - The NCP function that is being called.
14975 -// uNumRequestFrags - The number of fragments that the
14976 -// request packet has been broken into.
14978 -// pRequestFrags - List of fragments that make up the
14979 -// request packet. Each fragment includes the length
14980 -// of the fragment data and a pointer to the data.
14982 -// Arguments Out: NONE
14984 -// Returns: STATUS_SUCCESS
14985 -// NWE_ACCESS_VIOLATION
14986 -// NWE_CONN_INVALID
14988 -// Abstract: API for sending the given NCP request to all valid
14989 -// connections. If there is a private connection that
14990 -// is not owned by the caller of this function, that
14991 -// connection will not be included. Also, if the
14992 -// caller has both a private and a public connection
14993 -// to the same server, only the private connection
14994 -// will receive the request.
14998 -// Environment: PASSIVE_LEVEL, LINUX
15000 -//=======================================================================--
15002 -typedef struct tagNwcRequestAll {
15004 - u32 uNumRequestFrags;
15005 - PNwcFrag pRequestFrags;
15007 -} NwcRequestAll, *PNwcRequestAll;
15010 //++=======================================================================
15011 // API Name: NwcScanConnInfo
15012 @@ -1544,7 +1012,7 @@ typedef struct tagNwcRequestAll {
15014 //=======================================================================--
15016 -typedef struct tagNwcScanConnInfo {
15017 +struct nwc_scan_conn_info {
15019 u32 uScanInfoLevel;
15021 @@ -1555,7 +1023,7 @@ typedef struct tagNwcScanConnInfo {
15022 u32 uConnectionReference;
15023 void *pReturnConnInfo;
15025 -} NwcScanConnInfo, *PNwcScanConnInfo;
15028 //++=======================================================================
15029 // API Name: NwcSetConnInfo
15030 @@ -1589,13 +1057,13 @@ typedef struct tagNwcScanConnInfo {
15032 //=======================================================================--
15034 -typedef struct tagNwcSetConnInfo {
15035 - NW_CONN_HANDLE ConnHandle;
15036 +struct nwc_set_conn_info {
15042 -} NwcSetConnInfo, *PNwcSetConnInfo;
15045 //++=======================================================================
15046 // API Name: NwcSetDefaultNameContext
15047 @@ -1626,14 +1094,14 @@ typedef struct tagNwcSetConnInfo {
15049 //=======================================================================--
15051 -typedef struct tagNwcSetDefaultNameContext {
15052 +struct nwc_set_def_name_ctx {
15054 unsigned char *pDsTreeName;
15056 // unsined short *pNameContext;
15057 unsigned char *pNameContext;
15059 -} NwcSetDefaultNameContext, *PNwcSetDefaultNameContext;
15062 //++=======================================================================
15063 // API Name: NwcSetPreferredDsTree
15064 @@ -1658,41 +1126,11 @@ typedef struct tagNwcSetDefaultNameConte
15066 //=======================================================================--
15068 -typedef struct tagNwcSetPreferredDsTree {
15069 +struct nwc_set_pref_ds_tree {
15071 unsigned char *pDsTreeName;
15073 -} NwcSetPreferredDsTree, *PNwcSetPreferredDsTree;
15075 -//++=======================================================================
15076 -// API Name: NwcSetPreferredServer
15078 -// Arguments In: uServerNameLength - The length in bytes of the
15079 -// preferred server string.
15081 -// pServerName - a pointer to an ASCIIZ string of the
15082 -// preferred bindery server.
15084 -// Arguments Out: NONE
15086 -// Returns: STATUS_SUCCESS
15087 -// NWE_ACCESS_VIOLATION
15088 -// NWE_INSUFFICIENT_RESOURCES
15089 -// NWE_RESOURCE_LOCK
15091 -// Abstract: This API sets the preferred server name.
15095 -// Environment: PASSIVE_LEVEL, LINUX
15097 -//=======================================================================--
15099 -typedef struct tagNwcSetPreferredServer {
15100 - u32 uServerNameLength;
15101 - char *pServerName;
15103 -} NwcSetPreferredServer, *PNwcSetPreferredServer;
15106 //++=======================================================================
15107 // API Name: NwcSetPrimaryConnection
15108 @@ -1716,69 +1154,11 @@ typedef struct tagNwcSetPreferredServer
15110 //=======================================================================--
15112 -typedef struct tagNwcSetPrimaryConnection {
15113 - NW_CONN_HANDLE ConnHandle;
15115 -} NwcSetPrimaryConnection, *PNwcSetPrimaryConnection;
15117 -//++=======================================================================
15118 -// API Name: NwcSysCloseConn
15120 -// Arguments In: ConnHandle - The handle to a connection that is
15121 -// to be destroyed.
15123 -// Arguments Out: NONE
15125 -// Returns: STATUS_SUCCESS
15126 -// NWE_ACCESS_VIOLATION
15127 -// NWE_CONN_INVALID
15129 -// Abstract: This API is similiar to the NwcCloseConn API, except
15130 -// that it forces all handles to the connection closed
15131 -// and destroys the service connection. This is a system
15132 -// level request that will cause all processes that are
15133 -// accessing this connection to lose access to the
15134 -// resources associated to the connection.
15138 -// Environment: PASSIVE_LEVEL, LINUX
15140 -//=======================================================================--
15142 -typedef struct tagNwcSysCloseConn {
15143 - NW_CONN_HANDLE ConnHandle;
15145 -} NwcSysCloseConn, *PNwcSysCloseConn;
15147 -//++=======================================================================
15148 -// API Name: NwcUnlicenseConn
15150 -// Arguments In: ConnHandle - Open connection handle that will be
15151 -// accessing the connection in an unlicensed manner.
15153 -// Arguments Out: NONE
15155 -// Returns: STATUS_SUCCESS
15156 -// NWE_ACCESS_VIOLATION
15157 -// NWE_CONN_INVALID
15158 -// NWE_HANDLE_ALREADY_UNLICENSED
15160 -// Abstract: This API is used to change the state of a connection
15161 -// handle from licensed to unlicensed. If all handles
15162 -// to the connection have been changed to the unlicensed
15163 -// state, the unlicensed NCP is sent to the server.
15167 -// Environment: PASSIVE_LEVEL, LINUX
15169 -//=======================================================================--
15170 +struct nwc_set_primary_conn {
15173 -typedef struct tagNwcUnlicenseConn {
15174 - NW_CONN_HANDLE ConnHandle;
15177 -} NwcUnlicenseConn, *PNwcUnlicenseConn;
15179 //++=======================================================================
15180 // API Name: NwcQueryFeature
15181 @@ -1801,10 +1181,10 @@ typedef struct tagNwcUnlicenseConn {
15183 //=======================================================================--
15185 -typedef struct tagNwcQueryFeature {
15186 +struct nwc_query_feature {
15189 -} NwcQueryFeature, *PNwcQueryFeature;
15192 //++=======================================================================
15193 // API Name: NWCChangePassword
15194 @@ -1824,16 +1204,16 @@ typedef struct tagNwcQueryFeature {
15196 //=======================================================================--
15198 -typedef struct tagNwcChangeKey {
15199 - PNwcString pDomainName;
15200 +struct nwc_change_key {
15201 + struct nwc_string *pDomainName;
15203 - PNwcString pObjectName;
15204 + struct nwc_string *pObjectName;
15207 - PNwcString pVerifyPassword;
15208 - PNwcString pNewPassword;
15209 + struct nwc_string *pVerifyPassword;
15210 + struct nwc_string *pNewPassword;
15212 -} NwcChangeKey, *PNwcChangeKey;
15215 //++=======================================================================
15216 // API Name: NWCEnumerateIdentities `
15217 @@ -1853,17 +1233,17 @@ typedef struct tagNwcChangeKey {
15219 //=======================================================================--
15221 -typedef struct tagNwcEnumerateIdentities {
15222 +struct nwc_enum_ids {
15224 - PNwcString pDomainName;
15225 + struct nwc_string *pDomainName;
15227 - PNwcString pObjectName;
15228 + struct nwc_string *pObjectName;
15232 - AUTHEN_ID AuthenticationId;
15233 + u32 AuthenticationId;
15235 -} NwcEnumerateIdentities, *PNwcEnumerateIdentities;
15238 //++=======================================================================
15239 // API Name: NWCGetIdentityInfo
15240 @@ -1883,16 +1263,16 @@ typedef struct tagNwcEnumerateIdentities
15242 //=======================================================================--
15244 -typedef struct tagNwcGetIdentityInfo {
15245 - AUTHEN_ID AuthenticationId;
15246 - PNwcString pDomainName;
15247 +struct nwc_get_id_info {
15248 + u32 AuthenticationId;
15249 + struct nwc_string *pDomainName;
15251 - PNwcString pObjectName;
15252 + struct nwc_string *pObjectName;
15257 -} NwcGetIdentityInfo, *PNwcGetIdentityInfo;
15260 //++=======================================================================
15261 // API Name: NWCLoginIdentity
15262 @@ -1912,41 +1292,18 @@ typedef struct tagNwcGetIdentityInfo {
15264 //=======================================================================--
15266 -typedef struct tagNwcLoginIdentity {
15267 - PNwcString pDomainName;
15268 +struct nwc_login_id {
15269 + struct nwc_string *pDomainName;
15271 - PNwcString pObjectName;
15272 + struct nwc_string *pObjectName;
15276 - PNwcString pPassword;
15277 - AUTHEN_ID AuthenticationId;
15279 -} NwcLoginIdentity, *PNwcLoginIdentity;
15281 -//++=======================================================================
15282 -// API Name: NWCLogoutIdentity
15289 -// Returns: STATUS_SUCCESS
15290 -// NWE_ACCESS_VIOLATION
15296 -// Environment: PASSIVE_LEVEL, LINUX
15298 -//=======================================================================--
15299 + struct nwc_string *pPassword;
15300 + u32 AuthenticationId;
15302 -typedef struct tagNwcLogoutIdentity {
15303 - AUTHEN_ID AuthenticationId;
15306 -} NwcLogoutIdentity, *PNwcLogoutIdentity;
15308 //++=======================================================================
15309 // API Name: NWCSetPassword
15310 @@ -1966,14 +1323,14 @@ typedef struct tagNwcLogoutIdentity {
15312 //=======================================================================--
15314 -typedef struct tagNwcSetKey {
15315 - NW_CONN_HANDLE ConnHandle;
15316 - AUTHEN_ID AuthenticationId;
15317 - PNwcString pObjectName;
15318 +struct nwc_set_key {
15320 + u32 AuthenticationId;
15321 + struct nwc_string *pObjectName;
15323 - PNwcString pNewPassword;
15324 + struct nwc_string *pNewPassword;
15326 -} NwcSetKey, *PNwcSetKey;
15329 //++=======================================================================
15330 // API Name: NWCVerifyPassword
15331 @@ -1993,15 +1350,15 @@ typedef struct tagNwcSetKey {
15333 //++=======================================================================
15335 -typedef struct tagNwcVerifyKey {
15336 - PNwcString pDomainName;
15337 +struct nwc_verify_key {
15338 + struct nwc_string *pDomainName;
15340 - PNwcString pObjectName;
15341 + struct nwc_string *pObjectName;
15344 - PNwcString pVerifyPassword;
15345 + struct nwc_string *pVerifyPassword;
15347 -} NwcVerifyKey, *PNwcVerifyKey;
15350 //++=======================================================================
15351 // API Name: NwcAuthenticateWithId
15352 @@ -2026,188 +1383,34 @@ typedef struct tagNwcVerifyKey {
15354 //=======================================================================--
15356 -typedef struct tagNwcAuthenticateWithId {
15357 - NW_CONN_HANDLE ConnHandle;
15358 - AUTHEN_ID AuthenticationId;
15360 -} NwcAuthenticateWithId, *PNwcAuthenticateWithId;
15362 -//++=======================================================================
15363 -// API Name: NwcUnauthenticate
15365 -// Arguments In: ConnHandle - The connection to unauthenticate.
15367 -// Arguments Out: NONE
15369 -// Returns: STATUS_SUCCESS
15370 -// NWE_ACCESS_VIOLATION
15371 -// NWE_CONN_INVALID
15372 -// NWE_INVALID_OWNER
15373 -// NWE_RESOURCE_LOCK
15375 -// Abstract: This API removes the authentication for the specified
15380 -// Environment: PASSIVE_LEVEL, LINUX
15382 -//=======================================================================--
15384 -typedef struct tagNwcUnauthenticate {
15385 - NW_CONN_HANDLE ConnHandle;
15386 - AUTHEN_ID AuthenticationId;
15388 -} NwcUnauthenticate, *PNwcUnauthenticate;
15390 -//++=======================================================================
15391 -// API Name: NwcGetCfgNameServiceProviders
15397 -// Returns: STATUS_SUCCESS
15398 -// NWE_ACCESS_VIOLATION
15404 -// Environment: PASSIVE_LEVEL, LINUX
15406 -//=======================================================================--
15409 - u32 providerCount;
15410 - u32 providers[MAX_NAME_SERVICE_PROVIDERS];
15412 -} NwcGetCfgNameServiceProviders, *PNwcGetCfgNameServiceProviders;
15414 -//++=======================================================================
15415 -// API Name: NwcNdsResolveNameToId
15417 -// Arguments In: connHandle
15418 -// Specifies connection to use to resolve name with.
15421 -// Points to the name of the NDS entry to resolve.
15424 -// Specifies the preferred or required transport to
15428 -// Points to the NwcNdsResolveInfo structure
15429 -// containing information on how the entry is to be
15432 -// Arguments Out: pResolveInfo
15433 -// Points to the NwcNdsResolveInfo structure
15434 -// containing return information on the resolved
15438 -// Points to the resolved name's entry ID.
15441 -// Points to the NwcReferral structure which describes
15442 -// network addresses that can be used to locate other
15443 -// NDS partitions that contain the entry name.
15445 -// Returns: STATUS_SUCCESS
15446 -// NWE_CONN_INVALID,
15447 -// NWE_BUFFER_OVERFLOW,
15448 -// NWE_TRAN_INVALID_TYPE,
15449 -// NWE_ACCESS_VIOLATION,
15450 -// NWE_UNSUPPORTED_TRAN_TYPE,
15453 -// Abstract: This API resolves a NDS entry name.
15457 -// Environment: PASSIVE_LEVEL, LINUX
15459 -//=======================================================================--
15461 -typedef struct tagNwcNdsResolveNameToId {
15462 - NW_CONN_HANDLE connHandle;
15463 - PNwcString pName;
15464 - u32 uReqTranType;
15465 - PNwcResolveInfo pResolveInfo;
15467 - PNwcReferral pReferral;
15469 -} NwcNdsResolveNameToId, *PNwcNdsResolveNameToId;
15471 -//++=======================================================================
15472 -// API Name: NwcOrderedRequest
15474 -// Arguments In: uFunction - The NCP function that is being called.
15476 -// uNumRequestFrags - The number of fragments that the
15477 -// request packet has been broken into.
15479 -// pRequestFrags - List of fragments that make up the
15480 -// request packet. Each fragment includes the length
15481 -// of the fragment data and a pointer to the data.
15483 -// uInverseReqCode - The NCP function that will be called
15484 -// if the request fails.
15486 -// uNumInverseFrags - The number of fragments the inverse
15487 -// request packet has been broken into.
15489 -// pReplyFrags - List of fragments that make up the
15490 -// inverse request packet. Each fragment includes the length
15491 -// of the fragment data and a pointer to the data.
15493 -// Returns: STATUS_SUCCESS
15494 -// NWE_ACCESS_VIOLATION
15495 -// NWE_CONN_INVALID
15497 -// Abstract: API for sending raw NCP packets directly to a server.
15501 -// Environment: PASSIVE_LEVEL, LINUX
15503 -//=======================================================================--
15504 +struct nwc_auth_with_id {
15506 + u32 AuthenticationId;
15508 -typedef struct tagNwcOrderedRequest {
15510 - u32 uNumRequestFrags;
15511 - PNwcFrag pRequestFrags;
15512 - u32 uInverseReqCode;
15513 - u32 uNumInverseFrags;
15514 - PNwcFrag pInverseFrags;
15517 -} NwcOrderedRequest, *PNwcOrderedRequest;
15520 -typedef struct tagNwcUnmapDriveEx {
15521 +struct nwc_unmap_drive_ex {
15522 // unsigned long connHdl;
15523 unsigned int linkLen;
15526 -} NwcUnmapDriveEx, *PNwcUnmapDriveEx;
15529 -typedef struct tagNwcMapDriveEx {
15530 - NW_CONN_HANDLE ConnHandle;
15531 +struct nwc_map_drive_ex {
15533 unsigned int localUid;
15534 unsigned int linkOffsetLength;
15535 unsigned int linkOffset;
15536 unsigned int dirPathOffsetLength;
15537 unsigned int dirPathOffset;
15538 -} NwcMapDriveEx, *PNwcMapDriveEx;
15541 -typedef struct tagNwcGetBroadcastNotification {
15542 +struct nwc_get_bcast_notification {
15544 u32 uConnReference;
15547 -} NwcGetBroadcastNotification, *PNwcGetBroadcastNotification;
15551 #endif /* __NWCLNX_H__ */
15552 --- a/fs/novfs/proc.c
15553 +++ b/fs/novfs/proc.c
15554 @@ -20,13 +20,13 @@
15558 -struct proc_dir_entry *Novfs_Procfs_dir;
15559 -static struct proc_dir_entry *Novfs_Control;
15560 -static struct proc_dir_entry *Novfs_Library;
15561 -static struct proc_dir_entry *Novfs_Version;
15562 +struct proc_dir_entry *novfs_procfs_dir;
15563 +struct proc_dir_entry *Novfs_Control;
15564 +struct proc_dir_entry *Novfs_Library;
15565 +struct proc_dir_entry *Novfs_Version;
15567 -static struct file_operations Daemon_proc_fops;
15568 -static struct file_operations Library_proc_fops;
15569 +static struct file_operations novfs_daemon_proc_fops;
15570 +static struct file_operations novfs_lib_proc_fops;
15572 /*===[ Code ]=============================================================*/
15574 @@ -39,17 +39,17 @@ static int Novfs_Get_Version(char *page,
15577 len = sprintf(buf, "Novfs Version=%s\n", NOVFS_VERSION_STRING);
15578 - i = Daemon_getversion(tbuf, sizeof(tbuf));
15579 + i = novfs_daemon_getversion(tbuf, sizeof(tbuf));
15580 if ((i > 0) && i < (count - len)) {
15581 len += sprintf(buf + len, "Novfsd Version=%s\n", tbuf);
15584 - if (Novfs_CurrentMount) {
15585 - i = strlen(Novfs_CurrentMount);
15586 + if (novfs_current_mnt) {
15587 + i = strlen(novfs_current_mnt);
15588 if ((i > 0) && i < (count - len)) {
15590 sprintf(buf + len, "Novfs mount=%s\n",
15591 - Novfs_CurrentMount);
15592 + novfs_current_mnt);
15595 DbgPrint("Novfs_Get_Version:\n%s\n", buf);
15596 @@ -58,39 +58,40 @@ static int Novfs_Get_Version(char *page,
15600 -int Init_Procfs_Interface(void)
15601 +int novfs_proc_init(void)
15605 - Novfs_Procfs_dir = proc_mkdir(MODULE_NAME, NULL);
15606 - if (Novfs_Procfs_dir) {
15607 - Novfs_Procfs_dir->owner = THIS_MODULE;
15608 + novfs_procfs_dir = proc_mkdir(MODULE_NAME, NULL);
15609 + if (novfs_procfs_dir) {
15610 + novfs_procfs_dir->owner = THIS_MODULE;
15612 - Novfs_Control = create_proc_entry("Control", 0600, Novfs_Procfs_dir);
15613 + Novfs_Control = create_proc_entry("Control", 0600, novfs_procfs_dir);
15615 if (Novfs_Control) {
15616 Novfs_Control->owner = THIS_MODULE;
15617 Novfs_Control->size = 0;
15618 - memcpy(&Daemon_proc_fops, Novfs_Control->proc_fops,
15619 - sizeof(struct file_operations));
15620 + memcpy(&novfs_daemon_proc_fops,
15621 + Novfs_Control->proc_fops,
15622 + sizeof(struct file_operations));
15625 * Setup our functions
15627 - Daemon_proc_fops.owner = THIS_MODULE;
15628 - Daemon_proc_fops.open = Daemon_Open_Control;
15629 - Daemon_proc_fops.release = Daemon_Close_Control;
15630 - Daemon_proc_fops.read = Daemon_Send_Command;
15631 - Daemon_proc_fops.write = Daemon_Receive_Reply;
15632 - Daemon_proc_fops.ioctl = Daemon_ioctl;
15633 + novfs_daemon_proc_fops.owner = THIS_MODULE;
15634 + novfs_daemon_proc_fops.open = novfs_daemon_open_control;
15635 + novfs_daemon_proc_fops.release = novfs_daemon_close_control;
15636 + novfs_daemon_proc_fops.read = novfs_daemon_cmd_send;
15637 + novfs_daemon_proc_fops.write = novfs_daemon_recv_reply;
15638 + novfs_daemon_proc_fops.ioctl = novfs_daemon_ioctl;
15640 - Novfs_Control->proc_fops = &Daemon_proc_fops;
15641 + Novfs_Control->proc_fops = &novfs_daemon_proc_fops;
15643 remove_proc_entry(MODULE_NAME, NULL);
15647 - Novfs_Library = create_proc_entry("Library", 0666, Novfs_Procfs_dir);
15648 + Novfs_Library = create_proc_entry("Library", 0666, novfs_procfs_dir);
15649 if (Novfs_Library) {
15650 Novfs_Library->owner = THIS_MODULE;
15651 Novfs_Library->size = 0;
15652 @@ -98,31 +99,31 @@ int Init_Procfs_Interface(void)
15654 * Setup our file functions
15656 - memcpy(&Library_proc_fops, Novfs_Library->proc_fops,
15657 + memcpy(&novfs_lib_proc_fops, Novfs_Library->proc_fops,
15658 sizeof(struct file_operations));
15659 - Library_proc_fops.owner = THIS_MODULE;
15660 - Library_proc_fops.open = Daemon_Library_open;
15661 - Library_proc_fops.release = Daemon_Library_close;
15662 - Library_proc_fops.read = Daemon_Library_read;
15663 - Library_proc_fops.write = Daemon_Library_write;
15664 - Library_proc_fops.llseek = Daemon_Library_llseek;
15665 - Library_proc_fops.ioctl = Daemon_Library_ioctl;
15666 - Novfs_Library->proc_fops = &Library_proc_fops;
15667 + novfs_lib_proc_fops.owner = THIS_MODULE;
15668 + novfs_lib_proc_fops.open = novfs_daemon_lib_open;
15669 + novfs_lib_proc_fops.release = novfs_daemon_lib_close;
15670 + novfs_lib_proc_fops.read = novfs_daemon_lib_read;
15671 + novfs_lib_proc_fops.write = novfs_daemon_lib_write;
15672 + novfs_lib_proc_fops.llseek = novfs_daemon_lib_llseek;
15673 + novfs_lib_proc_fops.ioctl = novfs_daemon_lib_ioctl;
15674 + Novfs_Library->proc_fops = &novfs_lib_proc_fops;
15676 - remove_proc_entry("Control", Novfs_Procfs_dir);
15677 + remove_proc_entry("Control", novfs_procfs_dir);
15678 remove_proc_entry(MODULE_NAME, NULL);
15683 - create_proc_read_entry("Version", 0444, Novfs_Procfs_dir,
15684 + create_proc_read_entry("Version", 0444, novfs_procfs_dir,
15685 Novfs_Get_Version, NULL);
15686 if (Novfs_Version) {
15687 Novfs_Version->owner = THIS_MODULE;
15688 Novfs_Version->size = 0;
15690 - remove_proc_entry("Library", Novfs_Procfs_dir);
15691 - remove_proc_entry("Control", Novfs_Procfs_dir);
15692 + remove_proc_entry("Library", novfs_procfs_dir);
15693 + remove_proc_entry("Control", novfs_procfs_dir);
15694 remove_proc_entry(MODULE_NAME, NULL);
15697 @@ -132,17 +133,17 @@ int Init_Procfs_Interface(void)
15701 -void Uninit_Procfs_Interface(void)
15702 +void novfs_proc_exit(void)
15705 DbgPrint("Uninit_Procfs_Interface remove_proc_entry(Version, NULL)\n");
15706 - remove_proc_entry("Version", Novfs_Procfs_dir);
15707 + remove_proc_entry("Version", novfs_procfs_dir);
15709 DbgPrint("Uninit_Procfs_Interface remove_proc_entry(Control, NULL)\n");
15710 - remove_proc_entry("Control", Novfs_Procfs_dir);
15711 + remove_proc_entry("Control", novfs_procfs_dir);
15713 DbgPrint("Uninit_Procfs_Interface remove_proc_entry(Library, NULL)\n");
15714 - remove_proc_entry("Library", Novfs_Procfs_dir);
15715 + remove_proc_entry("Library", novfs_procfs_dir);
15717 DbgPrint("Uninit_Procfs_Interface remove_proc_entry(%s, NULL)\n",
15719 --- a/fs/novfs/profile.c
15720 +++ b/fs/novfs/profile.c
15721 @@ -17,11 +17,12 @@
15722 #include <linux/init.h>
15723 #include <linux/proc_fs.h>
15724 #include <linux/sched.h>
15725 +#include <asm/uaccess.h>
15726 #include <linux/vmalloc.h>
15727 #include <linux/time.h>
15729 #include <linux/profile.h>
15730 #include <linux/notifier.h>
15731 -#include <asm/uaccess.h>
15735 @@ -41,10 +42,10 @@ struct local_rtc_time {
15739 -static char *DbgPrintBuffer = NULL;
15740 -static char DbgPrintOn = 0;
15741 -static char DbgSyslogOn = 0;
15742 -static char DbgProfileOn = 0;
15743 +char *DbgPrintBuffer = NULL;
15744 +char DbgPrintOn = 0;
15745 +char DbgSyslogOn = 0;
15746 +char DbgProfileOn = 0;
15748 static unsigned long DbgPrintBufferOffset = 0;
15749 static unsigned long DbgPrintBufferReadOffset = 0;
15750 @@ -64,23 +65,22 @@ static DECLARE_MUTEX(LocalPrint_lock);
15751 static ssize_t User_proc_write_DbgBuffer(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos)
15753 ssize_t retval = nbytes;
15754 - unsigned char *lbuf;
15755 - unsigned char *p;
15756 + u_char *lbuf, *p;
15760 lbuf = kmalloc(nbytes + 1, GFP_KERNEL);
15762 - if (copy_from_user(lbuf, buf, nbytes))
15764 + cpylen = copy_from_user(lbuf, buf, nbytes);
15767 DbgPrint("User_proc_write_DbgBuffer: %s\n", lbuf);
15769 - for (i = 0; lbuf[i] && lbuf[i] != '\n'; i++)
15771 + for (i = 0; lbuf[i] && lbuf[i] != '\n'; i++) ;
15773 - if ('\n' == lbuf[i])
15774 + if ('\n' == lbuf[i]) {
15778 if (!strcmp("on", lbuf)) {
15779 DbgPrintBufferOffset = DbgPrintBufferReadOffset = 0;
15780 @@ -99,15 +99,15 @@ static ssize_t User_proc_write_DbgBuffer
15783 } else if (!strcmp("novfsd", lbuf)) {
15784 - Daemon_SendDebugCmd(p);
15785 + novfs_daemon_debug_cmd_send(p);
15786 } else if (!strcmp("file_update_timeout", lbuf)) {
15787 - File_update_timeout =
15788 + novfs_update_timeout =
15789 simple_strtoul(p, NULL, 0);
15790 } else if (!strcmp("cache", lbuf)) {
15791 if (!strcmp("on", p)) {
15793 + novfs_page_cache = 1;
15794 } else if (!strcmp("off", p)) {
15796 + novfs_page_cache = 0;
15798 } else if (!strcmp("profile", lbuf)) {
15799 if (!strcmp("on", p)) {
15800 @@ -123,7 +123,7 @@ static ssize_t User_proc_write_DbgBuffer
15804 -static ssize_t User_proc_read_DbgBuffer(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
15805 +static ssize_t User_proc_read_DbgBuffer(struct file *file, char *buf, size_t nbytes, loff_t * ppos)
15807 ssize_t retval = 0;
15809 @@ -273,7 +273,7 @@ static void doline(unsigned char *b, uns
15813 -void mydump(int size, void *dumpptr)
15814 +void novfs_dump(int size, void *dumpptr)
15816 unsigned char *ptr = (unsigned char *)dumpptr;
15817 unsigned char *line = NULL, buf[100], *bptr = buf;
15818 @@ -314,7 +314,7 @@ static int month_days[12] = {
15820 * This only works for the Gregorian calendar - i.e. after 1752 (in the UK)
15822 -static void Novfs_GregorianDay(struct local_rtc_time *tm)
15823 +static void GregorianDay(struct local_rtc_time *tm)
15827 @@ -384,14 +384,17 @@ static void private_to_tm(int tim, struc
15829 * Determine the day of week
15831 - Novfs_GregorianDay(tm);
15832 + GregorianDay(tm);
15835 char *ctime_r(time_t * clock, char *buf)
15837 struct local_rtc_time tm;
15838 - static char *DAYOFWEEK[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
15839 - static char *MONTHOFYEAR[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
15840 + static char *DAYOFWEEK[] =
15841 + { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
15842 + static char *MONTHOFYEAR[] =
15843 + { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
15844 +"Oct", "Nov", "Dec" };
15846 private_to_tm(*clock, &tm);
15848 @@ -401,7 +404,7 @@ char *ctime_r(time_t * clock, char *buf)
15852 -static void profile_dump_dt(struct dentry *parent, void *pf)
15853 +static void dump(struct dentry *parent, void *pf)
15855 void (*pfunc) (char *Fmt, ...) = pf;
15857 @@ -413,9 +416,11 @@ static void profile_dump_dt(struct dentr
15858 char *buf, *path, *sd;
15859 char inode_number[16];
15861 - buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
15863 + buf = (char *)kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
15865 + if (NULL == buf) {
15870 pfunc("starting 0x%p %.*s\n", parent, parent->d_name.len,
15871 @@ -432,20 +437,25 @@ static void profile_dump_dt(struct dentr
15872 p = l->dentry->d_subdirs.next;
15873 while (p != &l->dentry->d_subdirs) {
15874 d = list_entry(p, struct dentry,
15879 - if (d->d_subdirs.next != &d->d_subdirs) {
15880 - n = kmalloc(sizeof(*n), GFP_KERNEL);
15881 + if (d->d_subdirs.next !=
15883 + n = kmalloc(sizeof
15887 - n->next = l->next;
15894 - path = Scope_dget_path(d, buf, PATH_LENGTH_BUFFER, 1);
15895 + path = novfs_scope_dget_path(d, buf, PATH_LENGTH_BUFFER, 1);
15897 - pfunc("1-0x%p %s\n"
15901 " d_parent: 0x%p\n"
15903 @@ -453,14 +463,21 @@ static void profile_dump_dt(struct dentr
15904 " d_subdirs: 0x%p\n"
15905 " d_inode: 0x%p\n",
15910 - atomic_read(&d->d_count),
15931 @@ -469,11 +486,16 @@ static void profile_dump_dt(struct dentr
15935 - path = Scope_dget_path(d, buf, PATH_LENGTH_BUFFER, 1);
15937 + novfs_scope_dget_path(d, buf,
15938 + PATH_LENGTH_BUFFER,
15942 - if (&d->d_subdirs != d->d_subdirs.next)
15943 + if (&d->d_subdirs !=
15944 + d->d_subdirs.next) {
15947 inode_number[0] = '\0';
15949 sprintf(inode_number,
15950 @@ -506,7 +528,7 @@ static void profile_dump_dt(struct dentr
15954 -static ssize_t profile_common_read(char __user *buf, size_t len, loff_t *off)
15955 +static ssize_t common_read(char *buf, size_t len, loff_t * off)
15957 ssize_t retval = 0;
15959 @@ -530,7 +552,8 @@ static ssize_t profile_common_read(char
15963 -static ssize_t profile_inode_read(struct file * file, char __user *buf, size_t len, loff_t *off)
15964 +static ssize_t novfs_profile_read_inode(struct file * file, char *buf, size_t len,
15967 ssize_t retval = 0;
15968 unsigned long offset = *off;
15969 @@ -542,10 +565,11 @@ static ssize_t profile_inode_read(struct
15972 DbgPrintBufferOffset = DbgPrintBufferReadOffset = 0;
15973 - Novfs_dump_inode(LocalPrint);
15974 + novfs_dump_inode(LocalPrint);
15977 - retval = profile_common_read(buf, len, off);
15979 + retval = common_read(buf, len, off);
15982 DbgPrintOn = save_DbgPrintOn;
15983 @@ -558,7 +582,8 @@ static ssize_t profile_inode_read(struct
15987 -static ssize_t profile_dentry_read(struct file *file, char __user *buf, size_t len, loff_t * off)
15988 +static ssize_t novfs_profile_dentry_read(struct file * file, char *buf, size_t len,
15991 ssize_t retval = 0;
15992 unsigned long offset = *off;
15993 @@ -569,10 +594,10 @@ static ssize_t profile_dentry_read(struc
15994 save_DbgPrintOn = DbgPrintOn;
15996 DbgPrintBufferOffset = DbgPrintBufferReadOffset = 0;
15997 - profile_dump_dt(Novfs_root, LocalPrint);
15998 + dump(novfs_root, LocalPrint);
16001 - retval = profile_common_read(buf, len, off);
16002 + retval = common_read(buf, len, off);
16005 DbgPrintBufferOffset = DbgPrintBufferReadOffset = 0;
16006 @@ -585,7 +610,7 @@ static ssize_t profile_dentry_read(struc
16010 -uint64_t get_nanosecond_time(void)
16011 +uint64_t get_nanosecond_time()
16013 struct timespec ts;
16015 @@ -599,15 +624,12 @@ uint64_t get_nanosecond_time(void)
16019 -int init_profile(void)
16020 +void novfs_profile_init()
16024 - if (Novfs_Procfs_dir) {
16025 - dbg_dir = Novfs_Procfs_dir;
16027 + if (novfs_procfs_dir)
16028 + dbg_dir = novfs_procfs_dir;
16030 dbg_dir = proc_mkdir(MODULE_NAME, NULL);
16034 dbg_dir->owner = THIS_MODULE;
16035 @@ -620,8 +642,10 @@ int init_profile(void)
16036 dbg_file->size = DBGBUFFERSIZE;
16037 memcpy(&Dbg_proc_file_operations, dbg_file->proc_fops,
16038 sizeof(struct file_operations));
16039 - Dbg_proc_file_operations.read = User_proc_read_DbgBuffer;
16040 - Dbg_proc_file_operations.write = User_proc_write_DbgBuffer;
16041 + Dbg_proc_file_operations.read =
16042 + User_proc_read_DbgBuffer;
16043 + Dbg_proc_file_operations.write =
16044 + User_proc_write_DbgBuffer;
16045 dbg_file->proc_fops = &Dbg_proc_file_operations;
16047 remove_proc_entry(MODULE_NAME, NULL);
16048 @@ -640,7 +664,8 @@ int init_profile(void)
16049 inode_file->proc_fops,
16050 sizeof(struct file_operations));
16051 inode_proc_file_ops.owner = THIS_MODULE;
16052 - inode_proc_file_ops.read = profile_inode_read;
16053 + inode_proc_file_ops.read =
16054 + novfs_profile_read_inode;
16055 inode_file->proc_fops = &inode_proc_file_ops;
16058 @@ -653,32 +678,30 @@ int init_profile(void)
16059 dentry_file->proc_fops,
16060 sizeof(struct file_operations));
16061 dentry_proc_file_ops.owner = THIS_MODULE;
16062 - dentry_proc_file_ops.read = profile_dentry_read;
16063 + dentry_proc_file_ops.read = novfs_profile_dentry_read;
16064 dentry_file->proc_fops = &dentry_proc_file_ops;
16068 vfree(DbgPrintBuffer);
16069 DbgPrintBuffer = NULL;
16072 - return (retCode);
16075 -void uninit_profile(void)
16076 +void novfs_profile_exit(void)
16079 - DbgPrint("Calling remove_proc_entry(Debug, NULL)\n");
16080 - remove_proc_entry("Debug", dbg_dir);
16082 - if (inode_file) {
16083 - DbgPrint("Calling remove_proc_entry(inode, NULL)\n");
16084 - remove_proc_entry("inode", dbg_dir);
16086 - if (dentry_file) {
16087 - DbgPrint("Calling remove_proc_entry(dentry, NULL)\n");
16088 - remove_proc_entry("dentry", dbg_dir);
16090 - if (dbg_dir && (dbg_dir != Novfs_Procfs_dir)) {
16092 + DbgPrint("Calling remove_proc_entry(Debug, NULL)\n"),
16093 + remove_proc_entry("Debug", dbg_dir);
16095 + DbgPrint("Calling remove_proc_entry(inode, NULL)\n"),
16096 + remove_proc_entry("inode", dbg_dir);
16098 + DbgPrint("Calling remove_proc_entry(dentry, NULL)\n"),
16099 + remove_proc_entry("dentry", dbg_dir);
16101 + if (dbg_dir && (dbg_dir != novfs_procfs_dir)) {
16102 DbgPrint("Calling remove_proc_entry(%s, NULL)\n", MODULE_NAME);
16103 remove_proc_entry(MODULE_NAME, NULL);
16105 --- a/fs/novfs/scope.c
16106 +++ b/fs/novfs/scope.c
16107 @@ -33,55 +33,40 @@
16108 #define CLEANUP_INTERVAL 10
16109 #define MAX_USERNAME_LENGTH 32
16111 -struct scope_list {
16112 - struct list_head entry;
16113 - struct schandle ScopeId;
16114 - struct schandle SessionId;
16116 - struct task_struct *ScopeTask;
16117 - unsigned int ScopeHash;
16121 - u64 ScopeUTEnties;
16122 - u64 ScopeUAEnties;
16123 - int ScopeUserNameLength;
16124 - unsigned char ScopeUserName[MAX_USERNAME_LENGTH];
16127 static struct list_head Scope_List;
16128 static struct semaphore Scope_Lock;
16129 static struct semaphore Scope_Thread_Delay;
16130 -static int Scope_Thread_Terminate;
16131 +static int Scope_Thread_Terminate = 0;
16132 static struct timer_list Scope_Timer;
16133 static unsigned int Scope_Hash_Val = 1;
16135 -static struct scope_list *Scope_Search4Scope(struct schandle *Id, bool Session,
16137 +static struct novfs_scope_list *Scope_Search4Scope(struct novfs_schandle Id,
16138 + int Session, int Locked)
16140 - struct scope_list *scope;
16141 - struct scope_list *rscope = NULL;
16142 - struct schandle *cur_scope;
16143 + struct novfs_scope_list *scope, *rscope = NULL;
16144 + struct novfs_schandle cur_scope;
16145 struct list_head *sl;
16148 - DbgPrint("Scope_Search4Scope: 0x%p:%p 0x%x 0x%x\n",
16149 - Id->hTypeId, Id->hId, Session, Locked);
16150 + DbgPrint("Scope_Search4Scope: 0x%p:%p 0x%x 0x%x\n", Id.hTypeId, Id.hId,
16151 + Session, Locked);
16154 - offset = offsetof(struct scope_list, SessionId);
16155 + offset = offsetof(struct novfs_scope_list, SessionId);
16157 - offset = offsetof(struct scope_list, ScopeId);
16158 + offset = offsetof(struct novfs_scope_list, ScopeId);
16165 sl = Scope_List.next;
16166 DbgPrint("Scope_Search4Scope: 0x%p\n", sl);
16167 while (sl != &Scope_List) {
16168 - scope = list_entry(sl, struct scope_list, entry);
16169 + scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16171 - cur_scope = (session_t *) ((char *)scope + offset);
16172 + cur_scope = *(struct novfs_schandle *) ((char *)scope + offset);
16173 if (SC_EQUAL(Id, cur_scope)) {
16176 @@ -90,19 +75,19 @@ static struct scope_list *Scope_Search4S
16185 DbgPrint("Scope_Search4Scope: return 0x%p\n", rscope);
16190 -static struct scope_list *Scope_Find_Scope(bool Create)
16191 +static struct novfs_scope_list *Scope_Find_Scope(int Create)
16193 - struct scope_list *scope = NULL;
16194 - struct scope_list *pscope = NULL;
16195 + struct novfs_scope_list *scope = NULL, *pscope = NULL;
16196 struct task_struct *task;
16197 - struct schandle scopeId;
16198 + struct novfs_schandle scopeId;
16202 @@ -110,84 +95,94 @@ static struct scope_list *Scope_Find_Sco
16203 DbgPrint("Scope_Find_Scope: %d %d %d %d\n", task->uid, task->euid,
16204 task->suid, task->fsuid);
16206 - /* scopeId = task->euid; */
16207 + //scopeId = task->euid;
16208 UID_TO_SCHANDLE(scopeId, task->euid);
16210 - scope = Scope_Search4Scope(&scopeId, 0, 0);
16211 - if (scope || (!Create))
16213 + scope = Scope_Search4Scope(scopeId, 0, 0);
16215 - scope = kmalloc(sizeof(*pscope), GFP_KERNEL);
16218 - scope->ScopeId = scopeId;
16219 - SC_INITIALIZE(scope->SessionId);
16220 - scope->ScopePid = task->pid;
16221 - scope->ScopeTask = task;
16222 - scope->ScopeHash = 0;
16223 - scope->ScopeUid = task->euid;
16224 - scope->ScopeUserName[0] = '\0';
16226 - if (!Daemon_CreateSessionId(&scope->SessionId)) {
16227 - DbgPrint("Scope_Find_Scope2: %d %d %d %d\n", task->uid,
16228 - task->euid, task->suid, task->fsuid);
16229 - memset(scope->ScopeUserName, 0, sizeof(scope->ScopeUserName));
16230 - scope->ScopeUserNameLength = 0;
16231 - Daemon_getpwuid(task->euid, sizeof(scope->ScopeUserName),
16232 - scope->ScopeUserName);
16233 - scope->ScopeUserNameLength = strlen(scope->ScopeUserName);
16237 - scope->ScopeHash = Scope_Hash_Val++;
16238 - DbgPrint("Scope_Find_Scope: Adding 0x%p\n"
16239 - " ScopeId: 0x%p:%p\n"
16240 - " SessionId: 0x%p:%p\n"
16241 - " ScopePid: %d\n"
16242 - " ScopeTask: 0x%p\n"
16243 - " ScopeHash: %u\n"
16244 - " ScopeUid: %u\n"
16245 - " ScopeUserNameLength: %u\n"
16246 - " ScopeUserName: %s\n",
16248 - scope->ScopeId.hTypeId, scope->ScopeId.hId,
16249 - scope->SessionId.hTypeId, scope->SessionId.hId,
16251 - scope->ScopeTask,
16252 - scope->ScopeHash,
16254 - scope->ScopeUserNameLength,
16255 - scope->ScopeUserName);
16256 + if (!scope && Create) {
16257 + scope = kmalloc(sizeof(*pscope), GFP_KERNEL);
16259 + scope->ScopeId = scopeId;
16260 + SC_INITIALIZE(scope->SessionId);
16261 + scope->ScopePid = task->pid;
16262 + scope->ScopeTask = task;
16263 + scope->ScopeHash = 0;
16264 + scope->ScopeUid = task->euid;
16265 + scope->ScopeUserName[0] = '\0';
16267 + if (!novfs_daemon_create_sessionId(&scope->SessionId)) {
16268 + DbgPrint("Scope_Find_Scope2: %d %d %d %d\n",
16269 + task->uid, task->euid, task->suid,
16271 + memset(scope->ScopeUserName, 0,
16272 + sizeof(scope->ScopeUserName));
16273 + scope->ScopeUserNameLength = 0;
16274 + novfs_daemon_getpwuid(task->euid,
16275 + sizeof(scope->ScopeUserName),
16276 + scope->ScopeUserName);
16277 + scope->ScopeUserNameLength =
16278 + strlen(scope->ScopeUserName);
16282 - if (SC_PRESENT(scope->SessionId)) {
16283 - down(&Scope_Lock);
16284 - pscope = Scope_Search4Scope(&scopeId, 0, 1);
16286 - list_add(&scope->entry, &Scope_List);
16288 + scope->ScopeHash = Scope_Hash_Val++;
16289 + DbgPrint("Scope_Find_Scope: Adding 0x%p\n"
16290 + " ScopeId: 0x%p:%p\n"
16291 + " SessionId: 0x%p:%p\n"
16292 + " ScopePid: %d\n"
16293 + " ScopeTask: 0x%p\n"
16294 + " ScopeHash: %u\n"
16295 + " ScopeUid: %u\n"
16296 + " ScopeUserNameLength: %u\n"
16297 + " ScopeUserName: %s\n",
16299 + scope->ScopeId.hTypeId, scope->ScopeId.hId,
16300 + scope->SessionId.hTypeId, scope->SessionId.hId,
16302 + scope->ScopeTask,
16303 + scope->ScopeHash,
16305 + scope->ScopeUserNameLength,
16306 + scope->ScopeUserName);
16308 + if (SC_PRESENT(scope->SessionId)) {
16309 + down(&Scope_Lock);
16311 + Scope_Search4Scope(scopeId, 0, 1);
16314 + list_add(&scope->ScopeList,
16320 - printk(KERN_ERR "Scope_Find_Scope scope not added "
16321 - "because it was already there...\n");
16322 - Daemon_DestroySessionId(&scope->SessionId);
16328 + ("<6>Scope_Find_Scope scope not added because it was already there...\n");
16329 + novfs_daemon_destroy_sessionId(scope->
16346 - Novfs_Add_to_Root(scope->ScopeUserName);
16348 + novfs_add_to_root(scope->ScopeUserName);
16356 -static int Scope_Validate_Scope(struct scope_list *Scope)
16357 +static int Scope_Validate_Scope(struct novfs_scope_list *Scope)
16359 - struct scope_list *s;
16360 + struct novfs_scope_list *s;
16361 struct list_head *sl;
16364 @@ -197,7 +192,7 @@ static int Scope_Validate_Scope(struct s
16366 sl = Scope_List.next;
16367 while (sl != &Scope_List) {
16368 - s = list_entry(sl, struct scope_list, entry);
16369 + s = list_entry(sl, struct novfs_scope_list, ScopeList);
16373 @@ -209,28 +204,24 @@ static int Scope_Validate_Scope(struct s
16381 -/* FIXME void stuff */
16382 -uid_t Scope_Get_Uid(void *foo)
16383 +uid_t novfs_scope_get_uid(struct novfs_scope_list *scope)
16385 - struct scope_list *scope = foo;
16389 scope = Scope_Find_Scope(1);
16391 if (scope && Scope_Validate_Scope(scope))
16392 uid = scope->ScopeUid;
16397 -char *Scope_Get_UserName(void)
16398 +char *novfs_scope_get_username(void)
16401 - struct scope_list *Scope;
16402 + struct novfs_scope_list *Scope;
16404 Scope = Scope_Find_Scope(1);
16406 @@ -240,12 +231,10 @@ char *Scope_Get_UserName(void)
16410 -/* FIXME the void * needs to get fixed... */
16411 -session_t Scope_Get_SessionId(void *foo)
16412 +struct novfs_schandle novfs_scope_get_sessionId(struct novfs_scope_list
16415 - session_t sessionId;
16416 - struct scope_list *Scope = foo;
16418 + struct novfs_schandle sessionId;
16419 DbgPrint("Scope_Get_SessionId: 0x%p\n", Scope);
16420 SC_INITIALIZE(sessionId);
16422 @@ -253,43 +242,43 @@ session_t Scope_Get_SessionId(void *foo)
16424 if (Scope && Scope_Validate_Scope(Scope))
16425 sessionId = Scope->SessionId;
16427 DbgPrint("Scope_Get_SessionId: return 0x%p:%p\n", sessionId.hTypeId,
16429 - return sessionId;
16430 + return (sessionId);
16433 -struct scope_list *Scope_Get_ScopefromName(struct qstr *name)
16434 +struct novfs_scope_list *novfs_get_scope_from_name(struct qstr * Name)
16436 - struct scope_list *scope;
16437 - struct scope_list *rscope = NULL;
16438 + struct novfs_scope_list *scope, *rscope = NULL;
16439 struct list_head *sl;
16441 - DbgPrint("Scope_Get_ScopefromName: %.*s\n", name->len, name->name);
16442 + DbgPrint("Scope_Get_ScopefromName: %.*s\n", Name->len, Name->name);
16446 sl = Scope_List.next;
16447 while (sl != &Scope_List) {
16448 - scope = list_entry(sl, struct scope_list, entry);
16449 + scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16451 - if ((name->len == scope->ScopeUserNameLength) &&
16452 - (strncmp(scope->ScopeUserName, name->name, name->len) == 0)) {
16453 + if ((Name->len == scope->ScopeUserNameLength) &&
16454 + (0 == strncmp(scope->ScopeUserName, Name->name, Name->len)))
16469 -int Scope_Set_UserSpace(u64 *TotalSize, u64 *Free,
16470 - u64 *TotalEnties, u64 *FreeEnties)
16471 +int novfs_scope_set_userspace(uint64_t * TotalSize, uint64_t * Free,
16472 + uint64_t * TotalEnties, uint64_t * FreeEnties)
16474 - struct scope_list *scope;
16475 + struct novfs_scope_list *scope;
16478 scope = Scope_Find_Scope(1);
16479 @@ -305,24 +294,24 @@ int Scope_Set_UserSpace(u64 *TotalSize,
16480 scope->ScopeUAEnties = *FreeEnties;
16487 -int Scope_Get_UserSpace(u64 *TotalSize, u64 *Free,
16488 - u64 *TotalEnties, u64 *FreeEnties)
16489 +int novfs_scope_get_userspace(uint64_t * TotalSize, uint64_t * Free,
16490 + uint64_t * TotalEnties, uint64_t * FreeEnties)
16492 - struct scope_list *scope;
16493 + struct novfs_scope_list *scope;
16496 - u64 td, fd, te, fe;
16497 + uint64_t td, fd, te, fe;
16499 scope = Scope_Find_Scope(1);
16501 td = fd = te = fe = 0;
16504 - retVal = Daemon_Get_UserSpace(&scope->SessionId,
16505 - &td, &fd, &te, &fe);
16507 + novfs_daemon_get_userspace(scope->SessionId, &td, &fd, &te, &fe);
16509 scope->ScopeUSize = td;
16510 scope->ScopeUFree = fd;
16511 @@ -339,18 +328,18 @@ int Scope_Get_UserSpace(u64 *TotalSize,
16519 -struct scope_list *Scope_Get_ScopefromPath(struct dentry *dentry)
16520 +struct novfs_scope_list *novfs_get_scope(struct dentry * Dentry)
16522 - struct scope_list *scope = NULL;
16523 + struct novfs_scope_list *scope = NULL;
16524 char *buf, *path, *cp;
16527 - buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
16528 + buf = (char *)kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
16530 - path = Scope_dget_path(dentry, buf, PATH_LENGTH_BUFFER, 0);
16531 + path = novfs_scope_dget_path(Dentry, buf, PATH_LENGTH_BUFFER, 0);
16533 DbgPrint("Scope_Get_ScopefromPath: %s\n", path);
16535 @@ -366,29 +355,30 @@ struct scope_list *Scope_Get_ScopefromPa
16537 name.len = (int)(cp - path);
16539 - scope = Scope_Get_ScopefromName(&name);
16540 + scope = novfs_get_scope_from_name(&name);
16550 -static char *add_to_list(char *name, char *list, char *endoflist)
16551 +static char *add_to_list(char *Name, char *List, char *EndOfList)
16553 - while (*name && (list < endoflist))
16554 - *list++ = *name++;
16556 - if (list < endoflist)
16558 + while (*Name && (List < EndOfList)) {
16559 + *List++ = *Name++;
16563 + if (List < EndOfList) {
16569 -char *Scope_Get_ScopeUsers(void)
16570 +char *novfs_get_scopeusers(void)
16572 - struct scope_list *scope;
16573 + struct novfs_scope_list *scope;
16574 struct list_head *sl;
16575 int asize = 8 * MAX_USERNAME_LENGTH;
16576 char *list, *cp, *ep;
16577 @@ -413,7 +403,7 @@ char *Scope_Get_ScopeUsers(void)
16579 sl = Scope_List.next;
16580 while ((sl != &Scope_List) && (cp < ep)) {
16581 - scope = list_entry(sl, struct scope_list, entry);
16582 + scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16584 DbgPrint("Scope_Get_ScopeUsers found 0x%p %s\n",
16585 scope, scope->ScopeUserName);
16586 @@ -429,6 +419,7 @@ char *Scope_Get_ScopeUsers(void)
16589 } else { /* Allocation was to small, up size */
16594 @@ -437,12 +428,12 @@ char *Scope_Get_ScopeUsers(void)
16598 - } while (!list); /* list was to small try again */
16599 + } while (!list); /* List was to small try again */
16605 -void *Scope_Lookup(void)
16606 +void *novfs_scope_lookup(void)
16608 return Scope_Find_Scope(1);
16610 @@ -454,8 +445,7 @@ static void Scope_Timer_Function(unsigne
16612 static int Scope_Cleanup_Thread(void *Args)
16614 - struct scope_list *scope;
16615 - struct scope_list *rscope;
16616 + struct novfs_scope_list *scope, *rscope;
16617 struct list_head *sl, cleanup;
16618 struct task_struct *task;
16620 @@ -468,8 +458,9 @@ static int Scope_Cleanup_Thread(void *Ar
16622 while (0 == Scope_Thread_Terminate) {
16623 DbgPrint("Scope_Cleanup_Thread: looping\n");
16624 - if (Scope_Thread_Terminate)
16625 + if (Scope_Thread_Terminate) {
16630 * Check scope list for any terminated processes
16631 @@ -480,7 +471,7 @@ static int Scope_Cleanup_Thread(void *Ar
16632 INIT_LIST_HEAD(&cleanup);
16634 while (sl != &Scope_List) {
16635 - scope = list_entry(sl, struct scope_list, entry);
16636 + scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16640 @@ -495,7 +486,7 @@ static int Scope_Cleanup_Thread(void *Ar
16644 - list_move(&scope->entry, &cleanup);
16645 + list_move(&scope->ScopeList, &cleanup);
16646 DbgPrint("Scope_Cleanup_Thread: Scope=0x%p\n",
16649 @@ -505,7 +496,7 @@ static int Scope_Cleanup_Thread(void *Ar
16652 while (sl != &cleanup) {
16653 - scope = list_entry(sl, struct scope_list, entry);
16654 + scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16657 DbgPrint("Scope_Cleanup_Thread: Removing 0x%p\n"
16658 @@ -523,9 +514,9 @@ static int Scope_Cleanup_Thread(void *Ar
16661 scope->ScopeUid, scope->ScopeUserName);
16662 - if (!Scope_Search4Scope(&scope->SessionId, 1, 0)) {
16663 - Novfs_Remove_from_Root(scope->ScopeUserName);
16664 - Daemon_DestroySessionId(&scope->SessionId);
16665 + if (!Scope_Search4Scope(scope->SessionId, 1, 0)) {
16666 + novfs_remove_from_root(scope->ScopeUserName);
16667 + novfs_daemon_destroy_sessionId(scope->SessionId);
16671 @@ -536,21 +527,21 @@ static int Scope_Cleanup_Thread(void *Ar
16672 add_timer(&Scope_Timer);
16673 DbgPrint("Scope_Cleanup_Thread: sleeping\n");
16675 - if (down_interruptible(&Scope_Thread_Delay))
16676 + if (down_interruptible(&Scope_Thread_Delay)) {
16680 del_timer(&Scope_Timer);
16682 Scope_Thread_Terminate = 0;
16684 printk(KERN_INFO "Scope_Cleanup_Thread: Exit\n");
16685 DbgPrint("Scope_Cleanup_Thread: Exit\n");
16690 -void Scope_Cleanup(void)
16691 +void novfs_scope_cleanup(void)
16693 - struct scope_list *scope;
16694 + struct novfs_scope_list *scope;
16695 struct list_head *sl;
16697 DbgPrint("Scope_Cleanup:\n");
16698 @@ -563,10 +554,10 @@ void Scope_Cleanup(void)
16699 sl = Scope_List.next;
16701 while (sl != &Scope_List) {
16702 - scope = list_entry(sl, struct scope_list, entry);
16703 + scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16706 - list_del(&scope->entry);
16707 + list_del(&scope->ScopeList);
16709 DbgPrint("Scope_Cleanup: Removing 0x%p\n"
16710 " ScopeId: 0x%p:%p\n"
16711 @@ -583,9 +574,9 @@ void Scope_Cleanup(void)
16714 scope->ScopeUid, scope->ScopeUserName);
16715 - if (!Scope_Search4Scope(&scope->SessionId, 1, 1)) {
16716 - Novfs_Remove_from_Root(scope->ScopeUserName);
16717 - Daemon_DestroySessionId(&scope->SessionId);
16718 + if (!Scope_Search4Scope(scope->SessionId, 1, 1)) {
16719 + novfs_remove_from_root(scope->ScopeUserName);
16720 + novfs_daemon_destroy_sessionId(scope->SessionId);
16724 @@ -595,19 +586,13 @@ void Scope_Cleanup(void)
16728 - * Arguments: struct dentry *dentry - starting entry
16729 - * char *Buf - pointer to memory buffer
16730 - * unsigned int Buflen - size of memory buffer
16732 - * Returns: pointer to path.
16734 - * Abstract: Walks the dentry chain building a path.
16735 + * Walks the dentry chain building a path.
16737 -char *Scope_dget_path(struct dentry *dentry, char *Buf, unsigned int Buflen,
16738 +char *novfs_scope_dget_path(struct dentry *Dentry, char *Buf, unsigned int Buflen,
16741 char *retval = &Buf[Buflen];
16742 - struct dentry *p = dentry;
16743 + struct dentry *p = Dentry;
16746 *(--retval) = '\0';
16747 @@ -627,8 +612,9 @@ char *Scope_dget_path(struct dentry *den
16749 } while (!IS_ROOT(p));
16751 - if (IS_ROOT(dentry))
16752 + if (IS_ROOT(Dentry)) {
16757 len = strlen(p->d_sb->s_type->name);
16758 @@ -641,19 +627,18 @@ char *Scope_dget_path(struct dentry *den
16766 -void Scope_Init(void)
16767 +void novfs_scope_init(void)
16769 INIT_LIST_HEAD(&Scope_List);
16770 init_MUTEX(&Scope_Lock);
16771 init_MUTEX_LOCKED(&Scope_Thread_Delay);
16773 kthread_run(Scope_Cleanup_Thread, NULL, "novfs_ST");
16776 -void Scope_Uninit(void)
16777 +void novfs_scope_exit(void)
16779 unsigned long expires = jiffies + HZ * SHUTDOWN_INTERVAL;
16781 @@ -666,7 +651,6 @@ void Scope_Uninit(void)
16783 while (Scope_Thread_Terminate && (jiffies < expires))
16786 /* down(&Scope_Thread_Delay); */
16787 printk(KERN_INFO "Scope_Uninit: Exit\n");
16789 --- a/fs/novfs/vfs.h
16790 +++ b/fs/novfs/vfs.h
16791 @@ -20,37 +20,31 @@
16793 #include <linux/version.h>
16794 #include <linux/namei.h>
16795 -#include <linux/string.h>
16797 #include "nwcapi.h"
16799 -typedef void *HANDLE;
16806 -static inline void copy_schandle(struct schandle *dest, struct schandle *source)
16808 - memcpy(dest, source, sizeof(struct schandle));
16810 -#define copy_session_id copy_schandle
16811 +#ifndef XTIER_SCHANDLE
16812 +struct novfs_schandle {
16816 -typedef struct schandle session_t;
16819 #include "commands.h"
16821 #define SC_PRESENT(X) ((X.hTypeId != NULL) || (X.hId != NULL)) ? 1 : 0
16822 -#define SC_EQUAL(X, Y) ((X->hTypeId == Y->hTypeId) && (X->hId == Y->hId)) ? 1 : 0
16823 +#define SC_EQUAL(X, Y) ((X.hTypeId == Y.hTypeId) && (X.hId == Y.hId)) ? 1 : 0
16824 #define SC_INITIALIZE(X) {X.hTypeId = X.hId = NULL;}
16826 #define UID_TO_SCHANDLE(hSC, uid) \
16828 hSC.hTypeId = NULL; \
16829 - hSC.hId = (HANDLE)(unsigned long)(uid); \
16830 + hSC.hId = (void *)(unsigned long)(uid); \
16833 +#define XTIER_SCHANDLE
16837 /*===[ Manifest constants ]===============================================*/
16838 @@ -71,16 +65,6 @@ typedef struct schandle session_t;
16839 #define IOC_SESSION 0x4a540003
16840 #define IOC_DEBUGPRINT 0x4a540004
16842 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
16843 -#define D_CHILD d_u.d_child
16844 -#define AS_TREE_LOCK(l) read_lock_irq(l)
16845 -#define AS_TREE_UNLOCK(l) read_unlock_irq(l)
16847 -#define D_CHILD d_child
16848 -#define AS_TREE_LOCK(l) spin_lock_irq(l)
16849 -#define AS_TREE_UNLOCK(l) spin_unlock_irq(l)
16853 * NetWare file attributes
16855 @@ -96,7 +80,7 @@ typedef struct schandle session_t;
16856 #define NW_ATTRIBUTE_SHAREABLE 0x80
16859 - * Define READ/WRITE flag for struct data_list
16860 + * Define READ/WRITE flag for DATA_LIST
16864 @@ -156,7 +140,8 @@ typedef struct schandle session_t;
16865 DEFINE_TO_STR(NOVFS_VFS_RELEASE) \
16868 -struct entry_info {
16869 +/*===[ Type definitions ]=================================================*/
16870 +struct novfs_entry_info {
16874 @@ -174,17 +159,17 @@ struct novfs_string {
16875 unsigned char *data;
16879 +struct novfs_login {
16880 struct novfs_string Server;
16881 struct novfs_string UserName;
16882 struct novfs_string Password;
16886 +struct novfs_logout {
16887 struct novfs_string Server;
16890 -struct dir_cache {
16891 +struct novfs_dir_cache {
16892 struct list_head list;
16895 @@ -199,7 +184,7 @@ struct dir_cache {
16899 -struct data_list {
16900 +struct novfs_data_list {
16904 @@ -209,227 +194,256 @@ struct data_list {
16906 extern char *ctime_r(time_t * clock, char *buf);
16908 -static inline u32 HandletoUint32(HANDLE h)
16911 - * Arguments: HANDLE h - handle value
16913 - * Returns: u32 - u32 value
16915 - * Abstract: Converts a HANDLE to a u32 type.
16921 - *========================================================================*/
16922 + * Converts a HANDLE to a u32 type.
16924 +static inline u32 HandletoUint32(void * h)
16926 return (u32) ((unsigned long) h);
16929 -/*++======================================================================*/
16930 -static inline HANDLE Uint32toHandle(u32 ui32)
16933 - * Arguments: u32 ui32
16935 - * Returns: HANDLE - Handle type.
16937 - * Abstract: Converts a u32 to a HANDLE type.
16943 - *========================================================================*/
16944 + * Converts a u32 to a HANDLE type.
16946 +static inline void *Uint32toHandle(u32 ui32)
16948 - return ((HANDLE) (unsigned long) ui32);
16949 + return ((void *) (unsigned long) ui32);
16952 /* Global variables */
16954 -extern int Novfs_Version_Major;
16955 -extern int Novfs_Version_Minor;
16956 -extern int Novfs_Version_Sub;
16957 -extern int Novfs_Version_Release;
16958 -extern struct dentry *Novfs_root;
16959 -extern struct proc_dir_entry *Novfs_Procfs_dir;
16960 -extern unsigned long File_update_timeout;
16961 -extern int PageCache;
16962 -extern char *Novfs_CurrentMount;
16963 -extern struct dentry_operations Novfs_dentry_operations;
16964 -extern int MaxIoSize;
16965 +extern struct dentry *novfs_root;
16966 +extern struct proc_dir_entry *novfs_procfs_dir;
16967 +extern unsigned long novfs_update_timeout;
16968 +extern int novfs_page_cache;
16969 +extern char *novfs_current_mnt;
16970 +extern int novfs_max_iosize;
16973 /* Global functions */
16974 -extern int Novfs_Remove_from_Root(char *);
16975 -extern void Novfs_dump_inode(void *pf);
16976 +extern int novfs_remove_from_root(char *);
16977 +extern void novfs_dump_inode(void *pf);
16979 -extern void mydump(int size, void *dumpptr);
16980 +extern void novfs_dump(int size, void *dumpptr);
16982 extern int Queue_Daemon_Command(void *request, unsigned long reqlen, void *data,
16983 int dlen, void **reply, unsigned long * replen,
16984 int interruptible);
16985 +extern int novfs_do_login(struct ncl_string * Server, struct ncl_string* Username, struct ncl_string * Password, void **lgnId, struct novfs_schandle *Session);
16987 -extern int Init_Procfs_Interface(void);
16988 -extern void Uninit_Procfs_Interface(void);
16989 +extern int novfs_proc_init(void);
16990 +extern void novfs_proc_exit(void);
16993 * daemon.c functions
16995 -extern void Init_Daemon_Queue(void);
16996 -extern void Uninit_Daemon_Queue(void);
16997 -extern int do_login(NclString * Server, NclString * Username, NclString * Password, HANDLE * lgnId, struct schandle *Session);
16998 -extern int do_logout(struct qstr *Server, struct schandle *Session);
16999 -extern int Daemon_SetMountPoint(char *Path);
17000 -extern int Daemon_CreateSessionId(struct schandle *SessionId);
17001 -extern int Daemon_DestroySessionId(struct schandle *SessionId);
17002 -extern int Daemon_getpwuid(uid_t uid, int unamelen, char *uname);
17003 -extern int Daemon_Get_UserSpace(struct schandle *session_id, u64 *TotalSize,
17004 - u64 *TotalFree, u64 *TotalDirectoryEnties,
17005 - u64 *FreeDirectoryEnties);
17006 -extern int Daemon_SendDebugCmd(char *Command);
17007 -extern ssize_t Daemon_Receive_Reply(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos);
17008 -extern ssize_t Daemon_Send_Command(struct file *file, char __user *buf, size_t len, loff_t *off);
17009 -extern int Daemon_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
17010 -extern int Daemon_Library_close(struct inode *inode, struct file *file);
17011 -extern int Daemon_Library_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
17012 -extern int Daemon_Library_open(struct inode *inode, struct file *file);
17013 -extern ssize_t Daemon_Library_write(struct file *file, const char __user *buf, size_t len, loff_t * off);
17014 -extern ssize_t Daemon_Library_read(struct file *file, char __user *buf, size_t len, loff_t * off);
17015 -extern loff_t Daemon_Library_llseek(struct file *file, loff_t offset, int origin);
17016 -extern int Daemon_Open_Control(struct inode *Inode, struct file *File);
17017 -extern int Daemon_Close_Control(struct inode *Inode, struct file *File);
17018 -extern int Daemon_getversion(char *Buf, int Length);
17019 +extern void novfs_daemon_queue_init(void);
17020 +extern void novfs_daemon_queue_exit(void);
17021 +extern int novfs_daemon_logout(struct qstr *Server, struct novfs_schandle *Session);
17022 +extern int novfs_daemon_set_mnt_point(char *Path);
17023 +extern int novfs_daemon_create_sessionId(struct novfs_schandle * SessionId);
17024 +extern int novfs_daemon_destroy_sessionId(struct novfs_schandle SessionId);
17025 +extern int novfs_daemon_getpwuid(uid_t uid, int unamelen, char *uname);
17026 +extern int novfs_daemon_get_userspace(struct novfs_schandle SessionId,
17027 + uint64_t * TotalSize, uint64_t * TotalFree,
17028 + uint64_t * TotalDirectoryEnties,
17029 + uint64_t * FreeDirectoryEnties);
17030 +extern int novfs_daemon_debug_cmd_send(char *Command);
17031 +extern ssize_t novfs_daemon_recv_reply(struct file *file,
17032 + const char *buf, size_t nbytes, loff_t * ppos);
17033 +extern ssize_t novfs_daemon_cmd_send(struct file *file, char *buf,
17034 + size_t len, loff_t * off);
17035 +extern int novfs_daemon_ioctl(struct inode *inode, struct file *file,
17036 + unsigned int cmd, unsigned long arg);
17037 +extern int novfs_daemon_lib_close(struct inode *inode, struct file *file);
17038 +extern int novfs_daemon_lib_ioctl(struct inode *inode, struct file *file,
17039 + unsigned int cmd, unsigned long arg);
17040 +extern int novfs_daemon_lib_open(struct inode *inode, struct file *file);
17041 +extern ssize_t novfs_daemon_lib_read(struct file *file, char *buf,
17042 + size_t len, loff_t * off);
17043 +extern ssize_t novfs_daemon_lib_write(struct file *file, const char *buf,
17044 + size_t len, loff_t * off);
17045 +extern loff_t novfs_daemon_lib_llseek(struct file *file, loff_t offset,
17047 +extern int novfs_daemon_open_control(struct inode *Inode, struct file *File);
17048 +extern int novfs_daemon_close_control(struct inode *Inode, struct file *File);
17049 +extern int novfs_daemon_getversion(char *Buf, int Length);
17055 -extern int Novfs_get_alltrees(struct dentry *parent);
17056 -extern int Novfs_Get_Connected_Server_List(unsigned char **ServerList, struct schandle *SessionId);
17057 -extern int Novfs_Get_Server_Volume_List(struct qstr *Server, unsigned char **VolumeList, struct schandle *SessionId);
17058 -extern int Novfs_Get_File_Info(unsigned char *Path, struct entry_info *Info, struct schandle *SessionId);
17059 -extern int Novfs_GetX_File_Info(char *Path, const char *Name, char *buffer, ssize_t buffer_size, ssize_t *dataLen, struct schandle *SessionId);
17060 -extern int Novfs_ListX_File_Info(char *Path, char *buffer, ssize_t buffer_size, ssize_t * dataLen, struct schandle *SessionId);
17061 -extern int Novfs_SetX_File_Info(char *Path, const char *Name, const void *Value,
17062 +extern int novfs_verify_file(struct qstr *Path, struct novfs_schandle SessionId);
17063 +extern int novfs_get_alltrees(struct dentry *parent);
17064 +extern int novfs_get_servers(unsigned char **ServerList,
17065 + struct novfs_schandle SessionId);
17066 +extern int novfs_get_vols(struct qstr *Server,
17067 + unsigned char **VolumeList, struct novfs_schandle SessionId);
17068 +extern int novfs_get_file_info(unsigned char *Path,
17069 + struct novfs_entry_info *Info, struct novfs_schandle SessionId);
17070 +extern int novfs_getx_file_info(char *Path, const char *Name,
17071 + char *buffer, ssize_t buffer_size, ssize_t *dataLen,
17072 + struct novfs_schandle SessionId);
17073 +extern int novfs_listx_file_info(char *Path, char *buffer,
17074 + ssize_t buffer_size, ssize_t *dataLen,
17075 + struct novfs_schandle SessionId);
17076 +extern int novfs_setx_file_info(char *Path, const char *Name, const void *Value,
17077 unsigned long valueLen,
17078 unsigned long *bytesWritten, int flags,
17079 - struct schandle *SessionId);
17080 + struct novfs_schandle SessionId);
17082 -extern int Novfs_Get_Directory_ListEx(unsigned char *Path, HANDLE *EnumHandle,
17083 - int *Count, struct entry_info **Info,
17084 - struct schandle *SessionId);
17085 -extern int Novfs_Open_File(unsigned char *Path, int Flags, struct entry_info *info,
17086 - HANDLE * Handle, session_t SessionId);
17087 -extern int Novfs_Create(unsigned char *Path, int DirectoryFlag,
17088 - session_t SessionId);
17089 -extern int Novfs_Close_File(HANDLE Handle, session_t SessionId);
17090 -extern int Novfs_Read_File(HANDLE Handle, unsigned char *Buffer, size_t * Bytes,
17091 - loff_t * Offset, session_t SessionId);
17092 -extern int Novfs_Read_Pages(HANDLE Handle, struct data_list *dlist, int DList_Cnt,
17093 - size_t * Bytes, loff_t * Offset,
17094 - session_t SessionId);
17095 -extern int Novfs_Write_File(HANDLE Handle, unsigned char *Buffer,
17096 +extern int novfs_get_dir_listex(unsigned char *Path, void **EnumHandle,
17097 + int *Count, struct novfs_entry_info **Info,
17098 + struct novfs_schandle SessionId);
17099 +extern int novfs_open_file(unsigned char *Path, int Flags,
17100 + struct novfs_entry_info * Info, void **Handle,
17101 + struct novfs_schandle SessionId);
17102 +extern int novfs_create(unsigned char *Path, int DirectoryFlag,
17103 + struct novfs_schandle SessionId);
17104 +extern int novfs_close_file(void * Handle, struct novfs_schandle SessionId);
17105 +extern int novfs_read_file(void * Handle, unsigned char *Buffer,
17106 + size_t * Bytes, loff_t * Offset,
17107 + struct novfs_schandle SessionId);
17108 +extern int novfs_read_pages(void * Handle, struct novfs_data_list *DList,
17109 + int DList_Cnt, size_t * Bytes, loff_t * Offset,
17110 + struct novfs_schandle SessionId);
17111 +extern int novfs_write_file(void * Handle, unsigned char *Buffer,
17112 size_t * Bytes, loff_t * Offset,
17113 - session_t SessionId);
17114 -extern int Novfs_Write_Page(HANDLE Handle, struct page *Page,
17115 - session_t SessionId);
17116 -extern int Novfs_Write_Pages(HANDLE Handle, struct data_list *dlist, int DList_Cnt,
17117 - size_t Bytes, loff_t Offset, session_t SessionId);
17118 -extern int Novfs_Delete(unsigned char *Path, int DirectoryFlag,
17119 - session_t SessionId);
17120 -extern int Novfs_Truncate_File(unsigned char *Path, int PathLen,
17121 - session_t SessionId);
17122 -extern int Novfs_Truncate_File_Ex(HANDLE Handle, loff_t Offset,
17123 - session_t SessionId);
17124 -extern int Novfs_Rename_File(int DirectoryFlag, unsigned char *OldName,
17125 + struct novfs_schandle SessionId);
17126 +extern int novfs_write_page(void * Handle, struct page *Page,
17127 + struct novfs_schandle SessionId);
17128 +extern int novfs_write_pages(void * Handle, struct novfs_data_list *DList,
17129 + int DList_Cnt, size_t Bytes, loff_t Offset,
17130 + struct novfs_schandle SessionId);
17131 +extern int novfs_delete(unsigned char *Path, int DirectoryFlag,
17132 + struct novfs_schandle SessionId);
17133 +extern int novfs_trunc(unsigned char *Path, int PathLen,
17134 + struct novfs_schandle SessionId);
17135 +extern int novfs_trunc_ex(void * Handle, loff_t Offset,
17136 + struct novfs_schandle SessionId);
17137 +extern int novfs_rename_file(int DirectoryFlag, unsigned char *OldName,
17138 int OldLen, unsigned char *NewName, int NewLen,
17139 - session_t SessionId);
17140 -extern int Novfs_Set_Attr(unsigned char *Path, struct iattr *Attr,
17141 - session_t SessionId);
17142 -extern int Novfs_Get_File_Cache_Flag(unsigned char * Path, session_t SessionId);
17143 -extern int Novfs_Set_File_Lock(session_t SessionId, HANDLE fhandle,
17144 + struct novfs_schandle SessionId);
17145 +extern int novfs_set_attr(unsigned char *Path, struct iattr *Attr,
17146 + struct novfs_schandle SessionId);
17147 +extern int novfs_get_file_cache_flag(unsigned char * Path,
17148 + struct novfs_schandle SessionId);
17149 +extern int novfs_set_file_lock(struct novfs_schandle SessionId, void * fhandle,
17150 unsigned char fl_type, loff_t fl_start,
17153 -extern struct inode *Novfs_get_inode(struct super_block *sb, int mode, int dev, uid_t uid, ino_t ino, struct qstr *name);
17154 -extern int Novfs_Read_Stream(HANDLE ConnHandle, unsigned char * Handle,
17155 +extern struct inode *novfs_get_inode(struct super_block *sb, int mode,
17156 + int dev, uid_t uid, ino_t ino, struct qstr *name);
17157 +extern int novfs_read_stream(void * ConnHandle, unsigned char * Handle,
17158 unsigned char * Buffer, size_t * Bytes, loff_t * Offset,
17159 - int User, session_t SessionId);
17160 -extern int Novfs_Write_Stream(HANDLE ConnHandle, unsigned char * Handle,
17161 + int User, struct novfs_schandle SessionId);
17162 +extern int novfs_write_stream(void * ConnHandle, unsigned char * Handle,
17163 unsigned char * Buffer, size_t * Bytes, loff_t * Offset,
17164 - session_t SessionId);
17165 -extern int Novfs_Close_Stream(HANDLE ConnHandle, unsigned char * Handle,
17166 - session_t SessionId);
17167 + struct novfs_schandle SessionId);
17168 +extern int novfs_close_stream(void * ConnHandle, unsigned char * Handle,
17169 + struct novfs_schandle SessionId);
17171 -extern int Novfs_Add_to_Root(char *);
17172 +extern int novfs_add_to_root(char *);
17176 * scope.c functions
17178 -extern void Scope_Init(void);
17179 -extern void Scope_Uninit(void);
17180 -extern void *Scope_Lookup(void);
17181 -extern uid_t Scope_Get_Uid(void *);
17182 -extern session_t Scope_Get_SessionId(void *Scope);
17183 -//extern session_t Scope_Get_SessionId(PSCOPE_LIST Scope);
17184 -extern char *Scope_Get_ScopeUsers(void);
17185 -extern int Scope_Set_UserSpace(u64 *TotalSize, u64 *Free,
17186 - u64 *TotalEnties, u64 *FreeEnties);
17187 -extern int Scope_Get_UserSpace(u64 *TotalSize, u64 *Free,
17188 - u64 *TotalEnties, u64 *FreeEnties);
17189 -extern char *Scope_dget_path(struct dentry *Dentry, char *Buf,
17190 +extern void novfs_scope_init(void);
17191 +extern void novfs_scope_exit(void);
17192 +extern void *novfs_scope_lookup(void);
17193 +extern uid_t novfs_scope_get_uid(struct novfs_scope_list *);
17194 +extern struct novfs_schandle novfs_scope_get_sessionId(struct
17195 + novfs_scope_list *);
17196 +extern char *novfs_get_scopeusers(void);
17197 +extern int novfs_scope_set_userspace(uint64_t * TotalSize, uint64_t * Free,
17198 + uint64_t * TotalEnties, uint64_t * FreeEnties);
17199 +extern int novfs_scope_get_userspace(uint64_t * TotalSize, uint64_t * Free,
17200 + uint64_t * TotalEnties, uint64_t * FreeEnties);
17201 +extern char *novfs_scope_dget_path(struct dentry *Dentry, char *Buf,
17202 unsigned int Buflen, int Flags);
17203 -extern char *Scope_Get_UserName(void);
17204 -extern void Scope_Cleanup(void);
17205 +extern void novfs_scope_cleanup(void);
17206 +extern struct novfs_scope_list *novfs_get_scope_from_name(struct qstr *);
17207 +extern struct novfs_scope_list *novfs_get_scope(struct dentry *);
17208 +extern char *novfs_scope_get_username(void);
17211 * profile.c functions
17213 extern u64 get_nanosecond_time(void);
17214 -static inline void *Novfs_Malloc(size_t size, int flags) { return kmalloc(size, flags); }
17215 extern int DbgPrint(char *Fmt, ...);
17216 -extern int init_profile(void);
17217 -extern void uninit_profile(void);
17218 +extern void novfs_profile_init(void);
17219 +extern void novfs_profile_exit(void);
17222 * nwcapi.c functions
17224 -extern int NwAuthConnWithId(PXPLAT pdata, session_t Session);
17225 -extern int NwConnClose(PXPLAT pdata, HANDLE * Handle, session_t Session);
17226 -extern int NwGetConnInfo(PXPLAT pdata, session_t Session);
17227 -extern int NwSetConnInfo(PXPLAT pdata, session_t Session);
17228 -extern int NwGetDaemonVersion(PXPLAT pdata, session_t Session);
17229 -extern int NwGetIdentityInfo(PXPLAT pdata, session_t Session);
17230 -extern int NwLicenseConn(PXPLAT pdata, session_t Session);
17231 -extern int NwLoginIdentity(PXPLAT pdata, struct schandle *Session);
17232 -extern int NwLogoutIdentity(PXPLAT pdata, session_t Session);
17233 -extern int NwOpenConnByAddr(PXPLAT pdata, HANDLE * Handle, session_t Session);
17234 -extern int NwOpenConnByName(PXPLAT pdata, HANDLE * Handle, session_t Session);
17235 -extern int NwOpenConnByRef(PXPLAT pdata, HANDLE * Handle, session_t Session);
17236 -extern int NwQueryFeature(PXPLAT pdata, session_t Session);
17237 -extern int NwRawSend(PXPLAT pdata, session_t Session);
17238 -extern int NwScanConnInfo(PXPLAT pdata, session_t Session);
17239 -extern int NwSysConnClose(PXPLAT pdata, unsigned long * Handle, session_t Session);
17240 -extern int NwUnAuthenticate(PXPLAT pdata, session_t Session);
17241 -extern int NwUnlicenseConn(PXPLAT pdata, session_t Session);
17242 -extern int NwcChangeAuthKey(PXPLAT pdata, session_t Session);
17243 -extern int NwcEnumIdentities(PXPLAT pdata, session_t Session);
17244 -extern int NwcGetDefaultNameCtx(PXPLAT pdata, session_t Session);
17245 -extern int NwcGetPreferredDSTree(PXPLAT pdata, session_t Session);
17246 -extern int NwcGetTreeMonitoredConn(PXPLAT pdata, session_t Session);
17247 -extern int NwcSetDefaultNameCtx(PXPLAT pdata, session_t Session);
17248 -extern int NwcSetPreferredDSTree(PXPLAT pdata, session_t Session);
17249 -extern int NwcSetPrimaryConn(PXPLAT pdata, session_t Session);
17250 -extern int NwcGetPrimaryConn(PXPLAT pdata, session_t Session);
17251 -extern int NwcSetMapDrive(PXPLAT pdata, session_t Session);
17252 -extern int NwcUnMapDrive(PXPLAT pdata, session_t Session);
17253 -extern int NwcEnumerateDrives(PXPLAT pdata, session_t Session);
17254 -extern int NwcGetBroadcastMessage(PXPLAT pdata, session_t Session);
17255 -extern int NwdSetKeyValue(PXPLAT pdata, session_t Session);
17256 -extern int NwdVerifyKeyValue(PXPLAT pdata, session_t Session);
17257 +extern int novfs_auth_conn(struct novfs_xplat *pdata,
17258 + struct novfs_schandle Session);
17259 +extern int novfs_conn_close(struct novfs_xplat *pdata,
17260 + void **Handle, struct novfs_schandle Session);
17261 +extern int novfs_get_conn_info(struct novfs_xplat *pdata,
17262 + struct novfs_schandle Session);
17263 +extern int novfs_set_conn_info(struct novfs_xplat *pdata,
17264 + struct novfs_schandle Session);
17265 +extern int novfs_get_daemon_ver(struct novfs_xplat *pdata,
17266 + struct novfs_schandle Session);
17267 +extern int novfs_get_id_info(struct novfs_xplat *pdata,
17268 + struct novfs_schandle Session);
17269 +extern int novfs_license_conn(struct novfs_xplat *pdata,
17270 + struct novfs_schandle Session);
17271 +extern int novfs_login_id(struct novfs_xplat *pdata,
17272 + struct novfs_schandle Session);
17273 +extern int novfs_logout_id(struct novfs_xplat *pdata,
17274 + struct novfs_schandle Session);
17275 +extern int novfs_open_conn_by_addr(struct novfs_xplat *pdata,
17276 + void **Handle, struct novfs_schandle Session);
17277 +extern int novfs_open_conn_by_name(struct novfs_xplat *pdata,
17278 + void **Handle, struct novfs_schandle Session);
17279 +extern int novfs_open_conn_by_ref(struct novfs_xplat *pdata,
17280 + void **Handle, struct novfs_schandle Session);
17281 +extern int novfs_query_feature(struct novfs_xplat *pdata,
17282 + struct novfs_schandle Session);
17283 +extern int novfs_raw_send(struct novfs_xplat *pdata,
17284 + struct novfs_schandle Session);
17285 +extern int novfs_scan_conn_info(struct novfs_xplat *pdata,
17286 + struct novfs_schandle Session);
17287 +extern int novfs_sys_conn_close(struct novfs_xplat *pdata,
17288 + unsigned long *Handle, struct novfs_schandle Session);
17289 +extern int novfs_unauthenticate(struct novfs_xplat *pdata,
17290 + struct novfs_schandle Session);
17291 +extern int novfs_unlicense_conn(struct novfs_xplat *pdata,
17292 + struct novfs_schandle Session);
17293 +extern int novfs_change_auth_key(struct novfs_xplat *pdata,
17294 + struct novfs_schandle Session);
17295 +extern int novfs_enum_ids(struct novfs_xplat *pdata,
17296 + struct novfs_schandle Session);
17297 +extern int novfs_get_default_ctx(struct novfs_xplat *pdata,
17298 + struct novfs_schandle Session);
17299 +extern int novfs_get_preferred_DS_tree(struct novfs_xplat *pdata,
17300 + struct novfs_schandle Session);
17301 +extern int novfs_get_tree_monitored_conn(struct novfs_xplat *pdata,
17302 + struct novfs_schandle Session);
17303 +extern int novfs_set_default_ctx(struct novfs_xplat *pdata,
17304 + struct novfs_schandle Session);
17305 +extern int novfs_set_preferred_DS_tree(struct novfs_xplat *pdata,
17306 + struct novfs_schandle Session);
17307 +extern int novfs_set_pri_conn(struct novfs_xplat *pdata,
17308 + struct novfs_schandle Session);
17309 +extern int novfs_get_pri_conn(struct novfs_xplat *pdata,
17310 + struct novfs_schandle Session);
17311 +extern int novfs_set_map_drive(struct novfs_xplat *pdata,
17312 + struct novfs_schandle Session);
17313 +extern int novfs_unmap_drive(struct novfs_xplat *pdata,
17314 + struct novfs_schandle Session);
17315 +extern int novfs_enum_drives(struct novfs_xplat *pdata,
17316 + struct novfs_schandle Session);
17317 +extern int novfs_get_bcast_msg(struct novfs_xplat *pdata,
17318 + struct novfs_schandle Session);
17319 +extern int novfs_set_key_value(struct novfs_xplat *pdata,
17320 + struct novfs_schandle Session);
17321 +extern int novfs_verify_key_value(struct novfs_xplat *pdata,
17322 + struct novfs_schandle Session);
17325 #endif /* __NOVFS_H */