]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/suse-2.6.27.31/patches.suse/convert-novfs-to-open-soure-coding-standards.patch
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / convert-novfs-to-open-soure-coding-standards.patch
CommitLineData
2cb7cef9
BS
1From rgoldwyn@suse.de Tue Jun 10 15:41:39 2008
2From: Goldwyn Rodrigues <rgoldwyn@suse.de>
3Date: Tue Jun 10 14:22:41 IST 2008
4Subject: Convert novfs to open soure coding standards
5Message-ID: <1213088555.4964.9.camel@baloo.junglebook>
6
7
8Convert 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
13 pointers
14 - return immediately on error (such as ENOMEM), instead of
15 creating enclosing in if..else code blocks for better
16 understanding.
17
18Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
19Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20
21---
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(-)
33
34--- a/fs/novfs/commands.h
35+++ b/fs/novfs/commands.h
36@@ -126,11 +126,7 @@
37
38 #pragma pack(push, 1)
39
40-#ifndef NWHANDLE
41-typedef void *NWHANDLE;
42-#endif
43-
44-/*typedef struct _ncl_string
45+/*struct _ncl_string
46 {
47 unsigned int type;
48 unsigned char *buffer;
49@@ -138,206 +134,127 @@ typedef void *NWHANDLE;
50
51 } NclString, *PNclString;
52 */
53-typedef struct _ncl_string {
54+struct ncl_string {
55 unsigned int type;
56 unsigned char *buffer;
57 u32 len;
58+};
59
60-} NclString, *PNclString;
61-
62-typedef struct _nwd_string {
63+struct nwd_string {
64 unsigned int type;
65 unsigned int len;
66 unsigned int boffset;
67+};
68
69-} NwdString, *PNwdString;
70-
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;
78+
79+};
80
81-typedef struct _COMMAND_REPLY_HEADER {
82+struct novfs_command_reply_header {
83 unsigned long Sequence_Number;
84 unsigned int ErrorCode;
85
86-} COMMAND_REPLY_HEADER, *PCOMMAND_REPLY_HEADER;
87+};
88
89-typedef struct _CLOSE_REQUEST {
90- COMMAND_REQUEST_HEADER Command;
91- NWHANDLE FileHandle;
92-} CLOSE_REQUEST, *PCLOSE_REQUEST;
93-
94-typedef struct _CLOSE_REPLY {
95- COMMAND_REPLY_HEADER Reply;
96-} CLOSE_REPLY, *PCLOSE_REPLY;
97
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;
106+};
107
108-typedef struct _DELETE_FILE_REPLY {
109- COMMAND_REPLY_HEADER Reply;
110-} DELETE_FILE_REPLY, *PDELETE_FILE_REPLY;
111-
112-typedef struct _FLUSH_REQUEST {
113- COMMAND_REQUEST_HEADER Command;
114- NWHANDLE FileHandle;
115-} FLUSH_REQUEST, *PFLUSH_REQUEST;
116-
117-typedef struct _FLUSH_REPLY {
118- COMMAND_REPLY_HEADER Reply;
119-} FLUSH_REPLY, *PFLUSH_REPLY;
120-
121-typedef struct _GET_FILEINFO_REQUEST {
122- COMMAND_REQUEST_HEADER Command;
123- NWHANDLE FileHandle;
124-} GET_FILEINFO_REQUEST, *PGET_FILEINFO_REQUEST;
125-
126-typedef struct _GET_FILEINFO_REPLY {
127- COMMAND_REPLY_HEADER Reply;
128-} GET_FILEINFO_REPLY, *PGET_FILEINFO_REPLY;
129-
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;
135+};
136+
137+struct novfs_get_connected_server_list {
138+ struct novfs_command_request_header Command;
139+};
140
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;
147+};
148+
149+struct novfs_get_connected_server_list_request_ex {
150+ struct novfs_command_request_header Command;
151+};
152
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 {
157
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];
163
164-} GET_CONNECTED_SERVER_LIST_REPLY_EX, *PGET_CONNECTED_SERVER_LIST_REPLY_EX;
165+};
166
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;
171 unsigned int Length;
172 unsigned char Name[1];
173-} GET_SERVER_VOLUME_LIST_REQUEST, *PGET_SERVER_VOLUME_LIST_REQUEST;
174+};
175
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;
182-
183-typedef struct _OPEN_CONNECTION_BY_ADDR_REQUEST {
184- COMMAND_REQUEST_HEADER Command;
185- unsigned int address;
186-
187-} OPEN_CONNECTION_BY_ADDR_REQUEST, *POPEN_CONNECTION_BY_ADDR_REQUEST;
188-
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;
194-
195-} OPEN_CONNECTION_BY_ADDR_REPLY, *POPEN_CONNECTION_BY_ADDR_REPLY;
196-
197-typedef struct _OPEN_CONNECTION_BY_NAME_REQUEST {
198- COMMAND_REQUEST_HEADER Command;
199- unsigned int NameLen;
200- unsigned char Name[1];
201-
202-} OPEN_CONNECTION_BY_NAME_REQUEST, *POPEN_CONNECTION_BY_NAME_REQUEST;
203+};
204
205-typedef struct _OPEN_CONNECTION_BY_NAME_REPLY {
206- COMMAND_REPLY_HEADER Reply;
207- unsigned char treeName[64];
208- NWHANDLE connHandle;
209-
210-} OPEN_CONNECTION_BY_NAME_REPLY, *POPEN_CONNECTION_BY_NAME_REPLY;
211-
212-/*
213-typedef struct _LOGIN_IDENTITY_REQUEST
214-{
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];
224-
225-} LOGIN_IDENTITY_REQUEST, *PLOGIN_IDENTITY_REQUEST;
226-
227-typedef struct _LOGIN_IDENTITY_REPLY
228-{
229- COMMAND_REPLY_HEADER Reply;
230- unsigned char serverName[64];
231- unsigned char treeName[64];
232- NWHANDLE connHandle;
233-
234-} LOGIN_IDENTITY_REPLY, *PLOGIN_IDENTITY_REPLY;
235-*/
236-
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];
243
244-} VERIFY_FILE_REQUEST, *PVERIFY_FILE_REQUEST;
245+};
246
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;
256
257-} VERIFY_FILE_REPLY, *PVERIFY_FILE_REPLY;
258+};
259
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];
266
267-} BEGIN_ENUMERATE_DIRECTORY_REQUEST, *PBEGIN_ENUMERATE_DIRECTORY_REQUEST;
268+};
269
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;
276
277-} BEGIN_ENUMERATE_DIRECTORY_REPLY, *PBEGIN_ENUMERATE_DIRECTORY_REPLY;
278+};
279
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;
286
287-} END_ENUMERATE_DIRECTORY_REQUEST, *PEND_ENUMERATE_DIRECTORY_REQUEST;
288+};
289
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;
294
295-} END_ENUMERATE_DIRECTORY_REPLY, *PEND_ENUMERATE_DIRECTORY_REPLY;
296+};
297
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];
306
307-} ENUMERATE_DIRECTORY_REQUEST, *PENUMERATE_DIRECTORY_REQUEST;
308+};
309
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];
322
323-} ENUMERATE_DIRECTORY_REPLY, *PENUMERATE_DIRECTORY_REPLY;
324+};
325
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];
334
335-} ENUMERATE_DIRECTORY_EX_REQUEST, *PENUMERATE_DIRECTORY_EX_REQUEST;
336+};
337
338-typedef struct _ENUMERATE_DIRECTORY_EX_DATA {
339+struct novfs_enumerate_directory_ex_data {
340 unsigned int length;
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];
346
347-} ENUMERATE_DIRECTORY_EX_DATA, *PENUMERATE_DIRECTORY_EX_DATA;
348+};
349
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;
357
358-} ENUMERATE_DIRECTORY_EX_REPLY, *PENUMERATE_DIRECTORY_EX_REPLY;
359+};
360
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];
370
371-} OPEN_FILE_REQUEST, *POPEN_FILE_REQUEST;
372+};
373
374-typedef struct _OPEN_FILE_REPLY {
375- COMMAND_REPLY_HEADER Reply;
376- HANDLE handle;
377+struct novfs_open_file_reply {
378+ struct novfs_command_reply_header Reply;
379+ void *handle;
380 unsigned int lastAccessTime;
381 unsigned int modifyTime;
382 unsigned int createTime;
383 unsigned int attributes;
384 loff_t size;
385
386-} OPEN_FILE_REPLY, *POPEN_FILE_REPLY;
387+};
388
389-typedef struct _CREATE_FILE_REQUEST {
390+struct novfs_create_file_request {
391
392- COMMAND_REQUEST_HEADER Command;
393+ struct novfs_command_request_header Command;
394 unsigned int pathlength;
395 unsigned char path[1];
396
397-} CREATE_FILE_REQUEST, *PCREATE_FILE_REQUEST;
398+};
399
400-typedef struct _CREATE_FILE_REPLY {
401- COMMAND_REPLY_HEADER Reply;
402+struct novfs_create_file_reply {
403+ struct novfs_command_reply_header Reply;
404
405-} CREATE_FILE_REPLY, *PCREATE_FILE_REPLY;
406+};
407
408-typedef struct _CLOSE_FILE_REQUEST {
409- COMMAND_REQUEST_HEADER Command;
410- HANDLE handle;
411+struct novfs_close_file_request {
412+ struct novfs_command_request_header Command;
413+ void *handle;
414
415-} CLOSE_FILE_REQUEST, *PCLOSE_FILE_REQUEST;
416+};
417
418-typedef struct _CLOSE_FILE_REPLY {
419- COMMAND_REPLY_HEADER Reply;
420+struct novfs_close_file_reply {
421+ struct novfs_command_reply_header Reply;
422
423-} CLOSE_FILE_REPLY, *PCLOSE_FILE_REPLY;
424+};
425
426-typedef struct _READ_FILE_REQUEST {
427- COMMAND_REQUEST_HEADER Command;
428- HANDLE handle;
429+struct novfs_read_file_request {
430+ struct novfs_command_request_header Command;
431+ void *handle;
432 loff_t offset;
433 size_t len;
434
435-} READ_FILE_REQUEST, *PREAD_FILE_REQUEST;
436+};
437
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];
444
445-} READ_FILE_REPLY, *PREAD_FILE_REPLY;
446+};
447
448-typedef struct _WRITE_FILE_REQUEST {
449- COMMAND_REQUEST_HEADER Command;
450- HANDLE handle;
451+struct novfs_write_file_request {
452+ struct novfs_command_request_header Command;
453+ void *handle;
454 loff_t offset;
455 size_t len;
456 unsigned char data[1];
457
458-} WRITE_FILE_REQUEST, *PWRITE_FILE_REQUEST;
459+};
460
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;
467+};
468
469-typedef struct _READ_STREAM_REQUEST {
470- COMMAND_REQUEST_HEADER Command;
471- HANDLE connection;
472+struct novfs_read_stream_request {
473+ struct novfs_command_request_header Command;
474+ void *connection;
475 unsigned char handle[6];
476 loff_t offset;
477 size_t len;
478-} READ_STREAM_REQUEST, *PREAD_STREAM_REQUEST;
479+};
480
481-typedef struct _READ_STREAM_REPLY {
482- COMMAND_REPLY_HEADER Reply;
483+struct novfs_read_stream_reply {
484+ struct novfs_command_reply_header Reply;
485 size_t bytesRead;
486 unsigned char data[1];
487-} READ_STREAM_REPLY, *PREAD_STREAM_REPLY;
488+};
489
490-typedef struct _WRITE_STREAM_REQUEST {
491- COMMAND_REQUEST_HEADER Command;
492- HANDLE connection;
493+struct novfs_write_stream_request {
494+ struct novfs_command_request_header Command;
495+ void *connection;
496 unsigned char handle[6];
497 loff_t offset;
498 size_t len;
499 unsigned char data[1];
500-} WRITE_STREAM_REQUEST, *PWRITE_STREAM_REQUEST;
501+};
502
503-typedef struct _WRITE_STREAM_REPLY {
504- COMMAND_REPLY_HEADER Reply;
505+struct novfs_write_stream_reply {
506+ struct novfs_command_reply_header Reply;
507 size_t bytesWritten;
508-} WRITE_STREAM_REPLY, *PWRITE_STREAM_REPLY;
509+};
510
511-typedef struct _CLOSE_STREAM_REQUEST {
512- COMMAND_REQUEST_HEADER Command;
513- HANDLE connection;
514+struct novfs_close_stream_request {
515+ struct novfs_command_request_header Command;
516+ void *connection;
517 unsigned char handle[6];
518-} CLOSE_STREAM_REQUEST, *PCLOSE_STREAM_REQUEST;
519+};
520
521-typedef struct _CLOSE_STREAM_REPLY {
522- COMMAND_REPLY_HEADER Reply;
523+struct novfs_close_stream_reply {
524+ struct novfs_command_reply_header Reply;
525
526-} CLOSE_STREAM_REPLY, *PCLOSE_STREAM_REPLY;
527+};
528
529-typedef struct _CREATE_DIRECTORY_REQUEST {
530-
531- COMMAND_REQUEST_HEADER Command;
532- unsigned int pathlength;
533- unsigned char path[1];
534-
535-} CREATE_DIRECTORY_REQUEST, *PCREATE_DIRECTORY_REQUEST;
536-
537-typedef struct _CREATE_DIRECTORY_REPLY {
538- COMMAND_REPLY_HEADER Reply;
539-
540-} CREATE_DIRECTORY_REPLY, *PCREATE_DIRECTORY_REPLY;
541-
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;
552
553-} LOGIN_USER_REQUEST, *PLOGIN_USER_REQUEST;
554+};
555
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;
563
564-} LOGIN_USER_REPLY, *PLOGIN_USER_REPLY;
565+};
566
567-typedef struct _LOGOUT_REQUEST {
568- COMMAND_REQUEST_HEADER Command;
569+struct novfs_logout_request {
570+ struct novfs_command_request_header Command;
571 unsigned int length;
572 unsigned char Name[1];
573
574-} LOGOUT_REQUEST, *PLOGOUT_REQUEST;
575+};
576
577-typedef struct _LOGOUT_REPLY {
578- COMMAND_REPLY_HEADER Reply;
579+struct novfs_logout_reply {
580+ struct novfs_command_reply_header Reply;
581
582-} LOGOUT_REPLY, *PLOGOUT_REPLY;
583+};
584
585-typedef struct _CREATE_CONTEXT_REQUEST {
586- COMMAND_REQUEST_HEADER Command;
587+struct novfs_create_context_request {
588+ struct novfs_command_request_header Command;
589
590-} CREATE_CONTEXT_REQUEST, *PCREATE_CONTEXT_REQUEST;
591+};
592
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;
600
601-typedef struct _DESTROY_CONTEXT_REQUEST {
602- COMMAND_REQUEST_HEADER Command;
603+};
604
605-} DESTROY_CONTEXT_REQUEST, *PDESTROY_CONTEXT_REQUEST;
606+struct novfs_destroy_context_request {
607+ struct novfs_command_request_header Command;
608
609-typedef struct _DESTROY_CONTEXT_REPLY {
610- COMMAND_REPLY_HEADER Reply;
611+};
612
613-} DESTROY_CONTEXT_REPLY, *PDESTROY_CONTEXT_REPLY;
614+struct novfs_destroy_context_reply {
615+ struct novfs_command_reply_header Reply;
616+
617+};
618
619 /*
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
623 #endif
624
625-typedef struct _LNX_FILE_INFO {
626+struct novfs_lnx_file_info {
627 unsigned int ia_valid;
628 unsigned int ia_mode;
629 uid_t ia_uid;
630@@ -582,126 +487,124 @@ typedef struct _LNX_FILE_INFO {
631 time_t ia_mtime;
632 time_t ia_ctime;
633 unsigned int ia_attr_flags;
634+};
635
636-} LX_FILE_INFO, *PLX_FILE_INFO;
637-
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;
645 char path[1];
646+};
647
648-} SET_FILE_INFO_REQUEST, *PSET_FILE_INFO_REQUEST;
649-
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;
654
655-} SET_FILE_INFO_REPLY, *PSET_FILE_INFO_REPLY;
656+};
657
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;
663 char path[1];
664
665-} TRUNCATE_FILE_REQUEST, *PTRUNCATE_FILE_REQUEST;
666+};
667
668-typedef struct _TRUNCATE_FILE_REPLY {
669- COMMAND_REPLY_HEADER Reply;
670+struct novfs_truncate_file_reply {
671+ struct novfs_command_reply_header Reply;
672
673-} TRUNCATE_FILE_REPLY, *PTRUNCATE_FILE_REPLY;
674+};
675
676-typedef struct _GETPWUID_REQUEST {
677- COMMAND_REQUEST_HEADER Command;
678+struct novfs_getpwuid_request {
679+ struct novfs_command_request_header Command;
680 unsigned int uid;
681-} GETPWUID_REQUEST, *PGETPWUID_REQUEST;
682+};
683
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;
690+};
691
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;
697+};
698
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;
705+};
706
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;
714+};
715
716-typedef struct _SET_MOUNT_PATH_REPLY {
717- COMMAND_REPLY_HEADER Reply;
718-} SET_MOUNT_PATH, *PSET_MOUNT_PATH_REPLY;
719-
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;
725+};
726+
727+struct novfs_get_user_space {
728+ struct novfs_command_request_header Command;
729+};
730
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;
735 uint64_t TotalSpace;
736 uint64_t FreeSpace;
737 uint64_t TotalEnties;
738 uint64_t FreeEnties;
739-} GET_USER_SPACE_REPLY, *PGET_USER_SPACE_REPLY;
740+};
741
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];
749
750-} XPLAT_CALL_REQUEST, *PXPLAT_CALL_REQUEST;
751+};
752
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];
759
760-} XPLAT_CALL_REPLY, *PXPLAT_CALL_REPLY;
761+};
762
763 /* XPlat NWC structures used by the daemon */
764
765-typedef struct _NWD_OPEN_CONN_BY_NAME {
766- HANDLE ConnHandle;
767+struct nwd_open_conn_by_name {
768+ void *ConnHandle;
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;
777
778-} NwdCOpenConnByName, *PNwdCOpenConnByName;
779+};
780
781-typedef struct _NWD_TRAN_ADDR {
782+struct nwd_tran_addr {
783 unsigned int uTransportType;
784 unsigned int uAddressLength;
785 unsigned int oAddress;
786
787-} NwdCTranAddr, *PNwdCTranAddr;
788+};
789
790-typedef struct _NWD_OPEN_CONN_BY_ADDR {
791- HANDLE ConnHandle;
792+struct nwd_open_conn_by_addr {
793+ void *ConnHandle;
794 unsigned int oServiceType;
795 unsigned int uConnFlags;
796- NwdCTranAddr TranAddr;
797+ struct nwd_tran_addr TranAddr;
798
799-} NwdCOpenConnByAddr, *PNwdCOpenConnByAddr;
800+};
801
802-typedef struct _NWD_CLOSE_CONN {
803- HANDLE ConnHandle;
804+struct nwd_close_conn {
805+ void *ConnHandle;
806
807-} NwdCCloseConn, *PNwdCCloseConn;
808+};
809
810-typedef struct _NWD_NCP_REQ {
811- HANDLE ConnHandle;
812+struct nwd_ncp_req {
813+ void *ConnHandle;
814 unsigned int replyLen;
815 unsigned int requestLen;
816 unsigned int function;
817@@ -710,48 +613,37 @@ typedef struct _NWD_NCP_REQ {
818 unsigned int flags;
819 unsigned char data[1];
820
821-} NwdCNCPReq, *PNwdCNCPReq;
822+};
823
824-typedef struct _NWD_NCP_REP {
825+struct nwd_ncp_rep {
826 unsigned int replyLen;
827 unsigned char data[1];
828
829-} NwdCNCPRep, *PNwdCNCPRep;
830+};
831
832-typedef struct _NWC_AUTH_WID {
833- HANDLE ConnHandle;
834+struct nwc_auth_wid {
835+ void *ConnHandle;
836 u32 AuthenticationId;
837
838-} NwdCAuthenticateWithId, *PNwdCAuthenticateWithId;
839+};
840
841-typedef struct _NWC_AUTHENTICATE {
842- HANDLE ConnHandle;
843- unsigned int uAuthenticationType;
844- unsigned int userNameOffset;
845- unsigned int passwordOffset;
846- unsigned int MaxInfoLength;
847- unsigned int InfoLength;
848- unsigned int authenInfoOffset;
849-
850-} NwdCAuthenticate, *PNwdCAuthenticate;
851-
852-typedef struct _NWC_UNAUTHENTICATE {
853- HANDLE ConnHandle;
854+struct nwc_unauthenticate {
855+ void *ConnHandle;
856 unsigned int AuthenticationId;
857
858-} NwdCUnauthenticate, *PNwdCUnauthenticate;
859+};
860
861-typedef struct _NWC_LISC_ID {
862- HANDLE ConnHandle;
863+struct nwc_lisc_id {
864+ void *ConnHandle;
865
866-} NwdCLicenseConn, *PNwdCLicenseConn;
867+};
868
869-typedef struct _NWC_UNLIC_CONN {
870- HANDLE ConnHandle;
871+struct nwc_unlic_conn {
872+ void *ConnHandle;
873
874-} NwdCUnlicenseConn, *PNwdCUnlicenseConn;
875+};
876
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;
885
886-} NwdCGetIdentityInfo, *PNwdCGetIdentityInfo;
887+};
888
889-typedef struct _NWC_LO_ID {
890+struct nwc_lo_id {
891 u32 AuthenticationId;
892
893-} NwdCLogoutIdentity, *PNwdCLogoutIdentity;
894+};
895
896-typedef struct _RENAME_FILE_REQUEST {
897- COMMAND_REQUEST_HEADER Command;
898+struct novfs_rename_file_request {
899+ struct novfs_command_request_header Command;
900 int directoryFlag;
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;
906+};
907
908-typedef struct _RENAME_FILE_REPLY {
909- COMMAND_REPLY_HEADER Reply;
910+struct novfs_rename_file_reply {
911+ struct novfs_command_reply_header Reply;
912
913-} RENAME_FILE_REPLY, *PRENAME_FILE_REPLY;
914+};
915
916-typedef struct __NwdServerVersion {
917+struct nwd_server_version {
918 unsigned int uMajorVersion;
919 unsigned short int uMinorVersion;
920 unsigned short int uRevision;
921+};
922
923-} NwdServerVersion, *PNwdServerVersion;
924
925 #define MAX_ADDRESS_LENGTH 32
926
927-typedef struct tagNwdTranAddrEx {
928+struct tagNwdTranAddrEx {
929 unsigned int uTransportType;
930 unsigned int uAddressLength;
931 unsigned char Buffer[MAX_ADDRESS_LENGTH];
932
933-} NwdTranAddr, *PNwdTranAddr;
934+};
935
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;
943 u32 uAuthId;
944 unsigned int uDisconnected;
945- NwdServerVersion ServerVersion;
946- NwdTranAddr TranAddress;
947-
948-} NwdConnInfo, *PNwdConnInfo;
949+ struct nwd_server_version ServerVersion;
950+ struct nwd_tran_addr TranAddress;
951+};
952
953-typedef struct _nwd_conn_info {
954- HANDLE ConnHandle;
955+struct nwd_conn_info {
956+ void *ConnHandle;
957 unsigned int uInfoLevel;
958 unsigned int uInfoLength;
959+};
960
961-} NwdCGetConnInfo, *PNwdCGetConnInfo;
962-
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;
968- HANDLE ConnHandle;
969+ void *ConnHandle;
970
971-} NwdCOpenConnByRef, *PNwdCOpenConnByRef;
972+};
973
974-typedef struct nwd_get_reqversion {
975+struct nwd_get_reqversion {
976 unsigned int uMajorVersion;
977 unsigned int uMinorVersion;
978 unsigned int uRevision;
979
980-} NwdCGetRequesterVersion, *PNwdCGetRequesterVersion;
981+};
982
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;
991
992-} NwdCScanConnInfo, *PNwdCScanConnInfo;
993+};
994
995-typedef struct nwc_get_pref_ds_tree {
996+struct nwd_get_pref_ds_tree {
997 unsigned int uTreeLength;
998 unsigned int DsTreeNameOffset;
999
1000-} NwdCGetPreferredDsTree, *PNwdCGetPreferredDsTree;
1001+};
1002
1003-typedef struct nwc_set_pref_ds_tree {
1004+struct nwd_set_pref_ds_tree {
1005 unsigned int uTreeLength;
1006 unsigned int DsTreeNameOffset;
1007
1008-} NwdCSetPreferredDsTree, *PNwdCSetPreferredDsTree;
1009+};
1010
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;
1017
1018-} NwdCSetDefaultNameContext, *PNwdCSetDefaultNameContext;
1019+};
1020
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;
1027
1028-} NwdCGetDefaultNameContext, *PNwdCGetDefaultNameContext;
1029+};
1030
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;
1037
1038-} NwdCGetTreeMonitoredConnRef, *PNwdCGetTreeMonitoredConnRef;
1039+};
1040
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;
1049
1050-} NwdCDEnumerateIdentities, *PNwdCEnumerateIdentities;
1051+};
1052
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;
1061
1062-} NwdCChangeKey, *PNwdCChangeKey;
1063+};
1064
1065-typedef struct _nwd_get_primary_conn {
1066- HANDLE uConnReference;
1067+struct nwd_set_primary_conn {
1068+ void *ConnHandle;
1069
1070-} NwdCGetPrimaryConnection, *PNwdCGetPrimaryConnection;
1071+};
1072
1073-typedef struct _nwd_set_primary_conn {
1074- HANDLE ConnHandle;
1075-
1076-} NwdCSetPrimaryConnection, *PNwdCSetPrimaryConnection;
1077-
1078-typedef struct _nwd_map_drive_ex {
1079- u32 ConnHandle;
1080- u32 localUid;
1081- u32 linkOffsetLength;
1082- u32 linkOffset;
1083- u32 dirPathOffsetLength;
1084- u32 dirPathOffset;
1085-
1086-} NwdCMapDriveEx, *PNwdCMapDriveEx;
1087-
1088-typedef struct _nwd_unmap_drive_ex {
1089- unsigned int linkLen;
1090- char linkPath[1];
1091-
1092-} NwdCUnmapDriveEx, *PNwdCUnmapDriveEx;
1093-
1094-typedef struct _nwd_enum_links {
1095- unsigned int totalLen;
1096- unsigned int linkCount;
1097-
1098-} NwdCEnumLinks, *PNwdCEnumLinks;
1099-
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;
1106 char message[1];
1107
1108-} NwdCGetBroadcastNotification, *PNwdCGetBroadcastNotification;
1109-
1110-typedef struct _enum_entry {
1111- unsigned int entryLen;
1112- u32 connHdl;
1113- char data[0];
1114-} NwdCEnumEntry, *PNwdCEnumEntry;
1115+};
1116
1117-typedef struct _nwd_set_conn_info {
1118- HANDLE ConnHandle;
1119+struct nwd_set_conn_info {
1120+ void *ConnHandle;
1121 unsigned int uInfoLevel;
1122 unsigned int uInfoLength;
1123 unsigned int offsetConnInfo;
1124
1125-} NwdCSetConnInfo, *PNwdCSetConnInfo;
1126-
1127-typedef struct _len_string {
1128- u32 stLen;
1129- char string[1];
1130+};
1131
1132-} LString, *PLString;
1133-
1134-typedef struct _DEBUG_REQUEST {
1135- COMMAND_REQUEST_HEADER Command;
1136+struct novfs_debug_request {
1137+ struct novfs_command_request_header Command;
1138 int cmdlen;
1139 char dbgcmd[1];
1140
1141-} DEBUG_REQUEST, *PDEBUG_REQUEST;
1142+};
1143
1144-typedef struct _DEBUG_REPLY {
1145- COMMAND_REPLY_HEADER Reply;
1146+struct novfs_debug_reply {
1147+ struct novfs_command_reply_header Reply;
1148
1149-} DEBUG_REPLY, *PDEBUG_REPLY;
1150+};
1151
1152-typedef struct _Nwd_Set_Key {
1153- HANDLE ConnHandle;
1154+struct nwd_set_key {
1155+ void *ConnHandle;
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;
1162
1163-} NwdCSetKey, *PNwdCSetKey;
1164+};
1165
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;
1174
1175-} NwdCVerifyKey, *PNwdCVerifyKey;
1176+};
1177
1178-typedef struct _GET_CACHE_FLAG {
1179- COMMAND_REQUEST_HEADER Command;
1180+struct novfs_get_cache_flag {
1181+ struct novfs_command_request_header Command;
1182 int pathLen;
1183 unsigned char path[0];
1184
1185-} GET_CACHE_FLAG_REQUEST, *PGET_CACHE_FLAG_REQUEST;
1186+};
1187
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;
1192 int CacheFlag;
1193
1194-} GET_CACHE_FLAG_REPLY, *PGET_CACHE_FLAG_REPLY;
1195+};
1196
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;
1202
1203-} XA_LIST_REPLY, *PXA_LIST_REPLY;
1204+};
1205
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
1213
1214-} XA_GET_REQUEST, *PXA_GET_REQUEST;
1215+};
1216
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;
1222
1223-} XA_GET_REPLY, *PXA_GET_REPLY;
1224+};
1225
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;
1232 int flags;
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
1236
1237-} XA_SET_REQUEST, *PXA_SET_REQUEST;
1238+};
1239
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;
1245
1246-} XA_SET_REPLY, *PXA_SET_REPLY;
1247+};
1248
1249-typedef struct _SET_FILE_LOCK_REQUEST {
1250- COMMAND_REQUEST_HEADER Command;
1251- HANDLE handle;
1252+struct novfs_set_file_lock_request {
1253+ struct novfs_command_request_header Command;
1254+ void *handle;
1255 unsigned char fl_type;
1256 loff_t fl_start;
1257 loff_t fl_len;
1258
1259-} SET_FILE_LOCK_REQUEST, *PSET_FILE_LOCK_REQUEST;
1260+};
1261+
1262+struct novfs_set_file_lock_reply {
1263+ struct novfs_command_reply_header Reply;
1264+
1265+};
1266
1267-typedef struct _SET_FILE_LOCK_REPLY {
1268- COMMAND_REPLY_HEADER Reply;
1269
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;
1275+ pid_t ScopePid;
1276+ struct task_struct *ScopeTask;
1277+ unsigned int ScopeHash;
1278+ uid_t ScopeUid;
1279+ uint64_t ScopeUSize;
1280+ uint64_t ScopeUFree;
1281+ uint64_t ScopeUTEnties;
1282+ uint64_t ScopeUAEnties;
1283+ int ScopeUserNameLength;
1284+ unsigned char ScopeUserName[32];
1285+};
1286
1287 #pragma pack(pop)
1288
1289--- a/fs/novfs/daemon.c
1290+++ b/fs/novfs/daemon.c
1291@@ -16,7 +16,6 @@
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>
1299@@ -44,14 +43,13 @@
1300 #define DH_TYPE_STREAM 1
1301 #define DH_TYPE_CONNECTION 2
1302
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 */
1309-} daemon_queue_t;
1310+};
1311
1312-typedef struct _DAEMON_COMMAND {
1313+struct daemon_cmd {
1314 struct list_head list; /* Must be first entry */
1315 atomic_t reference;
1316 unsigned int status;
1317@@ -65,61 +63,44 @@ typedef struct _DAEMON_COMMAND {
1318 int datalen;
1319 void *reply;
1320 unsigned long replen;
1321-} daemon_command_t;
1322+};
1323
1324-typedef struct _DAEMON_HANDLE_ {
1325+struct daemon_handle {
1326 struct list_head list;
1327 rwlock_t lock;
1328- session_t session;
1329-} daemon_handle_t;
1330+ struct novfs_schandle session;
1331+};
1332
1333-typedef struct _DAEMON_RESOURCE_ {
1334+struct daemon_resource {
1335 struct list_head list;
1336 int type;
1337- HANDLE connection;
1338+ void *connection;
1339 unsigned char handle[6];
1340 mode_t mode;
1341 loff_t size;
1342-} daemon_resource_t;
1343+};
1344
1345-typedef struct _DRIVE_MAP_ {
1346+struct drive_map {
1347 struct list_head list; /* Must be first item */
1348- session_t session;
1349+ struct novfs_schandle session;
1350 unsigned long hash;
1351 int namelen;
1352 char name[1];
1353-} drive_map_t;
1354+};
1355+
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);
1365
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);
1375-
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);
1393
1394 /*===[ Global variables ]=================================================*/
1395-static daemon_queue_t Daemon_Queue;
1396+static struct daemon_queue Daemon_Queue;
1397
1398 static DECLARE_WAIT_QUEUE_HEAD(Read_waitqueue);
1399
1400@@ -131,51 +112,24 @@ static unsigned long Daemon_Command_Time
1401 static DECLARE_MUTEX(DriveMapLock);
1402 static LIST_HEAD(DriveMapList);
1403
1404-int MaxIoSize = PAGE_SIZE;
1405+int novfs_max_iosize = PAGE_SIZE;
1406
1407-void Init_Daemon_Queue(void)
1408+void novfs_daemon_queue_init()
1409 {
1410 INIT_LIST_HEAD(&Daemon_Queue.list);
1411 spin_lock_init(&Daemon_Queue.lock);
1412 init_MUTEX_LOCKED(&Daemon_Queue.semaphore);
1413 }
1414
1415-/*++======================================================================*/
1416-void Uninit_Daemon_Queue(void)
1417-/*
1418- *
1419- * Arguments:
1420- *
1421- * Returns:
1422- *
1423- * Abstract:
1424- *
1425- * Notes:
1426- *
1427- * Environment:
1428- *
1429- *========================================================================*/
1430+void novfs_daemon_queue_exit(void)
1431 {
1432 /* Does nothing for now but we maybe should clear the queue. */
1433 }
1434
1435 /*++======================================================================*/
1436-void Daemon_Timer(unsigned long data)
1437-/*
1438- *
1439- * Arguments:
1440- *
1441- * Returns:
1442- *
1443- * Abstract:
1444- *
1445- * Notes:
1446- *
1447- * Environment:
1448- *
1449- *========================================================================*/
1450+static void novfs_daemon_timer(unsigned long data)
1451 {
1452- daemon_command_t *que = (daemon_command_t *) data;
1453+ struct daemon_cmd *que = (struct daemon_cmd *) data;
1454
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);
1459 }
1460
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,
1465+ void *data,
1466+ int dlen,
1467 void **reply, unsigned long * replen, int interruptible)
1468-/*
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- *========================================================================*/
1472 {
1473- daemon_command_t *que;
1474+ struct daemon_cmd *que;
1475 int retCode = 0;
1476 uint64_t ts1, ts2;
1477
1478@@ -201,6 +155,7 @@ int Queue_Daemon_Command(void *request,
1479 if (atomic_read(&Daemon_Open_Count)) {
1480
1481 que = kmalloc(sizeof(*que), GFP_KERNEL);
1482+
1483 DbgPrint("Queue_Daemon_Command: que=0x%p\n", que);
1484 if (que) {
1485 atomic_set(&que->reference, 0);
1486@@ -211,7 +166,7 @@ int Queue_Daemon_Command(void *request,
1487
1488 que->sequence = atomic_inc_return(&Sequence);
1489
1490- ((PCOMMAND_REQUEST_HEADER) request)->SequenceNumber =
1491+ ((struct novfs_command_request_header *) request)->SequenceNumber =
1492 que->sequence;
1493
1494 /*
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);
1502
1503 /*
1504@@ -317,41 +272,13 @@ int Queue_Daemon_Command(void *request,
1505 return (retCode);
1506 }
1507
1508-/*++======================================================================*/
1509-void Queue_get(daemon_command_t * Que)
1510-/*
1511- *
1512- * Arguments:
1513- *
1514- * Returns:
1515- *
1516- * Abstract:
1517- *
1518- * Notes:
1519- *
1520- * Environment:
1521- *
1522- *========================================================================*/
1523+static void Queue_get(struct daemon_cmd * Que)
1524 {
1525 DbgPrint("Queue_get: que=0x%p %d\n", Que, atomic_read(&Que->reference));
1526 atomic_inc(&Que->reference);
1527 }
1528
1529-/*++======================================================================*/
1530-void Queue_put(daemon_command_t * Que)
1531-/*
1532- *
1533- * Arguments:
1534- *
1535- * Returns:
1536- *
1537- * Abstract:
1538- *
1539- * Notes:
1540- *
1541- * Environment:
1542- *
1543- *========================================================================*/
1544+static void Queue_put(struct daemon_cmd * Que)
1545 {
1546
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)
1549 }
1550 }
1551
1552-/*++======================================================================*/
1553-daemon_command_t *get_next_queue(int Set_Queue_Waiting)
1554-/*
1555- *
1556- * Arguments:
1557- *
1558- * Returns:
1559- *
1560- * Abstract:
1561- *
1562- * Notes:
1563- *
1564- * Environment:
1565- *
1566- *========================================================================*/
1567+struct daemon_cmd *get_next_queue(int Set_Queue_Waiting)
1568 {
1569- daemon_command_t *que;
1570+ struct daemon_cmd *que;
1571
1572 DbgPrint("get_next_queue: que=0x%p\n", Daemon_Queue.list.next);
1573
1574 spin_lock(&Daemon_Queue.lock);
1575- que = (daemon_command_t *) Daemon_Queue.list.next;
1576+ que = (struct daemon_cmd *) Daemon_Queue.list.next;
1577
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;
1583 }
1584
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)) {
1588 que = NULL;
1589 } else if (Set_Queue_Waiting) {
1590@@ -418,36 +331,22 @@ daemon_command_t *get_next_queue(int Set
1591 return (que);
1592 }
1593
1594-/*++======================================================================*/
1595-daemon_command_t *find_queue(unsigned long sequence)
1596-/*
1597- *
1598- * Arguments:
1599- *
1600- * Returns:
1601- *
1602- * Abstract:
1603- *
1604- * Notes:
1605- *
1606- * Environment:
1607- *
1608- *========================================================================*/
1609+static struct daemon_cmd *find_queue(unsigned long sequence)
1610 {
1611- daemon_command_t *que;
1612+ struct daemon_cmd *que;
1613
1614 DbgPrint("find_queue: 0x%x\n", sequence);
1615
1616 spin_lock(&Daemon_Queue.lock);
1617- que = (daemon_command_t *) Daemon_Queue.list.next;
1618+ que = (struct daemon_cmd *) Daemon_Queue.list.next;
1619
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;
1625 }
1626
1627 if ((NULL == que)
1628- || (que == (daemon_command_t *) & Daemon_Queue.list.next)
1629+ || (que == (struct daemon_cmd *) & Daemon_Queue.list.next)
1630 || (que->sequence != sequence)) {
1631 que = NULL;
1632 }
1633@@ -462,21 +361,7 @@ daemon_command_t *find_queue(unsigned lo
1634 return (que);
1635 }
1636
1637-/*++======================================================================*/
1638-int Daemon_Open_Control(struct inode *Inode, struct file *File)
1639-/*
1640- *
1641- * Arguments:
1642- *
1643- * Returns:
1644- *
1645- * Abstract:
1646- *
1647- * Notes:
1648- *
1649- * Environment:
1650- *
1651- *========================================================================*/
1652+int novfs_daemon_open_control(struct inode *Inode, struct file *File)
1653 {
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
1657 return (0);
1658 }
1659
1660-/*++======================================================================*/
1661-int Daemon_Close_Control(struct inode *Inode, struct file *File)
1662-/*
1663- *
1664- * Arguments:
1665- *
1666- * Returns:
1667- *
1668- * Abstract:
1669- *
1670- * Notes:
1671- *
1672- * Environment:
1673- *
1674- *========================================================================*/
1675+int novfs_daemon_close_control(struct inode *Inode, struct file *File)
1676 {
1677- daemon_command_t *que;
1678+ struct daemon_cmd *que;
1679
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
1683 */
1684
1685 spin_lock(&Daemon_Queue.lock);
1686- que = (daemon_command_t *) Daemon_Queue.list.next;
1687+ que = (struct daemon_cmd *) Daemon_Queue.list.next;
1688
1689 while (que
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);
1695
1696- que = (daemon_command_t *) que->list.next;
1697+ que = (struct daemon_cmd *) que->list.next;
1698 }
1699 spin_unlock(&Daemon_Queue.lock);
1700
1701 RemoveDriveMaps();
1702
1703- Scope_Cleanup();
1704+ novfs_scope_cleanup();
1705 }
1706
1707 return (0);
1708 }
1709
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)
1712 {
1713- daemon_command_t *que;
1714+ struct daemon_cmd *que;
1715 size_t retValue = 0;
1716 int Finished = 0;
1717- struct data_list *dlist;
1718+ struct novfs_data_list *dlist;
1719 int i, dcnt, bcnt, ccnt, error;
1720 char *vadr;
1721 unsigned long cpylen;
1722
1723 DbgPrint("Daemon_Send_Command: %u %lld\n", len, *off);
1724- if (len > MaxIoSize) {
1725- MaxIoSize = len;
1726+ if (len > novfs_max_iosize) {
1727+ novfs_max_iosize = len;
1728 }
1729
1730 while (!Finished) {
1731@@ -556,9 +427,9 @@ ssize_t Daemon_Send_Command(struct file
1732 retValue = len;
1733 }
1734 if (retValue > 0x80)
1735- mydump(0x80, que->request);
1736+ novfs_dump(0x80, que->request);
1737 else
1738- mydump(retValue, que->request);
1739+ novfs_dump(retValue, que->request);
1740
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",
1745 bcnt, vadr, buf);
1746 if (bcnt > 0x80)
1747- mydump(0x80,
1748+ novfs_dump(0x80,
1749 vadr);
1750 else
1751- mydump(bcnt,
1752+ novfs_dump(bcnt,
1753 vadr);
1754
1755 if (km_adr) {
1756@@ -646,14 +517,14 @@ ssize_t Daemon_Send_Command(struct file
1757 return (retValue);
1758 }
1759
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)
1762 {
1763- daemon_command_t *que;
1764+ struct daemon_cmd *que;
1765 size_t retValue = 0;
1766 void *reply;
1767 unsigned long sequence, cpylen;
1768
1769- struct data_list *dlist;
1770+ struct novfs_data_list *dlist;
1771 char *vadr;
1772 int i;
1773
1774@@ -727,9 +598,9 @@ ssize_t Daemon_Receive_Reply(struct file
1775 thiscopy);
1776
1777 if (thiscopy > 0x80)
1778- mydump(0x80, vadr);
1779+ novfs_dump(0x80, vadr);
1780 else
1781- mydump(thiscopy, vadr);
1782+ novfs_dump(thiscopy, vadr);
1783
1784 if (km_adr) {
1785 kunmap(dlist->page);
1786@@ -743,17 +614,20 @@ ssize_t Daemon_Receive_Reply(struct file
1787 que->replen = retValue;
1788 } else {
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",
1792+ reply);
1793 if (reply) {
1794 retValue = nbytes;
1795 que->reply = reply;
1796 que->replen = nbytes;
1797
1798- retValue -= copy_from_user(reply, buf, retValue);
1799+ retValue -=
1800+ copy_from_user(reply, buf,
1801+ retValue);
1802 if (retValue > 0x80)
1803- mydump(0x80, reply);
1804+ novfs_dump(0x80, reply);
1805 else
1806- mydump(retValue, reply);
1807+ novfs_dump(retValue, reply);
1808
1809 } else {
1810 retValue = -ENOMEM;
1811@@ -775,10 +649,11 @@ ssize_t Daemon_Receive_Reply(struct file
1812 return (retValue);
1813 }
1814
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)
1818 {
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;
1829
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);
1834 if (reply) {
1835 if (reply->Reply.ErrorCode) {
1836 retCode = reply->Reply.ErrorCode;
1837@@ -827,18 +702,18 @@ int do_login(NclString *Server, NclStrin
1838 }
1839 memset(cmd, 0, cmdlen);
1840 kfree(cmd);
1841- return retCode;
1842+ return (retCode);
1843
1844 }
1845
1846-int do_logout(struct qstr *Server, struct schandle *Session)
1847+int novfs_daemon_logout(struct qstr *Server, struct novfs_schandle *Session)
1848 {
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;
1855
1856- cmdlen = offsetof(LOGOUT_REQUEST, Name) + Server->len;
1857+ cmdlen = offsetof(struct novfs_logout_request, Name) + Server->len;
1858 cmd = kmalloc(cmdlen, GFP_KERNEL);
1859 if (!cmd)
1860 return -ENOMEM;
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);
1864
1865- retCode = Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
1866+ retCode =
1867+ Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
1868 if (reply) {
1869 if (reply->Reply.ErrorCode) {
1870 retCode = -EIO;
1871@@ -861,24 +737,10 @@ int do_logout(struct qstr *Server, struc
1872
1873 }
1874
1875-/*++======================================================================*/
1876-int Daemon_getpwuid(uid_t uid, int unamelen, char *uname)
1877-/*
1878- *
1879- * Arguments:
1880- *
1881- * Returns:
1882- *
1883- * Abstract:
1884- *
1885- * Notes:
1886- *
1887- * Environment:
1888- *
1889- *========================================================================*/
1890+int novfs_daemon_getpwuid(uid_t uid, int unamelen, char *uname)
1891 {
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;
1897 int retCode;
1898
1899@@ -896,7 +758,9 @@ int Daemon_getpwuid(uid_t uid, int uname
1900 } else {
1901 retCode = 0;
1902 memset(uname, 0, unamelen);
1903- replylen = replylen - offsetof(GETPWUID_REPLY, UserName);
1904+ replylen =
1905+ replylen - offsetof(struct
1906+ novfs_getpwuid_reply, UserName);
1907 if (replylen) {
1908 if (replylen > unamelen) {
1909 retCode = -EINVAL;
1910@@ -911,24 +775,10 @@ int Daemon_getpwuid(uid_t uid, int uname
1911
1912 }
1913
1914-/*++======================================================================*/
1915-int Daemon_getversion(char *Buf, int length)
1916-/*
1917- *
1918- * Arguments:
1919- *
1920- * Returns:
1921- *
1922- * Abstract:
1923- *
1924- * Notes:
1925- *
1926- * Environment:
1927- *
1928- *========================================================================*/
1929+int novfs_daemon_getversion(char *Buf, int length)
1930 {
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;
1936 int retVal = 0;
1937
1938@@ -942,7 +792,9 @@ int Daemon_getversion(char *Buf, int len
1939 if (reply->Reply.ErrorCode) {
1940 retVal = -EIO;
1941 } else {
1942- retVal = replylen - offsetof(GET_VERSION_REPLY, Version);
1943+ retVal =
1944+ replylen - offsetof(struct
1945+ novfs_get_version_reply, Version);
1946 if (retVal < length) {
1947 memcpy(Buf, reply->Version, retVal);
1948 Buf[retVal] = '\0';
1949@@ -954,13 +806,13 @@ int Daemon_getversion(char *Buf, int len
1950
1951 }
1952
1953-static int daemon_login(struct login *Login, struct schandle *Session)
1954+static int daemon_login(struct novfs_login *Login, struct novfs_schandle *Session)
1955 {
1956 int retCode = -ENOMEM;
1957- struct login lLogin;
1958- NclString server;
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;
1965
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)
1982+ {
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);
1988 if (!retCode) {
1989- char *name;
1990- name = Scope_Get_UserName();
1991- if (name)
1992- Novfs_Add_to_Root(name);
1993+ char *username;
1994+ username = novfs_scope_get_username();
1995+ if (username) {
1996+ novfs_add_to_root(username);
1997+ }
1998 }
1999 }
2000- memset(password.buffer, 0, password.len);
2001 kfree(password.buffer);
2002 }
2003 }
2004- memset(username.buffer, 0, username.len);
2005 kfree(username.buffer);
2006 }
2007 }
2008@@ -1001,32 +853,30 @@ static int daemon_login(struct login *Lo
2009 return (retCode);
2010 }
2011
2012-static int daemon_logout(struct logout *Logout, struct schandle *Session)
2013+static int daemon_logout(struct novfs_logout *Logout, struct novfs_schandle *Session)
2014 {
2015- struct logout lLogout;
2016+ struct novfs_logout lLogout;
2017 struct qstr server;
2018- int retCode = -ENOMEM;
2019+ int retCode = 0;
2020
2021 if (copy_from_user(&lLogout, Logout, sizeof(lLogout)))
2022 return -EFAULT;
2023-
2024 server.name = kmalloc(lLogout.Server.length, GFP_KERNEL);
2025 if (!server.name)
2026 return -ENOMEM;
2027 server.len = lLogout.Server.length;
2028 if (copy_from_user((void *)server.name, lLogout.Server.data, server.len))
2029 goto exit;
2030-
2031- retCode = do_logout(&server, Session);
2032+ retCode = novfs_daemon_logout(&server, Session);
2033 exit:
2034 kfree(server.name);
2035- return retCode;
2036+ return (retCode);
2037 }
2038
2039-int Daemon_CreateSessionId(struct schandle *SessionId)
2040+int novfs_daemon_create_sessionId(struct novfs_schandle * SessionId)
2041 {
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;
2047 int retCode = 0;
2048
2049@@ -1041,7 +891,7 @@ int Daemon_CreateSessionId(struct schand
2050 &replylen, INTERRUPTIBLE);
2051 if (reply) {
2052 if (!reply->Reply.ErrorCode
2053- && replylen > sizeof(COMMAND_REPLY_HEADER)) {
2054+ && replylen > sizeof(struct novfs_command_reply_header)) {
2055 *SessionId = reply->SessionId;
2056 retCode = 0;
2057 } else {
2058@@ -1055,26 +905,26 @@ int Daemon_CreateSessionId(struct schand
2059 return (retCode);
2060 }
2061
2062-int Daemon_DestroySessionId(struct schandle *SessionId)
2063+int novfs_daemon_destroy_sessionId(struct novfs_schandle SessionId)
2064 {
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;
2070 int retCode = 0;
2071
2072- DbgPrint("Daemon_DestroySessionId: 0x%p:%p\n",
2073- SessionId->hTypeId, SessionId->hId);
2074+ DbgPrint("Daemon_DestroySessionId: 0x%p:%p\n", SessionId.hTypeId,
2075+ SessionId.hId);
2076
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;
2081
2082 retCode =
2083 Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
2084 &replylen, INTERRUPTIBLE);
2085 if (reply) {
2086 if (!reply->Reply.ErrorCode) {
2087- drive_map_t *dm;
2088+ struct drive_map *dm;
2089 struct list_head *list;
2090
2091 retCode = 0;
2092@@ -1085,11 +935,8 @@ int Daemon_DestroySessionId(struct schan
2093 */
2094 down(&DriveMapLock);
2095 list_for_each(list, &DriveMapList) {
2096- struct schandle *temp;
2097-
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);
2104 list = list->prev;
2105 list_del(&dm->list);
2106@@ -1107,21 +954,21 @@ int Daemon_DestroySessionId(struct schan
2107 return (retCode);
2108 }
2109
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)
2114 {
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;
2120 int retCode = 0;
2121
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,
2125+ SessionId.hId);
2126
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;
2131
2132 retCode =
2133 Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
2134@@ -1151,36 +998,22 @@ int Daemon_Get_UserSpace(struct schandle
2135 return (retCode);
2136 }
2137
2138-/*++======================================================================*/
2139-int Daemon_SetMountPoint(char *Path)
2140-/*
2141- *
2142- * Arguments:
2143- *
2144- * Returns:
2145- *
2146- * Abstract:
2147- *
2148- * Notes:
2149- *
2150- * Environment:
2151- *
2152- *========================================================================*/
2153+int novfs_daemon_set_mnt_point(char *Path)
2154 {
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;
2161
2162 DbgPrint("Daemon_SetMountPoint: %s\n", Path);
2163
2164 replylen = strlen(Path);
2165- cmdlen = sizeof(SET_MOUNT_PATH_REQUEST) + replylen;
2166+
2167+ cmdlen = sizeof(struct novfs_set_mount_path) + replylen;
2168
2169 cmd = kmalloc(cmdlen, GFP_KERNEL);
2170 if (!cmd)
2171 return -ENOMEM;
2172-
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)
2177
2178 replylen = 0;
2179
2180- retCode = Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
2181+ retCode =
2182+ Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
2183+ &replylen, INTERRUPTIBLE);
2184 if (reply) {
2185 if (!reply->Reply.ErrorCode) {
2186 retCode = 0;
2187@@ -1203,27 +1038,13 @@ int Daemon_SetMountPoint(char *Path)
2188 return retCode;
2189 }
2190
2191-/*++======================================================================*/
2192-int Daemon_SendDebugCmd(char *Command)
2193-/*
2194- *
2195- * Arguments:
2196- *
2197- * Returns:
2198- *
2199- * Abstract:
2200- *
2201- * Notes:
2202- *
2203- * Environment:
2204- *
2205- *========================================================================*/
2206-{
2207- DEBUG_REQUEST cmd;
2208- PDEBUG_REPLY reply;
2209- DEBUG_REPLY lreply;
2210+int novfs_daemon_debug_cmd_send(char *Command)
2211+{
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];
2218
2219 int retCode = -ENOMEM;
2220
2221@@ -1239,7 +1060,7 @@ int Daemon_SendDebugCmd(char *Command)
2222 dlist[1].len = sizeof(lreply);
2223 dlist[1].rwflag = DLWRITE;
2224
2225- cmdlen = offsetof(DEBUG_REQUEST, dbgcmd);
2226+ cmdlen = offsetof(struct novfs_debug_request, dbgcmd);
2227
2228 cmd.Command.CommandType = VFS_COMMAND_DBG;
2229 cmd.Command.SequenceNumber = 0;
2230@@ -1248,7 +1069,9 @@ int Daemon_SendDebugCmd(char *Command)
2231
2232 replylen = 0;
2233
2234- retCode = Queue_Daemon_Command(&cmd, cmdlen, dlist, 2, (void *)&reply, &replylen, INTERRUPTIBLE);
2235+ retCode =
2236+ Queue_Daemon_Command(&cmd, cmdlen, dlist, 2, (void *)&reply,
2237+ &replylen, INTERRUPTIBLE);
2238 if (reply) {
2239 kfree(reply);
2240 }
2241@@ -1259,21 +1082,20 @@ int Daemon_SendDebugCmd(char *Command)
2242 return (retCode);
2243 }
2244
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)
2247 {
2248 int retCode = -ENOSYS;
2249 unsigned long cpylen;
2250- struct schandle session_id;
2251-
2252- session_id = Scope_Get_SessionId(NULL);
2253+ struct novfs_schandle session_id;
2254+ session_id = novfs_scope_get_sessionId(NULL);
2255
2256 switch (cmd) {
2257 case IOC_LOGIN:
2258- retCode = daemon_login((struct login *)arg, &session_id);
2259+ retCode = daemon_login((struct novfs_login *) arg, &session_id);
2260 break;
2261
2262 case IOC_LOGOUT:
2263- retCode = daemon_logout((struct logout *) arg, &session_id);
2264+ retCode = daemon_logout((struct novfs_logout *)arg, &session_id);
2265 break;
2266 case IOC_DEBUGPRINT:
2267 {
2268@@ -1302,7 +1124,7 @@ int Daemon_ioctl(struct inode *inode, st
2269
2270 case IOC_XPLAT:
2271 {
2272- XPLAT data;
2273+ struct novfs_xplat data;
2274
2275 cpylen =
2276 copy_from_user(&data, (void *)arg, sizeof(data));
2277@@ -1324,23 +1146,29 @@ int Daemon_ioctl(struct inode *inode, st
2278 return (retCode);
2279 }
2280
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)
2284 {
2285- daemon_resource_t *resource;
2286+ struct daemon_resource *resource;
2287
2288 if (FHandle)
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);
2290+ DbgPrint
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);
2293 else
2294- DbgPrint("Daemon_Added_Resource: DHandle=0x%p Type=%d CHandle=0x%p\n", DHandle, Type, CHandle);
2295+ DbgPrint
2296+ ("Daemon_Added_Resource: DHandle=0x%p Type=%d CHandle=0x%p\n",
2297+ DHandle, Type, CHandle);
2298
2299- resource = kmalloc(sizeof(daemon_resource_t), GFP_KERNEL);
2300+ resource = kmalloc(sizeof(struct daemon_resource), GFP_KERNEL);
2301 if (!resource)
2302 return -ENOMEM;
2303
2304 resource->type = Type;
2305 resource->connection = CHandle;
2306 if (FHandle)
2307- memcpy(resource->handle, FHandle, sizeof(resource->handle));
2308+ memcpy(resource->handle, FHandle,
2309+ sizeof(resource->handle));
2310 else
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);
2318-
2319+ DbgPrint("Daemon_Added_Resource: Adding resource=0x%p\n",
2320+ resource);
2321 return 0;
2322 }
2323
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)
2328-/*
2329- *
2330- * Arguments:
2331- *
2332- * Returns:
2333- *
2334- * Abstract:
2335- *
2336- * Notes:
2337- *
2338- * Environment:
2339- *
2340- *========================================================================*/
2341 {
2342- daemon_resource_t *resource;
2343+ struct daemon_resource *resource;
2344 struct list_head *l;
2345 int retVal = -ENOMEM;
2346
2347@@ -1381,7 +1195,7 @@ int Daemon_Remove_Resource(daemon_handle
2348 write_lock(&DHandle->lock);
2349
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);
2353
2354 if ((Type == resource->type) &&
2355 (resource->connection == CHandle)) {
2356@@ -1400,76 +1214,59 @@ int Daemon_Remove_Resource(daemon_handle
2357 return (retVal);
2358 }
2359
2360-int Daemon_Library_open(struct inode *inode, struct file *file)
2361+int novfs_daemon_lib_open(struct inode *inode, struct file *file)
2362 {
2363- daemon_handle_t *dh;
2364+ struct daemon_handle *dh;
2365
2366 DbgPrint("Daemon_Library_open: inode=0x%p file=0x%p\n", inode, file);
2367-
2368- dh = kmalloc(sizeof(daemon_handle_t), GFP_KERNEL);
2369+ dh = kmalloc(sizeof(struct daemon_handle), GFP_KERNEL);
2370 if (!dh)
2371 return -ENOMEM;
2372-
2373 file->private_data = dh;
2374 INIT_LIST_HEAD(&dh->list);
2375 rwlock_init(&dh->lock);
2376- dh->session = Scope_Get_SessionId(NULL);
2377-
2378+ dh->session = novfs_scope_get_sessionId(NULL);
2379 return 0;
2380 }
2381
2382-/*++======================================================================*/
2383-int Daemon_Library_close(struct inode *inode, struct file *file)
2384-/*
2385- *
2386- * Arguments:
2387- *
2388- * Returns:
2389- *
2390- * Abstract:
2391- *
2392- * Notes:
2393- *
2394- * Environment:
2395- *
2396- *========================================================================*/
2397+int novfs_daemon_lib_close(struct inode *inode, struct file *file)
2398 {
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;
2404
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;
2414
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;
2419
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);
2423
2424 if (DH_TYPE_STREAM == resource->type) {
2425- Novfs_Close_Stream(resource->connection,
2426+ novfs_close_stream(resource->connection,
2427 resource->handle,
2428 dh->session);
2429 } else if (DH_TYPE_CONNECTION == resource->type) {
2430- cmd = (PXPLAT_CALL_REQUEST) commanddata;
2431+ cmd = (struct novfs_xplat_call_request *) commanddata;
2432 cmdlen =
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;
2442
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;
2450
2451 Queue_Daemon_Command((void *)cmd, cmdlen, NULL,
2452 0, (void **)&reply,
2453@@ -1488,10 +1285,11 @@ int Daemon_Library_close(struct inode *i
2454 return (0);
2455 }
2456
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,
2459+ loff_t * off)
2460 {
2461- daemon_handle_t *dh;
2462- daemon_resource_t *resource;
2463+ struct daemon_handle *dh;
2464+ struct daemon_resource *resource;
2465
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) {
2471 resource =
2472- list_entry(dh->list.next, daemon_resource_t, list);
2473+ list_entry(dh->list.next, struct daemon_resource, list);
2474
2475 if (DH_TYPE_STREAM == resource->type) {
2476 while (len > 0 && (offset < resource->size)) {
2477 thisread = len;
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
2484 return (totalread);
2485 }
2486
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,
2489+ loff_t * off)
2490 {
2491- daemon_handle_t *dh;
2492- daemon_resource_t *resource;
2493+ struct daemon_handle *dh;
2494+ struct daemon_resource *resource;
2495
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) {
2501 resource =
2502- list_entry(dh->list.next, daemon_resource_t, list);
2503+ list_entry(dh->list.next, struct daemon_resource, list);
2504
2505 if ((DH_TYPE_STREAM == resource->type) && (len >= 0)) {
2506 totalwrite = 0;
2507 do {
2508 thiswrite = len;
2509 status =
2510- Novfs_Write_Stream(resource->
2511+ novfs_write_stream(resource->
2512 connection,
2513 resource->handle,
2514 (void *)buf,
2515@@ -1590,24 +1389,10 @@ ssize_t Daemon_Library_write(struct file
2516 return (totalwrite);
2517 }
2518
2519-/*++======================================================================*/
2520-loff_t Daemon_Library_llseek(struct file * file, loff_t offset, int origin)
2521-/*
2522- *
2523- * Arguments:
2524- *
2525- * Returns:
2526- *
2527- * Abstract:
2528- *
2529- * Notes:
2530- *
2531- * Environment:
2532- *
2533- *========================================================================*/
2534+loff_t novfs_daemon_lib_llseek(struct file * file, loff_t offset, int origin)
2535 {
2536- daemon_handle_t *dh;
2537- daemon_resource_t *resource;
2538+ struct daemon_handle *dh;
2539+ struct daemon_resource *resource;
2540
2541 loff_t retVal = -EINVAL;
2542
2543@@ -1619,7 +1404,7 @@ loff_t Daemon_Library_llseek(struct file
2544 read_lock(&dh->lock);
2545 if (&dh->list != dh->list.next) {
2546 resource =
2547- list_entry(dh->list.next, daemon_resource_t, list);
2548+ list_entry(dh->list.next, struct daemon_resource, list);
2549
2550 if (DH_TYPE_STREAM == resource->type) {
2551 switch (origin) {
2552@@ -1646,11 +1431,11 @@ loff_t Daemon_Library_llseek(struct file
2553 return retVal;
2554 }
2555
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)
2558 {
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;
2565
2566 dh = file->private_data;
2567@@ -1662,11 +1447,11 @@ int Daemon_Library_ioctl(struct inode *i
2568
2569 switch (cmd) {
2570 case IOC_LOGIN:
2571- retCode = daemon_login((struct login *)arg, &dh->session);
2572+ retCode = daemon_login((struct novfs_login *)arg, &dh->session);
2573 break;
2574
2575 case IOC_LOGOUT:
2576- retCode = daemon_logout((struct logout *)arg, &dh->session);
2577+ retCode = daemon_logout((struct novfs_logout *)arg, &dh->session);
2578 break;
2579
2580 case IOC_DEBUGPRINT:
2581@@ -1681,10 +1466,14 @@ int Daemon_Library_ioctl(struct inode *i
2582 copy_from_user(&io, (void *)arg,
2583 sizeof(io));
2584 if (io.length) {
2585- buf = kmalloc(io.length + 1, GFP_KERNEL);
2586+ buf =
2587+ kmalloc(io.length + 1,
2588+ GFP_KERNEL);
2589 if (buf) {
2590 buf[0] = 0;
2591- cpylen = copy_from_user(buf, io.data, io.length);
2592+ cpylen =
2593+ copy_from_user(buf, io.data,
2594+ io.length);
2595 buf[io.length] = '\0';
2596 DbgPrint("%s", buf);
2597 kfree(buf);
2598@@ -1696,7 +1485,7 @@ int Daemon_Library_ioctl(struct inode *i
2599
2600 case IOC_XPLAT:
2601 {
2602- XPLAT data;
2603+ struct novfs_xplat data;
2604
2605 cpylen =
2606 copy_from_user(&data, (void *)arg,
2607@@ -1707,61 +1496,79 @@ int Daemon_Library_ioctl(struct inode *i
2608
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);
2613+ DbgPrint
2614+ ("[VFS XPLAT] Call NwOpenConnByName\n");
2615+ retCode =
2616+ novfs_open_conn_by_name(&data,
2617+ &handle, dh->session);
2618 if (!retCode)
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);
2622 break;
2623
2624 case NWC_OPEN_CONN_BY_ADDRESS:
2625- DbgPrint("[VFS XPLAT] Call NwOpenConnByAddress\n");
2626- retCode = NwOpenConnByAddr(&data, &handle, dh->session);
2627+ DbgPrint
2628+ ("[VFS XPLAT] Call NwOpenConnByAddress\n");
2629+ retCode =
2630+ novfs_open_conn_by_addr(&data, &handle,
2631+ dh->session);
2632 if (!retCode)
2633- Daemon_Added_Resource(dh, DH_TYPE_CONNECTION, handle, NULL, 0, 0);
2634+ daemon_added_resource(dh,
2635+ DH_TYPE_CONNECTION,
2636+ handle, 0,
2637+ 0, 0);
2638 break;
2639
2640 case NWC_OPEN_CONN_BY_REFERENCE:
2641- DbgPrint("[VFS XPLAT] Call NwOpenConnByReference\n");
2642- retCode = NwOpenConnByRef(&data, &handle, dh->session);
2643+
2644+ DbgPrint
2645+ ("[VFS XPLAT] Call NwOpenConnByReference\n");
2646+ retCode =
2647+ novfs_open_conn_by_ref(&data, &handle,
2648+ dh->session);
2649 if (!retCode)
2650- Daemon_Added_Resource(dh,
2651+ daemon_added_resource(dh,
2652 DH_TYPE_CONNECTION,
2653- handle, NULL,
2654+ handle, 0,
2655 0, 0);
2656 break;
2657
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);
2662+ retCode =
2663+ novfs_sys_conn_close(&data, (unsigned long *)&handle, dh->session);
2664+ daemon_remove_resource(dh, DH_TYPE_CONNECTION, handle, 0);
2665 break;
2666
2667 case NWC_CLOSE_CONN:
2668 DbgPrint
2669 ("[VFS XPLAT] Call NwCloseConn\n");
2670 retCode =
2671- NwConnClose(&data, &handle,
2672+ novfs_conn_close(&data, &handle,
2673 dh->session);
2674- Daemon_Remove_Resource(dh,
2675+ daemon_remove_resource(dh,
2676 DH_TYPE_CONNECTION,
2677 handle, 0);
2678 break;
2679
2680 case NWC_LOGIN_IDENTITY:
2681- DbgPrint("[VFS XPLAT] Call NwLoginIdentity\n");
2682- retCode = NwLoginIdentity(&data, &dh->session);
2683+ DbgPrint
2684+ ("[VFS XPLAT] Call NwLoginIdentity\n");
2685+ retCode =
2686+ novfs_login_id(&data, dh->session);
2687 break;
2688
2689 case NWC_RAW_NCP_REQUEST:
2690- DbgPrint("[VFS XPLAT] Send Raw NCP Request\n");
2691- retCode = NwRawSend(&data, dh->session);
2692+ DbgPrint
2693+ ("[VFS XPLAT] Send Raw NCP Request\n");
2694+ retCode = novfs_raw_send(&data, dh->session);
2695 break;
2696
2697 case NWC_AUTHENTICATE_CONN_WITH_ID:
2698 DbgPrint
2699 ("[VFS XPLAT] Authenticate Conn With ID\n");
2700 retCode =
2701- NwAuthConnWithId(&data,
2702+ novfs_auth_conn(&data,
2703 dh->session);
2704 break;
2705
2706@@ -1769,21 +1576,21 @@ int Daemon_Library_ioctl(struct inode *i
2707 DbgPrint
2708 ("[VFS XPLAT] UnAuthenticate Conn With ID\n");
2709 retCode =
2710- NwUnAuthenticate(&data,
2711+ novfs_unauthenticate(&data,
2712 dh->session);
2713 break;
2714
2715 case NWC_LICENSE_CONN:
2716 DbgPrint("Call NwLicenseConn\n");
2717 retCode =
2718- NwLicenseConn(&data, dh->session);
2719+ novfs_license_conn(&data, dh->session);
2720 break;
2721
2722 case NWC_LOGOUT_IDENTITY:
2723 DbgPrint
2724 ("[VFS XPLAT] Call NwLogoutIdentity\n");
2725 retCode =
2726- NwLogoutIdentity(&data,
2727+ novfs_logout_id(&data,
2728 dh->session);
2729 break;
2730
2731@@ -1791,35 +1598,35 @@ int Daemon_Library_ioctl(struct inode *i
2732 DbgPrint
2733 ("[VFS XPLAT] Call NwUnlicense\n");
2734 retCode =
2735- NwUnlicenseConn(&data, dh->session);
2736+ novfs_unlicense_conn(&data, dh->session);
2737 break;
2738
2739 case NWC_GET_CONN_INFO:
2740 DbgPrint
2741 ("[VFS XPLAT] Call NwGetConnInfo\n");
2742 retCode =
2743- NwGetConnInfo(&data, dh->session);
2744+ novfs_get_conn_info(&data, dh->session);
2745 break;
2746
2747 case NWC_SET_CONN_INFO:
2748 DbgPrint
2749 ("[VFS XPLAT] Call NwGetConnInfo\n");
2750 retCode =
2751- NwSetConnInfo(&data, dh->session);
2752+ novfs_set_conn_info(&data, dh->session);
2753 break;
2754
2755 case NWC_SCAN_CONN_INFO:
2756 DbgPrint
2757 ("[VFS XPLAT] Call NwScanConnInfo\n");
2758 retCode =
2759- NwScanConnInfo(&data, dh->session);
2760+ novfs_scan_conn_info(&data, dh->session);
2761 break;
2762
2763 case NWC_GET_IDENTITY_INFO:
2764 DbgPrint
2765 ("[VFS XPLAT] Call NwGetIdentityInfo\n");
2766 retCode =
2767- NwGetIdentityInfo(&data,
2768+ novfs_get_id_info(&data,
2769 dh->session);
2770 break;
2771
2772@@ -1827,7 +1634,7 @@ int Daemon_Library_ioctl(struct inode *i
2773 DbgPrint
2774 ("[VFS XPLAT] Call NwGetDaemonVersion\n");
2775 retCode =
2776- NwGetDaemonVersion(&data,
2777+ novfs_get_daemon_ver(&data,
2778 dh->session);
2779 break;
2780
2781@@ -1835,7 +1642,7 @@ int Daemon_Library_ioctl(struct inode *i
2782 DbgPrint
2783 ("[VFS XPLAT] Call NwcGetPreferredDsTree\n");
2784 retCode =
2785- NwcGetPreferredDSTree(&data,
2786+ novfs_get_preferred_DS_tree(&data,
2787 dh->session);
2788 break;
2789
2790@@ -1843,7 +1650,7 @@ int Daemon_Library_ioctl(struct inode *i
2791 DbgPrint
2792 ("[VFS XPLAT] Call NwcSetPreferredDsTree\n");
2793 retCode =
2794- NwcSetPreferredDSTree(&data,
2795+ novfs_set_preferred_DS_tree(&data,
2796 dh->session);
2797 break;
2798
2799@@ -1851,7 +1658,7 @@ int Daemon_Library_ioctl(struct inode *i
2800 DbgPrint
2801 ("[VFS XPLAT] Call NwcGetDefaultNameContext\n");
2802 retCode =
2803- NwcGetDefaultNameCtx(&data,
2804+ novfs_get_default_ctx(&data,
2805 dh->session);
2806 break;
2807
2808@@ -1859,7 +1666,7 @@ int Daemon_Library_ioctl(struct inode *i
2809 DbgPrint
2810 ("[VFS XPLAT] Call NwcSetDefaultNameContext\n");
2811 retCode =
2812- NwcSetDefaultNameCtx(&data,
2813+ novfs_set_default_ctx(&data,
2814 dh->session);
2815 break;
2816
2817@@ -1867,14 +1674,14 @@ int Daemon_Library_ioctl(struct inode *i
2818 DbgPrint
2819 ("[VFS XPLAT] Call NwQueryFeature\n");
2820 retCode =
2821- NwQueryFeature(&data, dh->session);
2822+ novfs_query_feature(&data, dh->session);
2823 break;
2824
2825 case NWC_GET_TREE_MONITORED_CONN_REF:
2826 DbgPrint
2827 ("[VFS XPLAT] Call NwcGetTreeMonitoredConn\n");
2828 retCode =
2829- NwcGetTreeMonitoredConn(&data,
2830+ novfs_get_tree_monitored_conn(&data,
2831 dh->
2832 session);
2833 break;
2834@@ -1883,7 +1690,7 @@ int Daemon_Library_ioctl(struct inode *i
2835 DbgPrint
2836 ("[VFS XPLAT] Call NwcEnumerateIdentities\n");
2837 retCode =
2838- NwcEnumIdentities(&data,
2839+ novfs_enum_ids(&data,
2840 dh->session);
2841 break;
2842
2843@@ -1891,7 +1698,7 @@ int Daemon_Library_ioctl(struct inode *i
2844 DbgPrint
2845 ("[VFS XPLAT] Call NwcChangeAuthKey\n");
2846 retCode =
2847- NwcChangeAuthKey(&data,
2848+ novfs_change_auth_key(&data,
2849 dh->session);
2850 break;
2851
2852@@ -1913,7 +1720,7 @@ int Daemon_Library_ioctl(struct inode *i
2853 DbgPrint
2854 ("[VFS XPLAT] Call NwcSetPrimaryConn\n");
2855 retCode =
2856- NwcSetPrimaryConn(&data,
2857+ novfs_set_pri_conn(&data,
2858 dh->session);
2859 break;
2860
2861@@ -1921,26 +1728,29 @@ int Daemon_Library_ioctl(struct inode *i
2862 DbgPrint
2863 ("[VFS XPLAT] Call NwcGetPrimaryConn\n");
2864 retCode =
2865- NwcGetPrimaryConn(&data,
2866+ novfs_get_pri_conn(&data,
2867 dh->session);
2868 break;
2869
2870 case NWC_MAP_DRIVE:
2871- DbgPrint("[VFS XPLAT] Call NwcMapDrive\n");
2872- retCode = NwdSetMapDrive(&data, dh->session);
2873+ DbgPrint
2874+ ("[VFS XPLAT] Call NwcMapDrive\n");
2875+ retCode =
2876+ set_map_drive(&data, dh->session);
2877 break;
2878
2879 case NWC_UNMAP_DRIVE:
2880 DbgPrint
2881 ("[VFS XPLAT] Call NwcUnMapDrive\n");
2882- retCode = NwdUnMapDrive(&data, dh->session);
2883+ retCode =
2884+ unmap_drive(&data, dh->session);
2885 break;
2886
2887 case NWC_ENUMERATE_DRIVES:
2888 DbgPrint
2889 ("[VFS XPLAT] Call NwcEnumerateDrives\n");
2890 retCode =
2891- NwcEnumerateDrives(&data,
2892+ novfs_enum_drives(&data,
2893 dh->session);
2894 break;
2895
2896@@ -1954,21 +1764,21 @@ int Daemon_Library_ioctl(struct inode *i
2897 DbgPrint
2898 ("[VSF XPLAT Call NwdGetBroadcastMessage\n");
2899 retCode =
2900- NwcGetBroadcastMessage(&data,
2901+ novfs_get_bcast_msg(&data,
2902 dh->session);
2903 break;
2904
2905 case NWC_SET_KEY:
2906 DbgPrint("[VSF XPLAT Call NwdSetKey\n");
2907 retCode =
2908- NwdSetKeyValue(&data, dh->session);
2909+ novfs_set_key_value(&data, dh->session);
2910 break;
2911
2912 case NWC_VERIFY_KEY:
2913 DbgPrint
2914 ("[VSF XPLAT Call NwdVerifyKey\n");
2915 retCode =
2916- NwdVerifyKeyValue(&data,
2917+ novfs_verify_key_value(&data,
2918 dh->session);
2919 break;
2920
2921@@ -1991,9 +1801,10 @@ int Daemon_Library_ioctl(struct inode *i
2922 return (retCode);
2923 }
2924
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)
2928 {
2929- daemon_command_t *que;
2930+ struct daemon_cmd *que;
2931 unsigned int mask = POLLOUT | POLLWRNORM;
2932
2933 que = get_next_queue(0);
2934@@ -2002,43 +1813,32 @@ unsigned int Daemon_Poll(struct file *fi
2935 return mask;
2936 }
2937
2938-int NwdConvertNetwareHandle(PXPLAT pdata, daemon_handle_t *DHandle)
2939+static int NwdConvertNetwareHandle(struct novfs_xplat *pdata, struct daemon_handle * DHandle)
2940 {
2941 int retVal;
2942- NwcConvertNetWareHandle nh;
2943+ struct nwc_convert_netware_handle nh;
2944 unsigned long cpylen;
2945
2946 DbgPrint("NwdConvertNetwareHandle: DHandle=0x%p\n", DHandle);
2947
2948- cpylen = copy_from_user(&nh, pdata->reqData, sizeof(NwcConvertNetWareHandle));
2949+ cpylen =
2950+ copy_from_user(&nh, pdata->reqData,
2951+ sizeof(struct nwc_convert_netware_handle));
2952+
2953+ retVal =
2954+ daemon_added_resource(DHandle, DH_TYPE_STREAM,
2955+ Uint32toHandle(nh.ConnHandle),
2956+ nh.NetWareHandle, nh.uAccessMode,
2957+ nh.uFileSize);
2958
2959- retVal = Daemon_Added_Resource(DHandle, DH_TYPE_STREAM,
2960- Uint32toHandle(nh.ConnHandle),
2961- nh.NetWareHandle, nh.uAccessMode,
2962- nh.uFileSize);
2963-
2964- return retVal;
2965+ return (retVal);
2966 }
2967
2968-/*++======================================================================*/
2969-int NwdConvertLocalHandle(PXPLAT pdata, daemon_handle_t * DHandle)
2970-/*
2971- *
2972- * Arguments:
2973- *
2974- * Returns:
2975- *
2976- * Abstract:
2977- *
2978- * Notes:
2979- *
2980- * Environment:
2981- *
2982- *========================================================================*/
2983+static int NwdConvertLocalHandle(struct novfs_xplat *pdata, struct daemon_handle * DHandle)
2984 {
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;
2992
2993@@ -2047,7 +1847,7 @@ int NwdConvertLocalHandle(PXPLAT pdata,
2994 read_lock(&DHandle->lock);
2995
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);
2999
3000 if (DH_TYPE_STREAM == resource->type) {
3001 lh.uConnReference =
3002@@ -2055,10 +1855,10 @@ int NwdConvertLocalHandle(PXPLAT pdata,
3003
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)) {
3008 cpylen =
3009 copy_to_user(pdata->repData, &lh,
3010- sizeof(NwcConvertLocalHandle));
3011+ sizeof(struct nwc_convert_local_handle));
3012 retVal = 0;
3013 } else {
3014 retVal = NWE_BUFFER_OVERFLOW;
3015@@ -2072,39 +1872,25 @@ int NwdConvertLocalHandle(PXPLAT pdata,
3016 return (retVal);
3017 }
3018
3019-/*++======================================================================*/
3020-int NwdGetMountPath(PXPLAT pdata)
3021-/*
3022- *
3023- * Arguments:
3024- *
3025- * Returns:
3026- *
3027- * Abstract:
3028- *
3029- * Notes:
3030- *
3031- * Environment:
3032- *
3033- *========================================================================*/
3034+static int NwdGetMountPath(struct novfs_xplat *pdata)
3035 {
3036 int retVal = NWE_REQUESTER_FAILURE;
3037 int len;
3038 unsigned long cpylen;
3039- NwcGetMountPath mp;
3040+ struct nwc_get_mount_path mp;
3041
3042 cpylen = copy_from_user(&mp, pdata->reqData, pdata->reqLen);
3043
3044- if (Novfs_CurrentMount) {
3045+ if (novfs_current_mnt) {
3046
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;
3051 } else {
3052 if (mp.pMountPath) {
3053 cpylen =
3054 copy_to_user(mp.pMountPath,
3055- Novfs_CurrentMount, len);
3056+ novfs_current_mnt, len);
3057 }
3058 retVal = 0;
3059 }
3060@@ -2119,52 +1905,55 @@ int NwdGetMountPath(PXPLAT pdata)
3061 return (retVal);
3062 }
3063
3064-static int NwdSetMapDrive(PXPLAT pdata, session_t Session)
3065+static int set_map_drive(struct novfs_xplat *pdata, struct novfs_schandle Session)
3066 {
3067 int retVal;
3068- NwcMapDriveEx symInfo;
3069+ unsigned long cpylen;
3070+ struct nwc_map_drive_ex symInfo;
3071 char *path;
3072- drive_map_t *drivemap, *dm;
3073+ struct drive_map *drivemap, *dm;
3074 struct list_head *list;
3075
3076- retVal = NwcSetMapDrive(pdata, Session);
3077+ retVal = novfs_set_map_drive(pdata, Session);
3078 if (retVal)
3079 return retVal;
3080-
3081 if (copy_from_user(&symInfo, pdata->reqData, sizeof(symInfo)))
3082 return -EFAULT;
3083-
3084- drivemap = kmalloc(sizeof(drive_map_t) + symInfo.linkOffsetLength, GFP_KERNEL);
3085+ drivemap =
3086+ kmalloc(sizeof(struct drive_map) + symInfo.linkOffsetLength,
3087+ GFP_KERNEL);
3088 if (!drivemap)
3089 return -ENOMEM;
3090
3091 path = (char *)pdata->reqData;
3092 path += symInfo.linkOffset;
3093- if (copy_from_user(drivemap->name, path, symInfo.linkOffsetLength)) {
3094- kfree(drivemap);
3095- return -EFAULT;
3096- }
3097+ cpylen =
3098+ copy_from_user(drivemap->name, path,
3099+ symInfo.linkOffsetLength);
3100
3101 drivemap->session = Session;
3102- drivemap->hash = full_name_hash(drivemap->name, symInfo.linkOffsetLength - 1);
3103+ drivemap->hash =
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);
3110
3111- dm = (drive_map_t *) & DriveMapList.next;
3112+ dm = (struct drive_map *) & DriveMapList.next;
3113
3114 down(&DriveMapLock);
3115
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"
3120- " hash: 0x%x\n"
3121- " namelen: %d\n"
3122- " name: %s\n",
3123- dm, dm->hash, dm->namelen, dm->name);
3124+ " hash: 0x%x\n"
3125+ " namelen: %d\n"
3126+ " name: %s\n",
3127+ dm, dm->hash, dm->namelen, dm->name);
3128
3129 if (drivemap->hash == dm->hash) {
3130 if (0 ==
3131- strcmp(dm->name, drivemap->name)) {
3132+ strcmp(dm->name, drivemap->name)) {
3133 dm = NULL;
3134 break;
3135 }
3136@@ -2174,59 +1963,57 @@ static int NwdSetMapDrive(PXPLAT pdata,
3137 }
3138
3139 if (dm) {
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);
3145 } else {
3146 list_add_tail(&drivemap->list,
3147- &dm->list);
3148+ &dm->list);
3149 }
3150- } else {
3151- kfree(drivemap);
3152 }
3153+ kfree(drivemap);
3154 up(&DriveMapLock);
3155-
3156 return (retVal);
3157 }
3158
3159-static int NwdUnMapDrive(PXPLAT pdata, session_t Session)
3160+static int unmap_drive(struct novfs_xplat *pdata, struct novfs_schandle Session)
3161 {
3162 int retVal = NWE_REQUESTER_FAILURE;
3163- NwcUnmapDriveEx symInfo;
3164+ struct nwc_unmap_drive_ex symInfo;
3165 char *path;
3166- drive_map_t *dm;
3167+ struct drive_map *dm;
3168 struct list_head *list;
3169 unsigned long hash;
3170
3171- retVal = NwcUnMapDrive(pdata, Session);
3172+
3173+ retVal = novfs_unmap_drive(pdata, Session);
3174 if (retVal)
3175 return retVal;
3176-
3177 if (copy_from_user(&symInfo, pdata->reqData, sizeof(symInfo)))
3178 return -EFAULT;
3179
3180 path = kmalloc(symInfo.linkLen, GFP_KERNEL);
3181 if (!path)
3182 return -ENOMEM;
3183-
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)) {
3186 kfree(path);
3187 return -EFAULT;
3188 }
3189
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,
3193+ path);
3194
3195 dm = NULL;
3196
3197 down(&DriveMapLock);
3198
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"
3203- " hash: 0x%x\n"
3204- " namelen: %d\n",
3205- dm, dm->name, dm->hash, dm->namelen);
3206+ " hash: 0x%x\n"
3207+ " namelen: %d\n",
3208+ dm, dm->name, dm->hash, dm->namelen);
3209
3210 if (hash == dm->hash) {
3211 if (0 == strcmp(dm->name, path)) {
3212@@ -2240,40 +2027,25 @@ static int NwdUnMapDrive(PXPLAT pdata, s
3213
3214 if (dm) {
3215 DbgPrint("NwdUnMapDrive: Remove dm=0x%p %s\n"
3216- " hash: 0x%x\n"
3217- " namelen: %d\n",
3218- dm, dm->name, dm->hash, dm->namelen);
3219+ " hash: 0x%x\n"
3220+ " namelen: %d\n",
3221+ dm, dm->name, dm->hash, dm->namelen);
3222 list_del(&dm->list);
3223 kfree(dm);
3224 }
3225
3226 up(&DriveMapLock);
3227-
3228- return retVal;
3229+ return (retVal);
3230 }
3231
3232-/*++======================================================================*/
3233-void RemoveDriveMaps(void)
3234-/*
3235- *
3236- * Arguments:
3237- *
3238- * Returns:
3239- *
3240- * Abstract:
3241- *
3242- * Notes:
3243- *
3244- * Environment:
3245- *
3246- *========================================================================*/
3247+static void RemoveDriveMaps(void)
3248 {
3249- drive_map_t *dm;
3250+ struct drive_map *dm;
3251 struct list_head *list;
3252
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);
3257
3258 DbgPrint("RemoveDriveMap: dm=0x%p\n"
3259 " hash: 0x%x\n"
3260@@ -2288,9 +2060,7 @@ void RemoveDriveMaps(void)
3261 up(&DriveMapLock);
3262 }
3263
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)
3268 {
3269 int error;
3270 struct dentry *dentry;
3271@@ -2341,60 +2111,3 @@ int local_unlink(const char *pathname)
3272 return error;
3273 }
3274
3275-#else
3276-/*++======================================================================*/
3277-int local_unlink(const char *pathname)
3278-{
3279- int error;
3280- struct dentry *dentry;
3281- struct nameidata nd;
3282- struct inode *inode = NULL;
3283-
3284- DbgPrint("local_unlink: %s\n", pathname);
3285- error = path_lookup(pathname, LOOKUP_PARENT, &nd);
3286- DbgPrint("local_unlink: path_lookup %d\n", error);
3287- if (!error) {
3288- error = -EISDIR;
3289- if (nd.last_type == LAST_NORM) {
3290- down(&nd.dentry->d_inode->i_sem);
3291- dentry =
3292- lookup_one_len(&nd.last, nd.dentry,
3293- sizeof(nd.last));
3294- DbgPrint("local_unlink: lookup_hash 0x%p\n", dentry);
3295-
3296- error = PTR_ERR(dentry);
3297- if (!IS_ERR(dentry)) {
3298- if (nd.last.name[nd.last.len]) {
3299- error =
3300- !dentry->
3301- d_inode ? -ENOENT : S_ISDIR(dentry->
3302- d_inode->
3303- i_mode)
3304- ? -EISDIR : -ENOTDIR;
3305- } else {
3306- inode = dentry->d_inode;
3307- if (inode) {
3308- atomic_inc(&inode->i_count);
3309- }
3310- error =
3311- vfs_unlink(nd.dentry->d_inode,
3312- dentry);
3313- DbgPrint
3314- ("local_unlink: vfs_unlink %d\n",
3315- error);
3316- }
3317- dput(dentry);
3318- }
3319- up(&nd.dentry->d_inode->i_sem);
3320- }
3321- path_release(&nd);
3322- }
3323-
3324- if (inode) {
3325- iput(inode); /* truncate the inode here */
3326- }
3327-
3328- DbgPrint("local_unlink: error=%d\n", error);
3329- return error;
3330-}
3331-#endif
3332--- a/fs/novfs/file.c
3333+++ b/fs/novfs/file.c
3334@@ -27,35 +27,11 @@
3335 #include "commands.h"
3336 #include "nwerror.h"
3337
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);
3341-
3342-int Novfs_Find_Name_In_List(struct qstr *Name, unsigned char * List);
3343-
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;
3366
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,
3371 };
3372
3373 /*
3374@@ -65,12 +41,12 @@ static struct file_operations Novfs_tree
3375 */
3376 static int StripTrailingDots = 1;
3377
3378-int Novfs_get_alltrees(struct dentry *parent)
3379+int novfs_get_alltrees(struct dentry *parent)
3380 {
3381 unsigned char *p;
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;
3387 int retCode;
3388 struct dentry *entry;
3389 struct qstr name;
3390@@ -81,30 +57,30 @@ int Novfs_get_alltrees(struct dentry *pa
3391 //sg ??? cmd.SessionId = 0x1234;
3392 SC_INITIALIZE(cmd.SessionId);
3393
3394- DbgPrint("Novfs_get_alltrees:\n");
3395+ DbgPrint("novfs_get_alltrees:\n");
3396
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,
3400 replylen);
3401 if (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;
3408 while (*p) {
3409- DbgPrint("Novfs_get_alltrees: %s\n", p);
3410+ DbgPrint("novfs_get_alltrees: %s\n", p);
3411 name.len = strlen(p);
3412 name.name = 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);
3419 if (entry) {
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);
3424 if (inode) {
3425- inode->i_fop = &Novfs_tree_operations;
3426+ inode->i_fop = &novfs_tree_operations;
3427 d_add(entry, inode);
3428 }
3429 }
3430@@ -117,7 +93,7 @@ int Novfs_get_alltrees(struct dentry *pa
3431 return (retCode);
3432 }
3433
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)
3436 {
3437 if (file->f_pos != 0) {
3438 return (0);
3439@@ -128,24 +104,24 @@ ssize_t Novfs_tree_read(struct file * fi
3440 return (5);
3441 }
3442
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)
3445 {
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;
3451 int retCode = 0;
3452
3453 *ServerList = NULL;
3454
3455 req.Command.CommandType = VFS_COMMAND_GET_CONNECTED_SERVER_LIST;
3456- memcpy(&req.Command.SessionId, SessionId, sizeof(*SessionId));
3457+ req.Command.SessionId = SessionId;
3458
3459 retCode =
3460 Queue_Daemon_Command(&req, sizeof(req), NULL, 0, (void *)&reply,
3461 &replylen, INTERRUPTIBLE);
3462 if (reply) {
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
3471 return (retCode);
3472 }
3473
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)
3478 {
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;
3484 int retCode;
3485
3486 *VolumeList = NULL;
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);
3490 if (!req)
3491 return -ENOMEM;
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;
3497
3498- retCode = Queue_Daemon_Command(req, reqlen, NULL, 0, (void *)&reply,
3499- &replylen, INTERRUPTIBLE);
3500+ retCode =
3501+ Queue_Daemon_Command(req, reqlen, NULL, 0, (void *)&reply,
3502+ &replylen, INTERRUPTIBLE);
3503 if (reply) {
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);
3510
3511 if (!reply->Reply.ErrorCode && replylen) {
3512 memcpy(reply, reply->List, replylen);
3513@@ -193,35 +170,19 @@ int Novfs_Get_Server_Volume_List(struct
3514 }
3515 }
3516 kfree(req);
3517- return retCode;
3518-}
3519-
3520-int Novfs_Find_Name_In_List(struct qstr *Name, unsigned char * List)
3521-{
3522- int len;
3523- int retCode = 0;
3524-
3525- while (*List) {
3526- len = strlen(List);
3527- if ((len == Name->len) && !strncmp(Name->name, List, len)) {
3528- retCode = 1;
3529- break;
3530- }
3531- List += (len + 1);
3532- }
3533 return (retCode);
3534 }
3535
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)
3538 {
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;
3544 int cmdlen;
3545 int retCode = -ENOENT;
3546 int pathlen;
3547
3548- DbgPrint("%s: Path = %s\n", __func__, Path);
3549+ DbgPrint("novfs_Get_File_Info: Path = %s\n", Path);
3550
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])
3555 pathlen--;
3556 }
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);
3561 if (cmd) {
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);
3568
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;
3576+ DbgPrint
3577+ ("novfs_Get_File_Info: replylen=%d sizeof(VERIFY_FILE_REPLY)=%d\n",
3578+ replylen,
3579+ sizeof(struct novfs_verify_file_reply));
3580+ if (replylen >
3581+ sizeof(struct novfs_verify_file_reply)) {
3582+ unsigned int *lp =
3583+ &reply->fileMode;
3584 lp++;
3585- DbgPrint("%s: extra data 0x%x\n", __func__, *lp);
3586+ DbgPrint
3587+ ("novfs_Get_File_Info: extra data 0x%x\n",
3588+ *lp);
3589 Info->mtime.tv_nsec = *lp;
3590 }
3591 retCode = 0;
3592@@ -295,35 +263,37 @@ int Novfs_Get_File_Info(unsigned char *
3593 }
3594 }
3595
3596- DbgPrint("%s: return 0x%x\n", __func__, retCode);
3597+ DbgPrint("novfs_Get_File_Info: return 0x%x\n", retCode);
3598 return (retCode);
3599 }
3600
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)
3606 {
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;
3612 int cmdlen;
3613 int retCode = -ENOENT;
3614
3615 int namelen = strlen(Name);
3616 int pathlen = strlen(Path);
3617
3618- DbgPrint("%s: xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i\n", __func__, Path, pathlen, Name, namelen);
3619+ DbgPrint
3620+ ("novfs_GetX_File_Info xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i\n",
3621+ Path, pathlen, Name, namelen);
3622
3623 if (namelen > MAX_XATTR_NAME_LEN) {
3624 return ENOATTR;
3625 }
3626
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);
3631 if (cmd) {
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;
3636
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);
3642
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");
3652+ DbgPrint
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",
3658+ cmd->pathLen);
3659+ DbgPrint("novfs_GetX_File_Info xattr: Path = %s\n", cmd->data);
3660+ DbgPrint("novfs_GetX_File_Info xattr: nameLen = %d\n",
3661+ cmd->nameLen);
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");
3665
3666 retCode =
3667 Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
3668@@ -347,8 +323,13 @@ int Novfs_GetX_File_Info(char *Path, con
3669 if (reply) {
3670
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);
3674+ DbgPrint
3675+ ("novfs_GetX_File_Info xattr: reply->Reply.ErrorCode=%d, %X\n",
3676+ reply->Reply.ErrorCode,
3677+ reply->Reply.ErrorCode);
3678+ DbgPrint
3679+ ("novfs_GetX_File_Info xattr: replylen=%d\n",
3680+ replylen);
3681
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
3685 } else {
3686
3687 *dataLen =
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);
3691+ DbgPrint
3692+ ("novfs_GetX_File_Info xattr: replylen=%u, dataLen=%u\n",
3693+ replylen, *dataLen);
3694
3695 if (buffer_size >= *dataLen) {
3696- DbgPrint("%s xattr: copying to buffer from &reply->pData\n", __func__);
3697+ DbgPrint
3698+ ("novfs_GetX_File_Info xattr: copying to buffer from &reply->pData\n");
3699 memcpy(buffer, &reply->pData, *dataLen);
3700
3701 retCode = 0;
3702 } else {
3703- DbgPrint("%s xattr: (!!!) buffer is smaller then reply\n", __func__);
3704+ DbgPrint
3705+ ("novfs_GetX_File_Info xattr: (!!!) buffer is smaller then reply\n");
3706 retCode = -ERANGE;
3707 }
3708- DbgPrint("%s xattr: /dumping buffer\n", __func__);
3709- mydump(*dataLen, buffer);
3710- DbgPrint("%s xattr: \\after dumping buffer\n", __func__);
3711+ DbgPrint
3712+ ("novfs_GetX_File_Info xattr: /dumping buffer\n");
3713+ novfs_dump(*dataLen, buffer);
3714+ DbgPrint
3715+ ("novfs_GetX_File_Info xattr: \\after dumping buffer\n");
3716 }
3717
3718 kfree(reply);
3719 } else {
3720- DbgPrint("%s xattr: reply = NULL\n", __func__);
3721+ DbgPrint("novfs_GetX_File_Info xattr: reply = NULL\n");
3722 }
3723 kfree(cmd);
3724
3725@@ -388,32 +375,33 @@ int Novfs_GetX_File_Info(char *Path, con
3726 return retCode;
3727 }
3728
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)
3734 {
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;
3740 int cmdlen;
3741 int retCode = -ENOENT;
3742
3743 int namelen = strlen(Name);
3744 int pathlen = strlen(Path);
3745
3746- DbgPrint("%s xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i, value len = %u\n", __func__,
3747+ DbgPrint
3748+ ("novfs_SetX_File_Info xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i, value len = %u\n",
3749 Path, pathlen, Name, namelen, valueLen);
3750
3751 if (namelen > MAX_XATTR_NAME_LEN) {
3752 return ENOATTR;
3753 }
3754
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);
3759 if (cmd) {
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;
3764
3765 cmd->flags = flags;
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,
3769 valueLen);
3770
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");
3780+ DbgPrint
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",
3786+ cmd->pathLen);
3787+ DbgPrint("novfs_SetX_File_Info xattr: Path = %s\n", cmd->data);
3788+ DbgPrint("novfs_SetX_File_Info xattr: nameLen = %d\n",
3789+ cmd->nameLen);
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);
3793
3794- DbgPrint("%s xattr: PXA_SET_REQUEST END\n", __func__);
3795+ DbgPrint("novfs_SetX_File_Info xattr: PXA_SET_REQUEST END\n");
3796
3797 retCode =
3798 Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
3799@@ -444,22 +438,30 @@ int Novfs_SetX_File_Info(char *Path, con
3800 if (reply) {
3801
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);
3805+ DbgPrint
3806+ ("novfs_SetX_File_Info xattr: reply->Reply.ErrorCode=%d, %X\n",
3807+ reply->Reply.ErrorCode,
3808+ reply->Reply.ErrorCode);
3809+ DbgPrint
3810+ ("novfs_SetX_File_Info xattr: replylen=%d\n",
3811+ replylen);
3812
3813 retCode = -reply->Reply.ErrorCode; //-ENOENT;
3814 } else {
3815
3816- DbgPrint("%s xattr: replylen=%u, real len = %u\n", __func__, replylen, replylen - sizeof(COMMAND_REPLY_HEADER));
3817+ DbgPrint
3818+ ("novfs_SetX_File_Info xattr: replylen=%u, real len = %u\n",
3819+ replylen,
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));
3824
3825 retCode = 0;
3826 }
3827
3828 kfree(reply);
3829 } else {
3830- DbgPrint("%s xattr: reply = NULL\n", __func__);
3831+ DbgPrint("novfs_SetX_File_Info xattr: reply = NULL\n");
3832 }
3833 kfree(cmd);
3834
3835@@ -468,32 +470,41 @@ int Novfs_SetX_File_Info(char *Path, con
3836 return retCode;
3837 }
3838
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)
3842 {
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;
3848 int cmdlen;
3849 int retCode = -ENOENT;
3850
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,
3854+ pathlen);
3855
3856 *dataLen = 0;
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);
3861 if (cmd) {
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__);
3874+ DbgPrint
3875+ ("novfs_ListX_File_Info xattr: PVERIFY_FILE_REQUEST BEGIN\n");
3876+ DbgPrint
3877+ ("novfs_ListX_File_Info xattr: Queue_Daemon_Command %d\n",
3878+ cmd->Command.CommandType);
3879+ DbgPrint
3880+ ("novfs_ListX_File_Info xattr: Command.SessionId = %d\n",
3881+ cmd->Command.SessionId);
3882+ DbgPrint("novfs_ListX_File_Info xattr: pathLen = %d\n",
3883+ cmd->pathLen);
3884+ DbgPrint("novfs_ListX_File_Info xattr: Path = %s\n", cmd->path);
3885+ DbgPrint
3886+ ("novfs_ListX_File_Info xattr: PVERIFY_FILE_REQUEST END\n");
3887
3888 retCode =
3889 Queue_Daemon_Command(cmd, cmdlen, NULL, 0, (void *)&reply,
3890@@ -502,31 +513,43 @@ int Novfs_ListX_File_Info(char *Path, ch
3891 if (reply) {
3892
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);
3896+ DbgPrint
3897+ ("novfs_ListX_File_Info xattr: reply->Reply.ErrorCode=%d, %X\n",
3898+ reply->Reply.ErrorCode,
3899+ reply->Reply.ErrorCode);
3900+ DbgPrint
3901+ ("novfs_ListX_File_Info xattr: replylen=%d\n",
3902+ replylen);
3903
3904 retCode = -ENOENT;
3905 } else {
3906- *dataLen = replylen - sizeof(COMMAND_REPLY_HEADER);
3907- DbgPrint("%s xattr: replylen=%u, dataLen=%u\n", __func__, replylen, *dataLen);
3908+ *dataLen =
3909+ replylen - sizeof(struct novfs_command_reply_header);
3910+ DbgPrint
3911+ ("novfs_ListX_File_Info xattr: replylen=%u, dataLen=%u\n",
3912+ replylen, *dataLen);
3913
3914 if (buffer_size >= *dataLen) {
3915- DbgPrint("%s xattr: copying to buffer from &reply->pData\n", __func__);
3916+ DbgPrint
3917+ ("novfs_ListX_File_Info xattr: copying to buffer from &reply->pData\n");
3918 memcpy(buffer, &reply->pData, *dataLen);
3919 } else {
3920- DbgPrint("%s xattr: (!!!) buffer is smaller then reply\n", __func__);
3921+ DbgPrint
3922+ ("novfs_ListX_File_Info xattr: (!!!) buffer is smaller then reply\n");
3923 retCode = -ERANGE;
3924 }
3925- DbgPrint("%s xattr: /dumping buffer\n", __func__);
3926- mydump(*dataLen, buffer);
3927- DbgPrint("%s xattr: \\after dumping buffer\n", __func__);
3928+ DbgPrint
3929+ ("novfs_ListX_File_Info xattr: /dumping buffer\n");
3930+ novfs_dump(*dataLen, buffer);
3931+ DbgPrint
3932+ ("novfs_ListX_File_Info xattr: \\after dumping buffer\n");
3933
3934 retCode = 0;
3935 }
3936
3937 kfree(reply);
3938 } else {
3939- DbgPrint("%s xattr: reply = NULL\n", __func__);
3940+ DbgPrint("novfs_ListX_File_Info xattr: reply = NULL\n");
3941 }
3942 kfree(cmd);
3943
3944@@ -535,21 +558,23 @@ int Novfs_ListX_File_Info(char *Path, ch
3945 return retCode;
3946 }
3947
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)
3951 {
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;
3958
3959 *EnumHandle = 0;
3960
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);
3966 if (cmd) {
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;
3971
3972 cmd->pathLen = PathLen;
3973 memcpy(cmd->path, Path, PathLen);
3974@@ -576,16 +601,16 @@ static int begin_directory_enumerate(uns
3975 return (retCode);
3976 }
3977
3978-static int end_directory_enumerate(HANDLE EnumHandle, struct schandle *SessionId)
3979+static int end_directory_enumerate(void *EnumHandle, struct novfs_schandle SessionId)
3980 {
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;
3986 int retCode;
3987
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;
3992
3993 cmd.enumerateHandle = EnumHandle;
3994
3995@@ -603,95 +628,24 @@ static int end_directory_enumerate(HANDL
3996 return (retCode);
3997 }
3998
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)
4003 {
4004- ENUMERATE_DIRECTORY_REQUEST cmd;
4005- PENUMERATE_DIRECTORY_REPLY reply = NULL;
4006- unsigned long replylen = 0;
4007- int retCode;
4008-
4009- cmd.Command.CommandType = VFS_COMMAND_ENUMERATE_DIRECTORY;
4010- cmd.Command.SequenceNumber = 0;
4011- cmd.Command.SessionId = SessionId;
4012-
4013- cmd.enumerateHandle = *EnumHandle;
4014- cmd.pathLen = 0;
4015- cmd.path[0] = '\0';
4016-
4017- retCode =
4018- Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
4019- &replylen, INTERRUPTIBLE);
4020-
4021- if (reply) {
4022- /*
4023- * The VFS_COMMAND_ENUMERATE_DIRECTORY call can return an
4024- * error but there could still be valid data.
4025- */
4026- if (!reply->Reply.ErrorCode ||
4027- ((replylen > sizeof(COMMAND_REPLY_HEADER)) &&
4028- (reply->nameLen > 0))) {
4029- Info->type = 3;
4030- Info->mode = S_IRWXU;
4031-
4032- if (reply->mode & NW_ATTRIBUTE_DIRECTORY) {
4033- Info->mode |= S_IFDIR;
4034- Info->mode |= S_IXUSR;
4035- } else {
4036- Info->mode |= S_IFREG;
4037- }
4038-
4039- if (reply->mode & NW_ATTRIBUTE_READ_ONLY) {
4040- Info->mode &= ~(S_IWUSR);
4041- }
4042-
4043- if (reply->mode & NW_ATTRIBUTE_EXECUTE) {
4044- Info->mode |= S_IXUSR;
4045- }
4046-
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);
4058- retCode = 0;
4059- if (reply->Reply.ErrorCode) {
4060- retCode = -1; /* Eof of data */
4061- }
4062- *EnumHandle = reply->enumerateHandle;
4063- } else {
4064- retCode = -ENODATA;
4065- }
4066- kfree(reply);
4067- }
4068-
4069- return (retCode);
4070-}
4071-
4072-static int directory_enumerate_ex(HANDLE *EnumHandle, struct schandle *SessionId, int *Count, struct entry_info **PInfo, int Interrupt)
4073-{
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;
4079 int retCode = 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;
4084 int isize;
4085
4086- if (PInfo) {
4087+ if (PInfo)
4088 *PInfo = NULL;
4089- }
4090 *Count = 0;
4091
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;
4096
4097 cmd.enumerateHandle = *EnumHandle;
4098 cmd.pathLen = 0;
4099@@ -709,57 +663,92 @@ static int directory_enumerate_ex(HANDLE
4100 */
4101
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",
4107 replylen);
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));
4111+ data =
4112+ (struct novfs_enumerate_directory_ex_data *) ((char *)reply +
4113+ sizeof
4114+ (struct novfs_enumerate_directory_ex_reply));
4115+ isize =
4116+ replylen - sizeof(struct novfs_enumerate_directory_ex_reply *) -
4117+ reply->enumCount *
4118+ offsetof(struct
4119+ novfs_enumerate_directory_ex_data, name);
4120+ isize +=
4121+ (reply->enumCount *
4122+ offsetof(struct novfs_entry_info, name));
4123
4124 if (PInfo) {
4125- *PInfo = info = Novfs_Malloc(isize, GFP_KERNEL);
4126+ *PInfo = info = kmalloc(isize, GFP_KERNEL);
4127 if (*PInfo) {
4128- DbgPrint("directory_enumerate_ex1: data=0x%p info=0x%p\n", data, info);
4129+ DbgPrint
4130+ ("directory_enumerate_ex1: data=0x%p info=0x%p\n",
4131+ data, info);
4132 *Count = reply->enumCount;
4133 do {
4134- DbgPrint("directory_enumerate_ex2: data=0x%p length=%d\n", data);
4135+ DbgPrint
4136+ ("directory_enumerate_ex2: data=0x%p length=%d\n",
4137+ data);
4138
4139 info->type = 3;
4140 info->mode = S_IRWXU;
4141
4142- if (data->mode & NW_ATTRIBUTE_DIRECTORY) {
4143+ if (data->
4144+ mode &
4145+ NW_ATTRIBUTE_DIRECTORY) {
4146 info->mode |= S_IFDIR;
4147 info->mode |= S_IXUSR;
4148 } else {
4149 info->mode |= S_IFREG;
4150 }
4151
4152- if (data->mode & NW_ATTRIBUTE_READ_ONLY) {
4153- info->mode &= ~(S_IWUSR);
4154+ if (data->
4155+ mode &
4156+ NW_ATTRIBUTE_READ_ONLY) {
4157+ info->mode &=
4158+ ~(S_IWUSR);
4159 }
4160
4161- if (data->mode & NW_ATTRIBUTE_EXECUTE) {
4162+ if (data->
4163+ mode & NW_ATTRIBUTE_EXECUTE)
4164+ {
4165 info->mode |= S_IXUSR;
4166 }
4167
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 =
4177+ data->modifyTime;
4178 info->mtime.tv_nsec = 0;
4179- info->ctime.tv_sec = data->createTime;
4180+ info->ctime.tv_sec =
4181+ data->createTime;
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);
4189-
4190- info = (struct entry_info *)&info->name[info->namelength];
4191+ info->namelength =
4192+ data->nameLen;
4193+ memcpy(info->name, data->name,
4194+ data->nameLen);
4195+ data =
4196+ (struct novfs_enumerate_directory_ex_data *)
4197+ & data->name[data->nameLen];
4198+ replylen =
4199+ (int)((char *)&info->
4200+ name[info->
4201+ namelength] -
4202+ (char *)info);
4203+ DbgPrint
4204+ ("directory_enumerate_ex3: info=0x%p\n",
4205+ info);
4206+ novfs_dump(replylen, info);
4207+
4208+ info =
4209+ (struct novfs_entry_info *) & info->
4210+ name[info->namelength];
4211
4212 } while (--reply->enumCount);
4213 }
4214@@ -778,8 +767,9 @@ static int directory_enumerate_ex(HANDLE
4215 return (retCode);
4216 }
4217
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)
4223 {
4224 int retCode = -ENOENT;
4225
4226@@ -788,15 +778,20 @@ int Novfs_Get_Directory_ListEx(unsigned
4227 if (Info)
4228 *Info = NULL;
4229
4230- if ((HANDLE) - 1 == *EnumHandle) {
4231+ if ((void *) - 1 == *EnumHandle) {
4232 return (-ENODATA);
4233 }
4234
4235- if (0 == *EnumHandle)
4236- retCode = begin_directory_enumerate(Path, strlen(Path), EnumHandle, SessionId);
4237+ if (0 == *EnumHandle) {
4238+ retCode =
4239+ begin_directory_enumerate(Path, strlen(Path), EnumHandle,
4240+ SessionId);
4241+ }
4242
4243 if (*EnumHandle) {
4244- retCode = directory_enumerate_ex(EnumHandle, SessionId, Count, Info, INTERRUPTIBLE);
4245+ retCode =
4246+ directory_enumerate_ex(EnumHandle, SessionId, Count, Info,
4247+ INTERRUPTIBLE);
4248 if (retCode) {
4249 end_directory_enumerate(*EnumHandle, SessionId);
4250 if (-1 == retCode) {
4251@@ -808,11 +803,12 @@ int Novfs_Get_Directory_ListEx(unsigned
4252 return (retCode);
4253 }
4254
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,
4258+ void ** Handle,
4259+ struct novfs_schandle SessionId)
4260 {
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;
4267
4268@@ -825,8 +821,8 @@ int Novfs_Open_File(unsigned char * Path
4269
4270 *Handle = 0;
4271
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);
4276 if (cmd) {
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
4280 return (retCode);
4281 }
4282
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)
4285 {
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;
4292
4293@@ -917,8 +913,8 @@ int Novfs_Create(unsigned char * Path, i
4294 pathlen--;
4295 }
4296
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);
4301 if (cmd) {
4302 cmd->Command.CommandType = VFS_COMMAND_CREATE_FILE;
4303 if (DirectoryFlag) {
4304@@ -948,10 +944,10 @@ int Novfs_Create(unsigned char * Path, i
4305 return (retCode);
4306 }
4307
4308-int Novfs_Close_File(HANDLE Handle, session_t SessionId)
4309+int novfs_close_file(void *Handle, struct novfs_schandle SessionId)
4310 {
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;
4316 int retCode;
4317
4318@@ -974,11 +970,11 @@ int Novfs_Close_File(HANDLE Handle, sess
4319 return (retCode);
4320 }
4321
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)
4326 {
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;
4332 int retCode = 0;
4333 size_t len;
4334@@ -986,8 +982,10 @@ int Novfs_Read_File(HANDLE Handle, unsig
4335 len = *Bytes;
4336 *Bytes = 0;
4337
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;
4345 }
4346
4347@@ -999,9 +997,12 @@ int Novfs_Read_File(HANDLE Handle, unsig
4348 cmd.len = len;
4349 cmd.offset = *Offset;
4350
4351- retCode = Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
4352+ retCode =
4353+ Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
4354+ &replylen, INTERRUPTIBLE);
4355
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);
4359
4360 if (!retCode) {
4361 if (reply->Reply.ErrorCode) {
4362@@ -1011,9 +1012,12 @@ int Novfs_Read_File(HANDLE Handle, unsig
4363 retCode = -EIO;
4364 }
4365 } else {
4366- replylen -= offsetof(READ_FILE_REPLY, data);
4367+ replylen -= offsetof(struct
4368+ novfs_read_file_reply, data);
4369+
4370 if (replylen > 0) {
4371- replylen -= copy_to_user(Buffer, reply->data, replylen);
4372+ replylen -=
4373+ copy_to_user(Buffer, reply->data, replylen);
4374 *Bytes = replylen;
4375 }
4376 }
4377@@ -1023,17 +1027,18 @@ int Novfs_Read_File(HANDLE Handle, unsig
4378 kfree(reply);
4379 }
4380
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);
4383
4384 return (retCode);
4385 }
4386
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)
4392 {
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;
4400 int retCode = 0;
4401 size_t len;
4402@@ -1042,7 +1047,7 @@ int Novfs_Read_Pages(HANDLE Handle, stru
4403 *Bytes = 0;
4404
4405 DbgPrint
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,
4409 SessionId.hId);
4410
4411@@ -1059,14 +1064,14 @@ int Novfs_Read_Pages(HANDLE Handle, stru
4412 */
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;
4418
4419 retCode =
4420 Queue_Daemon_Command(&cmd, sizeof(cmd), DList, DList_Cnt,
4421 (void *)&reply, &replylen, INTERRUPTIBLE);
4422
4423- DbgPrint("Novfs_Read_Pages: Queue_Daemon_Command 0x%x\n", retCode);
4424+ DbgPrint("novfs_Read_Pages: Queue_Daemon_Command 0x%x\n", retCode);
4425
4426 if (!retCode) {
4427 if (reply) {
4428@@ -1080,44 +1085,45 @@ int Novfs_Read_Pages(HANDLE Handle, stru
4429 retCode = -EIO;
4430 }
4431 }
4432- *Bytes = replylen - offsetof(READ_FILE_REPLY, data);
4433+ *Bytes = replylen - offsetof(struct
4434+ novfs_read_file_reply, data);
4435 }
4436
4437 if (reply) {
4438 kfree(reply);
4439 }
4440
4441- DbgPrint("Novfs_Read_Pages: retCode=0x%x\n", retCode);
4442+ DbgPrint("novfs_Read_Pages: retCode=0x%x\n", retCode);
4443
4444 return (retCode);
4445 }
4446
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)
4451 {
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;
4458 size_t len;
4459
4460 unsigned long boff;
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;
4467
4468 len = *Bytes;
4469- cmdlen = offsetof(WRITE_FILE_REQUEST, data);
4470+ cmdlen = offsetof(struct novfs_write_file_request, data);
4471
4472 *Bytes = 0;
4473
4474 memset(&lreply, 0, sizeof(lreply));
4475
4476- DbgPrint("Novfs_Write_File cmdlen=%ld len=%ld\n", cmdlen, len);
4477+ DbgPrint("novfs_Write_File cmdlen=%ld len=%ld\n", cmdlen, len);
4478
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;
4484 }
4485 cmd.Command.CommandType = VFS_COMMAND_WRITE_FILE;
4486@@ -1127,18 +1133,18 @@ int Novfs_Write_File(HANDLE Handle, unsi
4487 cmd.len = len;
4488 cmd.offset = *Offset;
4489
4490- DbgPrint("Novfs_Write_File cmdlen=%ld len=%ld\n", cmdlen, len);
4491+ DbgPrint("novfs_Write_File cmdlen=%ld len=%ld\n", cmdlen, len);
4492
4493 npage =
4494 (((unsigned long)Buffer & ~PAGE_MASK) + len +
4495 (PAGE_SIZE - 1)) >> PAGE_SHIFT;
4496
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) {
4500 return (-ENOMEM);
4501 }
4502
4503- pages = Novfs_Malloc(sizeof(struct page *) * npage, GFP_KERNEL);
4504+ pages = kmalloc(sizeof(struct page *) * npage, GFP_KERNEL);
4505
4506 if (NULL == pages) {
4507 kfree(dlist);
4508@@ -1153,7 +1159,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4509
4510 up_read(&current->mm->mmap_sem);
4511
4512- DbgPrint("Novfs_Write_File res=%d\n", res);
4513+ DbgPrint("novfs_Write_File res=%d\n", res);
4514
4515 if (res > 0) {
4516 boff = (unsigned long)Buffer & ~PAGE_MASK;
4517@@ -1168,12 +1174,12 @@ int Novfs_Write_File(HANDLE Handle, unsi
4518 dlist[0].len = len;
4519 }
4520
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);
4524
4525 boff = dlist[0].len;
4526
4527- DbgPrint("Novfs_Write_File len=%d boff=%d\n", len, boff);
4528+ DbgPrint("novfs_Write_File len=%d boff=%d\n", len, boff);
4529
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
4533
4534 boff += dlist[i].len;
4535 DbgPrint
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);
4539 }
4540
4541@@ -1198,7 +1204,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4542 dlist[i].rwflag = DLWRITE;
4543 res++;
4544
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",
4547 Buffer, boff, len);
4548
4549 retCode =
4550@@ -1211,7 +1217,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4551
4552 res = 0;
4553
4554- kdata = Novfs_Malloc(len, GFP_KERNEL);
4555+ kdata = kmalloc(len, GFP_KERNEL);
4556 if (kdata) {
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
4560 }
4561 }
4562
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);
4565
4566 if (!retCode) {
4567 switch (lreply.Reply.ErrorCode) {
4568@@ -1267,7 +1273,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4569 kfree(pages);
4570 kfree(dlist);
4571
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,
4574 retCode);
4575
4576 return (retCode);
4577@@ -1276,7 +1282,7 @@ int Novfs_Write_File(HANDLE Handle, unsi
4578 /*
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
4583 *
4584 * Returns: 0 - Success
4585 * -ENOSPC - Out of space on server
4586@@ -1285,17 +1291,17 @@ int Novfs_Write_File(HANDLE Handle, unsi
4587 *
4588 * Abstract: Write page to file.
4589 */
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)
4592 {
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];
4603
4604 DbgPrint
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);
4608
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;
4613
4614- cmdlen = offsetof(WRITE_FILE_REQUEST, data);
4615+ cmdlen = offsetof(struct novfs_write_file_request, data);
4616
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
4620 kfree(reply);
4621 }
4622
4623- DbgPrint("Novfs_Write_Page retCode=0x%x\n", retCode);
4624+ DbgPrint("novfs_Write_Page retCode=0x%x\n", retCode);
4625
4626 return (retCode);
4627 }
4628
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)
4633 {
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;
4642 size_t len;
4643
4644 DbgPrint
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);
4648
4649 DList[0].page = NULL;
4650@@ -1373,7 +1379,7 @@ int Novfs_Write_Pages(HANDLE Handle, str
4651 DList[0].rwflag = DLWRITE;
4652
4653 len = Bytes;
4654- cmdlen = offsetof(WRITE_FILE_REQUEST, data);
4655+ cmdlen = offsetof(struct novfs_write_file_request, data);
4656
4657 if (len) {
4658 cmd.Command.CommandType = VFS_COMMAND_WRITE_FILE;
4659@@ -1414,17 +1420,17 @@ int Novfs_Write_Pages(HANDLE Handle, str
4660 kfree(reply);
4661 }
4662 }
4663- DbgPrint("Novfs_Write_Pages retCode=0x%x\n", retCode);
4664+ DbgPrint("novfs_Write_Pages retCode=0x%x\n", retCode);
4665
4666 return (retCode);
4667 }
4668
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)
4674 {
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;
4680 int retCode = 0;
4681 size_t len;
4682@@ -1432,8 +1438,10 @@ int Novfs_Read_Stream(HANDLE ConnHandle,
4683 len = *Bytes;
4684 *Bytes = 0;
4685
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;
4693 }
4694
4695@@ -1446,60 +1454,70 @@ int Novfs_Read_Stream(HANDLE ConnHandle,
4696 cmd.len = len;
4697 cmd.offset = *Offset;
4698
4699- retCode = Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply, &replylen, INTERRUPTIBLE);
4700+ retCode =
4701+ Queue_Daemon_Command(&cmd, sizeof(cmd), NULL, 0, (void *)&reply,
4702+ &replylen, INTERRUPTIBLE);
4703
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);
4707
4708 if (reply) {
4709 retCode = 0;
4710 if (reply->Reply.ErrorCode) {
4711 retCode = -EIO;
4712 } else {
4713- replylen -= offsetof(READ_STREAM_REPLY, data);
4714+ replylen -= offsetof(struct
4715+ novfs_read_stream_reply, data);
4716 if (replylen > 0) {
4717- if (User)
4718- replylen -= copy_to_user(Buffer, reply->data, replylen);
4719- else
4720+ if (User) {
4721+ replylen -=
4722+ copy_to_user(Buffer, reply->data,
4723+ replylen);
4724+ } else {
4725 memcpy(Buffer, reply->data, replylen);
4726+ }
4727+
4728 *Bytes = replylen;
4729 }
4730 }
4731 kfree(reply);
4732 }
4733
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,
4736+ retCode);
4737
4738 return (retCode);
4739 }
4740
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)
4745 {
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;
4752 size_t len;
4753
4754 len = *Bytes;
4755- cmdlen = len + offsetof(WRITE_STREAM_REQUEST, data);
4756+ cmdlen = len + offsetof(struct novfs_write_stream_request, data);
4757 *Bytes = 0;
4758
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);
4766 }
4767
4768- DbgPrint("Novfs_Write_Stream cmdlen=%d len=%d\n", cmdlen, len);
4769+ DbgPrint("novfs_Write_Stream cmdlen=%d len=%d\n", cmdlen, len);
4770
4771- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
4772+ cmd = kmalloc(cmdlen, GFP_KERNEL);
4773
4774 if (cmd) {
4775 if (Buffer && len) {
4776 len -= copy_from_user(cmd->data, Buffer, len);
4777 }
4778
4779- DbgPrint("Novfs_Write_Stream len=%d\n", len);
4780+ DbgPrint("novfs_Write_Stream len=%d\n", len);
4781
4782 cmd->Command.CommandType = VFS_COMMAND_WRITE_STREAM;
4783 cmd->Command.SequenceNumber = 0;
4784@@ -1532,23 +1550,23 @@ int Novfs_Write_Stream(HANDLE ConnHandle
4785 break;
4786 }
4787 DbgPrint
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;
4792 kfree(reply);
4793 }
4794 kfree(cmd);
4795 }
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,
4798 retCode);
4799
4800 return (retCode);
4801 }
4802
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)
4805 {
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;
4811 int retCode;
4812
4813@@ -1572,10 +1590,10 @@ int Novfs_Close_Stream(HANDLE ConnHandle
4814 return (retCode);
4815 }
4816
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)
4819 {
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;
4826
4827@@ -1586,8 +1604,8 @@ int Novfs_Delete(unsigned char * Path, i
4828 pathlen--;
4829 }
4830
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);
4835 if (cmd) {
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
4839 return (retCode);
4840 }
4841
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)
4845 {
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;
4852
4853@@ -1629,8 +1648,9 @@ int Novfs_Truncate_File(unsigned char *
4854 if ('.' == Path[PathLen - 1])
4855 PathLen--;
4856 }
4857- cmdlen = offsetof(TRUNCATE_FILE_REQUEST, path) + PathLen;
4858- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
4859+ cmdlen = offsetof(struct novfs_truncate_file_request, path)
4860+ + PathLen;
4861+ cmd = kmalloc(cmdlen, GFP_KERNEL);
4862 if (cmd) {
4863 cmd->Command.CommandType = VFS_COMMAND_TRUNCATE_FILE;
4864 cmd->Command.SequenceNumber = 0;
4865@@ -1655,17 +1675,18 @@ int Novfs_Truncate_File(unsigned char *
4866 return (retCode);
4867 }
4868
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)
4872 {
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;
4879
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,
4882 Offset);
4883
4884- cmdlen = offsetof(WRITE_FILE_REQUEST, data);
4885+ cmdlen = offsetof(struct novfs_write_file_request, data);
4886
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);
4892
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,
4895 reply);
4896
4897 if (!retCode) {
4898@@ -1709,20 +1730,21 @@ int Novfs_Truncate_File_Ex(HANDLE Handle
4899 kfree(reply);
4900 }
4901
4902- DbgPrint("Novfs_Truncate_File_Ex retCode=%d\n", retCode);
4903+ DbgPrint("novfs_Truncate_File_Ex retCode=%d\n", retCode);
4904
4905 return (retCode);
4906 }
4907
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)
4913 {
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;
4919 int retCode;
4920
4921- DbgPrint("Novfs_Rename_File:\n"
4922+ DbgPrint("novfs_Rename_File:\n"
4923 " DirectoryFlag: %d\n"
4924 " OldName: %.*s\n"
4925 " NewName: %.*s\n"
4926@@ -1761,10 +1783,11 @@ int Novfs_Rename_File(int DirectoryFlag,
4927 return (retCode);
4928 }
4929
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)
4933 {
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;
4940
4941@@ -1775,8 +1798,8 @@ int Novfs_Set_Attr(unsigned char * Path,
4942 pathlen--;
4943 }
4944
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);
4949 if (cmd) {
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,
4953 return (retCode);
4954 }
4955
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)
4959 {
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;
4965 int cmdlen;
4966 int retCode = 0;
4967 int pathlen;
4968
4969- DbgPrint("Novfs_Get_File_Cache_Flag: Path = %s\n", Path);
4970+ DbgPrint("novfs_Get_File_Cache_Flag: Path = %s\n", Path);
4971
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])
4976 pathlen--;
4977 }
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) +
4981+ pathlen;
4982+ cmd = (struct novfs_get_cache_flag *)
4983+ kmalloc(cmdlen, GFP_KERNEL);
4984 if (cmd) {
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
4988 }
4989 }
4990
4991- DbgPrint("Novfs_Get_File_Cache_Flag: return %d\n", retCode);
4992+ DbgPrint("novfs_Get_File_Cache_Flag: return %d\n", retCode);
4993 return (retCode);
4994 }
4995
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
4999 *
5000- * Returns:
5001- * 0 on success
5002- * negative value on error
5003- *
5004- * Abstract:
5005- *
5006 * Notes: lock type - fcntl
5007 */
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)
5011 {
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;
5017 int retCode;
5018
5019 retCode = -1;
5020
5021- DbgPrint("Novfs_Set_File_Lock:\n"
5022+ DbgPrint("novfs_Set_File_Lock:\n"
5023 " SessionId: 0x%llx\n", SessionId);
5024
5025 cmd =
5026- (PSET_FILE_LOCK_REQUEST) Novfs_Malloc(sizeof(SET_FILE_LOCK_REQUEST),
5027- GFP_KERNEL);
5028+ (struct novfs_set_file_lock_request *) kmalloc(sizeof(struct novfs_set_file_lock_request), GFP_KERNEL);
5029
5030 if (cmd) {
5031- DbgPrint("Novfs_Set_File_Lock 2\n");
5032+ DbgPrint("novfs_Set_File_Lock 2\n");
5033
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;
5039
5040- DbgPrint("Novfs_Set_File_Lock 3\n");
5041+ DbgPrint("novfs_Set_File_Lock 3\n");
5042
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",
5050 cmd->handle);
5051- DbgPrint("Novfs_Set_File_Lock: cmd->fl_type = %u\n",
5052+ DbgPrint("novfs_Set_File_Lock: cmd->fl_type = %u\n",
5053 cmd->fl_type);
5054- DbgPrint("Novfs_Set_File_Lock: cmd->fl_start = 0x%X\n",
5055+ DbgPrint("novfs_Set_File_Lock: cmd->fl_start = 0x%X\n",
5056 cmd->fl_start);
5057- DbgPrint("Novfs_Set_File_Lock: cmd->fl_len = 0x%X\n",
5058+ DbgPrint("novfs_Set_File_Lock: cmd->fl_len = 0x%X\n",
5059 cmd->fl_len);
5060 DbgPrint
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");
5067
5068 retCode =
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,
5072 INTERRUPTIBLE);
5073- DbgPrint("Novfs_Set_File_Lock 4\n");
5074+ DbgPrint("novfs_Set_File_Lock 4\n");
5075
5076 if (reply) {
5077- DbgPrint("Novfs_Set_File_Lock 5, ErrorCode = %X\n",
5078+ DbgPrint("novfs_Set_File_Lock 5, ErrorCode = %X\n",
5079 reply->Reply.ErrorCode);
5080
5081 if (reply->Reply.ErrorCode) {
5082@@ -1954,11 +1973,10 @@ int Novfs_Set_File_Lock(session_t Sessio
5083 }
5084 kfree(reply);
5085 }
5086-
5087 kfree(cmd);
5088 }
5089
5090- DbgPrint("Novfs_Set_File_Lock 6\n");
5091+ DbgPrint("novfs_Set_File_Lock 6\n");
5092
5093 return (retCode);
5094 }
5095--- a/fs/novfs/inode.c
5096+++ b/fs/novfs/inode.c
5097@@ -37,14 +37,6 @@
5098 /*===[ Include files specific to this module ]============================*/
5099 #include "vfs.h"
5100
5101-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
5102-#define FSPRIVATE u.generic_ip
5103-#else
5104-#define FSPRIVATE i_private
5105-#endif
5106-
5107-
5108-#define FILE_UPDATE_TIMEOUT 2
5109
5110 struct inode_data {
5111 void *Scope;
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;
5118 int CacheFlag;
5119 char Name[1]; /* Needs to be last entry */
5120 };
5121
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);
5125-
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
5137+
5138+/*===[ Function prototypes ]=============================================*/
5139+
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);
5142
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);
5147-#else
5148-struct super_block *Novfs_get_sb(struct file_system_type *Fstype, int Flags,
5149- const char *Dev_name, void *Data);
5150-#endif
5151
5152-int Novfs_fill_super(struct super_block *SB, void *Data, int Silent);
5153+static void novfs_kill_sb(struct super_block *SB);
5154+
5155
5156 /*
5157 * Declared dentry_operations
5158 */
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);
5171
5172 /*
5173 * Declared directory operations
5174 */
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);
5191
5192 /*
5193 * Declared address space operations
5194 */
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,
5202 unsigned to);
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,
5205 unsigned to);
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);
5214
5215 /*
5216 * Declared file_operations
5217 */
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 *);
5226-#else
5227-int Novfs_f_flush(struct file *, fl_owner_t);
5228-#endif
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 *);
5242
5243 /*
5244 * Declared inode_operations
5245 */
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 *,
5261 struct dentry *);
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);
5269
5270 /*
5271 * Extended attributes operations
5272 */
5273
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,
5276 size_t size);
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);
5282
5283-void update_inode(struct inode *Inode, struct entry_info *Info);
5284+void update_inode(struct inode *Inode, struct novfs_entry_info *Info);
5285
5286 /*
5287 * Declared super_operations
5288 */
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);
5294-
5295-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
5296-int Novfs_statfs(struct dentry *de, struct kstatfs *buf);
5297-#else
5298-int Novfs_statfs(struct super_block *sb, struct kstatfs *buf);
5299-#endif
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);
5305+
5306+int novfs_statfs(struct dentry *de, struct kstatfs *buf);
5307
5308 /*
5309 * Declared control interface functions
5310 */
5311 ssize_t
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);
5314
5315 ssize_t
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,
5318 loff_t * ppos);
5319
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);
5323
5324 int __init init_novfs(void);
5325 void __exit exit_novfs(void);
5326
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,
5361+ ino_t ino);
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);
5370
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,
5386 };
5387
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,
5403 };
5404
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,
5429 };
5430
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,
5435 };
5436
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,
5440 .state = 0,
5441 .capabilities = BDI_CAP_NO_WRITEBACK | BDI_CAP_MAP_COPY,
5442 .unplug_io_fn = default_unplug_io_fn,
5443 };
5444
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,
5462 };
5463
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,
5474-/*
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,
5488+/*
5489+ .getxattr = novfs_i_getxattr,
5490+ .setxattr = novfs_i_setxattr,
5491+ .listxattr = novfs_i_listxattr,
5492 */
5493 };
5494
5495-static struct inode_operations Novfs_file_inode_operations = {
5496- .setattr = Novfs_i_setattr,
5497- .getattr = Novfs_i_getattr,
5498-/*
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,
5505+/*
5506+ .getxattr = novfs_i_getxattr,
5507+ .setxattr = novfs_i_setxattr,
5508+ .listxattr = novfs_i_listxattr,
5509 */
5510 };
5511
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,
5521
5522 };
5523
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,
5533 };
5534 */
5535
5536-static atomic_t Novfs_Inode_Number = ATOMIC_INIT(0);
5537-
5538-struct dentry *Novfs_root = NULL;
5539+static atomic_t novfs_Inode_Number = ATOMIC_INIT(0);
5540
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;
5545
5546-char *Novfs_CurrentMount = NULL;
5547+struct dentry *novfs_root = NULL;
5548+char *novfs_current_mnt = NULL;
5549
5550 DECLARE_MUTEX(InodeList_lock);
5551
5552@@ -346,18 +313,13 @@ uint64_t inHAXTime;
5553 int inHAX;
5554
5555 unsigned long InodeCount = 0, DCCount = 0;
5556-unsigned long File_update_timeout = FILE_UPDATE_TIMEOUT;
5557-int PageCache = 0;
5558+unsigned long novfs_update_timeout = FILE_UPDATE_TIMEOUT;
5559+int novfs_page_cache = 0;
5560
5561-typedef struct _Novfs_List2 {
5562- struct list_head list;
5563- void *data;
5564-} Novfs_List2;
5565-
5566-typedef struct _File_Private2 {
5567+struct file_private {
5568 int listedall;
5569- HANDLE enumHandle;
5570-} FilePrivate2;
5571+ void *enumHandle;
5572+};
5573
5574 static void PRINT_DENTRY(const char *s, struct dentry *d)
5575 {
5576@@ -370,8 +332,8 @@ static void PRINT_DENTRY(const char *s,
5577 " prev: 0x%p\n", &d->d_lru, d->d_lru.next,
5578 d->d_lru.prev);
5579 DbgPrint(" d_child: 0x%p\n" " next: 0x%p\n"
5580- " prev: 0x%p\n", &d->D_CHILD, d->D_CHILD.next,
5581- d->D_CHILD.prev);
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,
5586 d->d_subdirs.prev);
5587@@ -397,144 +359,109 @@ static void PRINT_DENTRY(const char *s,
5588 }
5589
5590 /*++======================================================================*/
5591-int Novfs_Remove_from_Root(char *RemoveName)
5592-/*
5593- * Arguments:
5594- *
5595- * Returns:
5596- *
5597- * Abstract:
5598- *
5599- * Notes:
5600- *
5601- * Environment:
5602- *
5603- *========================================================================*/
5604+int novfs_remove_from_root(char *RemoveName)
5605 {
5606 struct qstr name;
5607 struct dentry *dentry;
5608 struct inode *dir;
5609
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);
5616
5617- dentry = d_lookup(Novfs_root, &name);
5618+ dentry = d_lookup(novfs_root, &name);
5619 if (dentry) {
5620- if (dentry->d_inode && dentry->d_inode->FSPRIVATE) {
5621- ((struct inode_data *)(dentry->d_inode->FSPRIVATE))->Scope =
5622- NULL;
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;
5627 }
5628 dput(dentry);
5629 }
5630
5631- dir = Novfs_root->d_inode;
5632+ dir = novfs_root->d_inode;
5633
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);
5640
5641 return (0);
5642 }
5643
5644 /*++======================================================================*/
5645-int Novfs_Add_to_Root(char *AddName)
5646-/*
5647- * Arguments:
5648- *
5649- * Returns:
5650- *
5651- * Abstract:
5652- *
5653- * Notes:
5654- *
5655- * Environment:
5656- *
5657- *========================================================================*/
5658+int novfs_add_to_root(char *AddName)
5659 {
5660 struct qstr name;
5661 struct inode *dir;
5662- struct entry_info info;
5663+ struct novfs_entry_info info;
5664 ino_t ino;
5665
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);
5672
5673- dir = Novfs_root->d_inode;
5674+ dir = novfs_root->d_inode;
5675
5676- Novfs_lock_inode_cache(dir);
5677+ novfs_lock_inode_cache(dir);
5678
5679 ino = 0;
5680
5681- if (!Novfs_lookup_inode_cache(dir, &name, 0)) {
5682+ if (!novfs_lookup_inode_cache(dir, &name, 0)) {
5683 info.mode = S_IFDIR | 0700;
5684 info.size = 0;
5685 info.atime = info.ctime = info.mtime = CURRENT_TIME;
5686
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);
5691 }
5692
5693- Novfs_unlock_inode_cache(dir);
5694+ novfs_unlock_inode_cache(dir);
5695
5696 return (0);
5697 }
5698
5699 /*++======================================================================*/
5700-int Novfs_Add_to_Root2(char *AddName)
5701-/*
5702- * Arguments:
5703- *
5704- * Returns:
5705- *
5706- * Abstract:
5707- *
5708- * Notes:
5709- *
5710- * Environment:
5711- *
5712- *========================================================================*/
5713+int novfs_Add_to_Root2(char *AddName)
5714 {
5715 struct dentry *entry;
5716 struct qstr name;
5717 struct inode *inode;
5718 void *scope;
5719
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;
5724
5725- Novfs_d_hash(Novfs_root, &name);
5726+ novfs_d_hash(novfs_root, &name);
5727
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();
5735
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);
5740 if (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);
5745 /*
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 );
5748 */
5749 inode =
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);
5754 if (inode) {
5755 inode->i_atime =
5756 inode->i_ctime =
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;
5766 }
5767- PRINT_DENTRY("After Novfs_d_add",
5768+ PRINT_DENTRY("After novfs_d_add",
5769 entry);
5770 } else {
5771 dput(entry);
5772@@ -544,27 +471,12 @@ int Novfs_Add_to_Root2(char *AddName)
5773 }
5774 } else {
5775 dput(entry);
5776- PRINT_DENTRY("Novfs_Add_to_Root: After dput Dentry", entry);
5777+ PRINT_DENTRY("novfs_Add_to_Root: After dput Dentry", entry);
5778 }
5779 return (0);
5780 }
5781
5782-/*++======================================================================*/
5783-char *Novfs_dget_path(struct dentry *Dentry, char *Buf, unsigned int Buflen)
5784-/*
5785- * Arguments: struct dentry *Dentry - starting entry
5786- * char *Buf - pointer to memory buffer
5787- * unsigned int Buflen - size of memory buffer
5788- *
5789- * Returns: pointer to path.
5790- *
5791- * Abstract: Walks the dentry chain building a path.
5792- *
5793- * Notes:
5794- *
5795- * Environment:
5796- *
5797- *========================================================================*/
5798+char *novfs_dget_path(struct dentry *Dentry, char *Buf, unsigned int Buflen)
5799 {
5800 char *retval = &Buf[Buflen];
5801 struct dentry *p = Dentry;
5802@@ -591,34 +503,17 @@ char *Novfs_dget_path(struct dentry *Den
5803 }
5804
5805 if (retval)
5806- DbgPrint("Novfs_dget_path: %s\n", retval);
5807+ DbgPrint("novfs_dget_path: %s\n", retval);
5808 return (retval);
5809 }
5810
5811-/*++======================================================================*/
5812 int verify_dentry(struct dentry *dentry, int Flags)
5813-/*
5814- * Arguments: struct dentry *dentry - entry to verify
5815- *
5816- * Returns: zero - Inode cache has been updated. If not in the cache
5817- * then file doesn't exist.
5818- * !zero - Error
5819- *
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
5822- * the parent.
5823- *
5824- * Notes:
5825- *
5826- * Environment:
5827- *
5828- *========================================================================*/
5829 {
5830 int retVal = -ENOENT;
5831 struct inode *dir;
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;
5838 ino_t ino = 0;
5839 struct qstr name;
5840@@ -633,19 +528,19 @@ int verify_dentry(struct dentry *dentry,
5841 }
5842
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);
5847
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);
5850
5851 if (info) {
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 !=
5865 info->mtime.tv_sec)
5866@@ -654,30 +549,31 @@ int verify_dentry(struct dentry *dentry,
5867 /*
5868 * Values don't match so update.
5869 */
5870- ((struct inode_data *) inode->FSPRIVATE)->Flags |= UPDATE_INODE;
5871+ struct inode_data *n_inode = inode->i_private;
5872+ n_inode->Flags |= UPDATE_INODE;
5873 }
5874
5875 ctime = get_jiffies_64() - ctime;
5876- if (Flags || ctime < (u64) (File_update_timeout * HZ)) {
5877+ if (Flags || ctime < (u64) (novfs_update_timeout * HZ)) {
5878 retVal = 0;
5879- Novfs_unlock_inode_cache(dir);
5880+ novfs_unlock_inode_cache(dir);
5881 dput(parent);
5882 kfree(info);
5883 return (0);
5884 }
5885 }
5886- Novfs_unlock_inode_cache(dir);
5887+ novfs_unlock_inode_cache(dir);
5888 }
5889
5890 if (IS_ROOT(dentry->d_parent)) {
5891- session = Scope_Get_SessionId(Scope_Get_ScopefromName(&dentry->d_name));
5892- } else {
5893- session = Scope_Get_SessionId(id->Scope);
5894- }
5895+ session = novfs_scope_get_sessionId(
5896+ novfs_get_scope_from_name(&dentry->d_name));
5897+ } else
5898+ session = novfs_scope_get_sessionId(id->Scope);
5899
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);
5905 }
5906
5907 ino = 0;
5908@@ -685,62 +581,65 @@ int verify_dentry(struct dentry *dentry,
5909
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();
5914
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);
5919
5920 if (list) {
5921 cp = list;
5922 while (*cp) {
5923 name.name = cp;
5924 name.len = strlen(cp);
5925- name.hash = Novfs_internal_hash(&name);
5926+ name.hash = novfs_internal_hash(&name);
5927 cp += (name.len + 1);
5928 ino = 0;
5929- if (Novfs_get_entry(dir, &name, &ino, info)) {
5930+ if (novfs_get_entry(dir, &name, &ino, info)) {
5931 info->mode = S_IFDIR | 0700;
5932 info->size = 0;
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);
5938 }
5939 }
5940 }
5941- Novfs_free_invalid_entries(dir);
5942+ novfs_free_invalid_entries(dir);
5943 } else {
5944
5945 path =
5946- Novfs_dget_path(dentry, info->name,
5947+ novfs_dget_path(dentry, info->name,
5948 PATH_LENGTH_BUFFER);
5949 if (path) {
5950 if (dentry->d_name.len <=
5951 NW_MAX_PATH_LENGTH) {
5952 name.hash =
5953- Novfs_internal_hash
5954+ novfs_internal_hash
5955 (&dentry->d_name);
5956 name.len = dentry->d_name.len;
5957 name.name = dentry->d_name.name;
5958
5959- retVal = Novfs_Get_File_Info(path, info, &session);
5960+ retVal =
5961+ novfs_get_file_info(path,
5962+ info,
5963+ session);
5964 if (0 == retVal) {
5965 dentry->d_time =
5966 jiffies +
5967- (File_update_timeout
5968+ (novfs_update_timeout
5969 * HZ);
5970 iLock =
5971- Novfs_lock_inode_cache
5972+ novfs_lock_inode_cache
5973 (dir);
5974- if (Novfs_update_entry
5975+ if (novfs_update_entry
5976 (dir, &name, 0,
5977 info)) {
5978 if (dentry->
5979 d_inode) {
5980 ino = dentry->d_inode->i_ino;
5981 } else {
5982- ino = (ino_t)atomic_inc_return(&Novfs_Inode_Number);
5983+ ino = (ino_t)atomic_inc_return(&novfs_Inode_Number);
5984 }
5985- Novfs_add_inode_entry
5986+ novfs_add_inode_entry
5987 (dir, &name,
5988 ino, info);
5989 }
5990@@ -758,14 +657,14 @@ int verify_dentry(struct dentry *dentry,
5991 ~S_DEAD;
5992 if (dentry->
5993 d_inode->
5994- FSPRIVATE) {
5995- ((struct inode_data *) dentry->d_inode->FSPRIVATE)->Scope = id->Scope;
5996+ i_private) {
5997+ ((struct inode_data *) dentry->d_inode->i_private)->Scope = id->Scope;
5998 }
5999 }
6000 } else if (-EINTR != retVal) {
6001 retVal = 0;
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);
6006 if (dentry->d_inode
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,
6010 retVal = -ENOMEM;
6011 }
6012 if (iLock) {
6013- Novfs_unlock_inode_cache(dir);
6014+ novfs_unlock_inode_cache(dir);
6015 }
6016 dput(parent);
6017 }
6018@@ -804,67 +703,37 @@ int verify_dentry(struct dentry *dentry,
6019 return (retVal);
6020 }
6021
6022-/*++======================================================================*/
6023-struct dentry *Novfs_d_lookup(struct dentry *Parent, struct qstr *Name)
6024-/*
6025- * Arguments:
6026- *
6027- * Returns:
6028- *
6029- * Abstract:
6030- *
6031- * Notes:
6032- *
6033- * Environment:
6034- *
6035- *========================================================================*/
6036-{
6037- return (d_lookup(Parent, Name));
6038-}
6039
6040-/*++======================================================================*/
6041-int Novfs_d_add(struct dentry *Parent, struct dentry *d, struct inode *i, int a)
6042-/*
6043- * Arguments:
6044- *
6045- * Returns:
6046- *
6047- * Abstract:
6048- *
6049- * Notes:
6050- *
6051- * Environment:
6052- *
6053- *========================================================================*/
6054+static int novfs_d_add(struct dentry *Parent, struct dentry *d, struct inode *i, int a)
6055 {
6056 void *scope;
6057 struct inode_data *id = NULL;
6058
6059 char *path, *buf;
6060
6061- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6062+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6063 if (buf) {
6064- path = Novfs_dget_path(d, buf, PATH_LENGTH_BUFFER);
6065+ path = novfs_dget_path(d, buf, PATH_LENGTH_BUFFER);
6066 if (path) {
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,
6069 i->i_ino, path);
6070 }
6071 kfree(buf);
6072 }
6073
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;
6078 }
6079
6080 if (id && id->Scope) {
6081 scope = id->Scope;
6082 } else {
6083- scope = Scope_Get_ScopefromPath(d);
6084+ scope = novfs_get_scope(d);
6085 }
6086
6087- ((struct inode_data *) i->FSPRIVATE)->Scope = scope;
6088+ ((struct inode_data *) i->i_private)->Scope = scope;
6089
6090- d->d_time = jiffies + (File_update_timeout * HZ);
6091+ d->d_time = jiffies + (novfs_update_timeout * HZ);
6092 if (a) {
6093 d_add(d, i);
6094 } else {
6095@@ -874,29 +743,14 @@ int Novfs_d_add(struct dentry *Parent, s
6096 return (0);
6097 }
6098
6099-/*++======================================================================*/
6100-int Novfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
6101-/*
6102- * Arguments: struct dentry *dentry - pointer to dentry to revalidate.
6103- * struct nameidata *nd - pointer to nameidata.
6104- *
6105- * Returns: zero - dentry is not valid.
6106- * !zero - valid entry
6107- *
6108- * Abstract:
6109- *
6110- * Notes:
6111- *
6112- * Environment:
6113- *
6114- *========================================================================*/
6115+int novfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
6116 {
6117 int retCode = 0;
6118 struct inode *dir;
6119 struct inode_data *id;
6120 struct qstr name;
6121
6122- DbgPrint("Novfs_d_revalidate: 0x%p %.*s\n"
6123+ DbgPrint("novfs_d_revalidate: 0x%p %.*s\n"
6124 " d_count: %d\n"
6125 " d_inode: 0x%p\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 &&
6129 dentry->d_parent &&
6130 (dir = dentry->d_parent->d_inode) &&
6131- (id = dir->FSPRIVATE)) {
6132+ (id = dir->i_private)) {
6133 /*
6134 * Check timer to see if in valid time limit
6135 */
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;
6139 name.hash =
6140- Novfs_internal_hash(&dentry->d_name);
6141+ novfs_internal_hash(&dentry->d_name);
6142 dentry->d_time = 0;
6143
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
6149 (dir, &name, 0)) {
6150 dentry->d_time =
6151 jiffies +
6152- (File_update_timeout
6153+ (novfs_update_timeout
6154 * HZ);
6155 retCode = 1;
6156 }
6157- Novfs_unlock_inode_cache(dir);
6158+ novfs_unlock_inode_cache(dir);
6159 }
6160 }
6161 } else {
6162@@ -949,26 +803,13 @@ int Novfs_d_revalidate(struct dentry *de
6163 */
6164 }
6165
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);
6169
6170 return (retCode);
6171 }
6172
6173-/*++======================================================================*/
6174-unsigned long Novfs_internal_hash(struct qstr *name)
6175-/*
6176- * Arguments:
6177- *
6178- * Returns:
6179- *
6180- * Abstract:
6181- *
6182- * Notes:
6183- *
6184- * Environment:
6185- *
6186- *========================================================================*/
6187+static unsigned long novfs_internal_hash(struct qstr *name)
6188 {
6189 unsigned long hash = 0;
6190 unsigned int len = name->len;
6191@@ -984,48 +825,22 @@ unsigned long Novfs_internal_hash(struct
6192 return (hash);
6193 }
6194
6195-/*++======================================================================*/
6196-int Novfs_d_hash(struct dentry *dentry, struct qstr *name)
6197-/*
6198- * Arguments:
6199- *
6200- * Returns:
6201- *
6202- * Abstract:
6203- *
6204- * Notes:
6205- *
6206- * Environment:
6207- *
6208- *========================================================================*/
6209+int novfs_d_hash(struct dentry *dentry, struct qstr *name)
6210 {
6211- DbgPrint("Novfs_d_hash: %.*s\n", name->len, name->name);
6212+ DbgPrint("novfs_d_hash: %.*s\n", name->len, name->name);
6213
6214- name->hash = Novfs_internal_hash(name);
6215+ name->hash = novfs_internal_hash(name);
6216
6217 return (0);
6218 }
6219
6220-/*++======================================================================*/
6221-int Novfs_d_strcmp(struct qstr *s1, struct qstr *s2)
6222-/*
6223- * Arguments:
6224- *
6225- * Returns:
6226- *
6227- * Abstract:
6228- *
6229- * Notes:
6230- *
6231- * Environment:
6232- *
6233- *========================================================================*/
6234+int novfs_d_strcmp(struct qstr *s1, struct qstr *s2)
6235 {
6236 int retCode = 1;
6237 unsigned char *str1, *str2;
6238 unsigned int len;
6239
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,
6242 s2->len, s2->name);
6243
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
6246 }
6247 }
6248
6249- DbgPrint("Novfs_d_strcmp: retCode=0x%x\n", retCode);
6250+ DbgPrint("novfs_d_strcmp: retCode=0x%x\n", retCode);
6251 return (retCode);
6252 }
6253
6254-/*++======================================================================*/
6255-int Novfs_d_compare(struct dentry *parent, struct qstr *s1, struct qstr *s2)
6256-/*
6257- * Arguments:
6258- *
6259- * Returns:
6260- *
6261- * Abstract:
6262- *
6263- * Notes:
6264- *
6265- * Environment:
6266- *
6267- *========================================================================*/
6268+int novfs_d_compare(struct dentry *parent, struct qstr *s1, struct qstr *s2)
6269 {
6270 int retCode;
6271
6272- retCode = Novfs_d_strcmp(s1, s2);
6273+ retCode = novfs_d_strcmp(s1, s2);
6274
6275- DbgPrint("Novfs_d_compare: retCode=0x%x\n", retCode);
6276+ DbgPrint("novfs_d_compare: retCode=0x%x\n", retCode);
6277 return (retCode);
6278 }
6279
6280-/*++======================================================================*/
6281-int Novfs_d_delete(struct dentry *dentry)
6282-/*
6283- * Arguments:
6284- *
6285- * Returns:
6286- *
6287- * Abstract:
6288- *
6289- * Notes:
6290- *
6291- * Environment:
6292- *
6293- *========================================================================*/
6294+int novfs_d_delete(struct dentry *dentry)
6295 {
6296 int retVal = 0;
6297
6298- DbgPrint("Novfs_d_delete: 0x%p %.*s\n"
6299+ DbgPrint("novfs_d_delete: 0x%p %.*s\n"
6300 " d_count: %d\n"
6301 " d_inode: 0x%p\n",
6302 dentry, dentry->d_name.len, dentry->d_name.name,
6303@@ -1101,42 +890,16 @@ int Novfs_d_delete(struct dentry *dentry
6304 return (retVal);
6305 }
6306
6307-/*++======================================================================*/
6308-void Novfs_d_release(struct dentry *dentry)
6309-/*
6310- * Arguments:
6311- *
6312- * Returns:
6313- *
6314- * Abstract:
6315- *
6316- * Notes:
6317- *
6318- * Environment:
6319- *
6320- *========================================================================*/
6321+void novfs_d_release(struct dentry *dentry)
6322 {
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);
6326 }
6327
6328-/*++======================================================================*/
6329-void Novfs_d_iput(struct dentry *dentry, struct inode *inode)
6330-/*
6331- * Arguments:
6332- *
6333- * Returns:
6334- *
6335- * Abstract:
6336- *
6337- * Notes:
6338- *
6339- * Environment:
6340- *
6341- *========================================================================*/
6342+void novfs_d_iput(struct dentry *dentry, struct inode *inode)
6343 {
6344 DbgPrint
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);
6349
6350@@ -1144,37 +907,24 @@ void Novfs_d_iput(struct dentry *dentry,
6351
6352 }
6353
6354-/*++======================================================================*/
6355-int Novfs_dir_open(struct inode *dir, struct file *file)
6356-/*
6357- * Arguments:
6358- *
6359- * Returns:
6360- *
6361- * Abstract:
6362- *
6363- * Notes:
6364- *
6365- * Environment:
6366- *
6367- *========================================================================*/
6368+int novfs_dir_open(struct inode *dir, struct file *file)
6369 {
6370 char *path, *buf;
6371- FilePrivate2 *file_private = NULL;
6372+ struct file_private *file_private = NULL;
6373
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);
6377
6378- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6379+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6380 if (buf) {
6381- path = Novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6382+ path = novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6383 if (path) {
6384- DbgPrint("Novfs_dir_open: path %s\n", path);
6385+ DbgPrint("novfs_dir_open: path %s\n", path);
6386 }
6387 kfree(buf);
6388 }
6389
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;
6394
6395@@ -1183,25 +933,12 @@ int Novfs_dir_open(struct inode *dir, st
6396 return (0);
6397 }
6398
6399-/*++======================================================================*/
6400-int Novfs_dir_release(struct inode *dir, struct file *file)
6401-/*
6402- * Arguments:
6403- *
6404- * Returns:
6405- *
6406- * Abstract:
6407- *
6408- * Notes:
6409- *
6410- * Environment:
6411- *
6412- *========================================================================*/
6413+int novfs_dir_release(struct inode *dir, struct file *file)
6414 {
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;
6419
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);
6424
6425@@ -1213,24 +950,11 @@ int Novfs_dir_release(struct inode *dir,
6426 return (0);
6427 }
6428
6429-/*++======================================================================*/
6430-loff_t Novfs_dir_lseek(struct file * file, loff_t offset, int origin)
6431-/*
6432- * Arguments:
6433- *
6434- * Returns:
6435- *
6436- * Abstract:
6437- *
6438- * Notes:
6439- *
6440- * Environment:
6441- *
6442- *========================================================================*/
6443+loff_t novfs_dir_lseek(struct file * file, loff_t offset, int origin)
6444 {
6445- FilePrivate2 *file_private = NULL;
6446+ struct file_private *file_private = NULL;
6447
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);
6452
6453@@ -1240,7 +964,7 @@ loff_t Novfs_dir_lseek(struct file * fil
6454
6455 file->f_pos = 0;
6456
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;
6461
6462@@ -1248,25 +972,12 @@ loff_t Novfs_dir_lseek(struct file * fil
6463 //return(default_llseek(file, offset, origin));
6464 }
6465
6466-/*++======================================================================*/
6467-ssize_t Novfs_dir_read(struct file * file, char *buf, size_t len, loff_t * off)
6468-/*
6469- * Arguments:
6470- *
6471- * Returns:
6472- *
6473- * Abstract:
6474- *
6475- * Notes:
6476- *
6477- * Environment:
6478- *
6479- *========================================================================*/
6480+ssize_t novfs_dir_read(struct file * file, char *buf, size_t len, loff_t * off)
6481 {
6482 /*
6483 int rlen = 0;
6484
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);
6487
6488 if (0 == *off)
6489 {
6490@@ -1276,19 +987,19 @@ ssize_t Novfs_dir_read(struct file * fil
6491 }
6492 return(rlen);
6493 */
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));
6498 }
6499
6500-static void Novfs_Dump_Info(struct entry_info *info)
6501+static void novfs_Dump_Info(struct novfs_entry_info *info)
6502 {
6503 char atime_buf[32], mtime_buf[32], ctime_buf[32];
6504 char namebuf[512];
6505 int len = 0;
6506
6507 if (info == NULL) {
6508- DbgPrint("Novfs_dir_readdir : Dump_Info info == NULL\n");
6509+ DbgPrint("novfs_dir_readdir : Dump_Info info == NULL\n");
6510 return;
6511 }
6512
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);
6537 }
6538
6539-/*++======================================================================*/
6540 void processList(struct file *file, void *dirent, filldir_t filldir, char *list,
6541- int type, session_t SessionId)
6542-/*
6543- * Arguments:
6544- *
6545- * Returns:
6546- *
6547- * Abstract:
6548- *
6549- * Notes:
6550- *
6551- * Environment:
6552- *
6553- *========================================================================*/
6554+ int type, struct novfs_schandle SessionId)
6555 {
6556 unsigned char *path, *buf = NULL, *cp;
6557 struct qstr name;
6558- struct entry_info *pinfo = NULL;
6559+ struct novfs_entry_info *pinfo = NULL;
6560
6561- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6562+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6563 path = buf;
6564 if (buf) {
6565- path = Novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6566+ path = novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6567 if (path) {
6568 strcpy(buf, path);
6569 }
6570@@ -1351,14 +1049,14 @@ void processList(struct file *file, void
6571 cp = list;
6572 while (*cp) {
6573 name.name = cp;
6574- DbgPrint("Novfs_dir_readdir : name.name = %s\n",
6575+ DbgPrint("novfs_dir_readdir : name.name = %s\n",
6576 name.name);
6577 name.len = strlen(cp);
6578- name.hash = Novfs_internal_hash(&name);
6579+ name.hash = novfs_internal_hash(&name);
6580 cp += (name.len + 1);
6581
6582 pinfo =
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;
6587 pinfo->size = 0;
6588@@ -1367,7 +1065,7 @@ void processList(struct file *file, void
6589 strcpy(pinfo->name, name.name);
6590 pinfo->namelength = name.len;
6591
6592- Novfs_Dump_Info(pinfo);
6593+ novfs_Dump_Info(pinfo);
6594
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
6598 }
6599
6600 int processEntries(struct file *file, void *dirent, filldir_t filldir,
6601- HANDLE * enumHandle, session_t sessionId)
6602+ void ** enumHandle, struct novfs_schandle sessionId)
6603 {
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;
6610
6611- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6612+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
6613 if (!buf) {
6614 return -ENOMEM;
6615 }
6616
6617- path = Novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6618+ path = novfs_dget_path(file->f_dentry, buf, PATH_LENGTH_BUFFER);
6619 if (!path) {
6620 kfree(buf);
6621 return -ENOMEM;
6622 }
6623 //NWSearchfiles
6624 count = 0;
6625- status = Novfs_Get_Directory_ListEx(path, enumHandle, &count, &pinfo, &sessionId);
6626+ status =
6627+ novfs_get_dir_listex(path, enumHandle, &count, &pinfo,
6628+ sessionId);
6629 pInfoMem = pinfo;
6630
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);
6634 file->f_pos += 1;
6635
6636- pinfo = (struct entry_info *)(pinfo->name + pinfo->namelength);
6637+ pinfo = (struct novfs_entry_info *) (pinfo->name + pinfo->namelength);
6638 }
6639
6640 kfree(pInfoMem);
6641@@ -1424,32 +1124,19 @@ int processEntries(struct file *file, vo
6642 return 0;
6643 }
6644
6645-/*++======================================================================*/
6646-int Novfs_dir_readdir(struct file *file, void *dirent, filldir_t filldir)
6647-/*
6648- * Arguments:
6649- *
6650- * Returns:
6651- *
6652- * Abstract:
6653- *
6654- * Notes:
6655- *
6656- * Environment:
6657- *
6658- *========================================================================*/
6659+int novfs_dir_readdir(struct file *file, void *dirent, filldir_t filldir)
6660 {
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;
6666 uid_t uid;
6667 int type = 0;
6668- FilePrivate2 *file_private = NULL;
6669+ struct file_private *file_private = NULL;
6670 int lComm;
6671
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);
6677
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,
6680 }
6681
6682 inode = file->f_dentry->d_inode;
6683- if (inode && inode->FSPRIVATE) {
6684+ if (inode && inode->i_private) {
6685 sessionId =
6686- Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)-> Scope);
6687+ novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->
6688+ Scope);
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);
6694 sessionId =
6695- Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
6696+ novfs_scope_get_sessionId(((struct inode_data *) inode->
6697+ i_private)->Scope);
6698 }
6699- uid = Scope_Get_Uid(((struct inode_data *)inode->FSPRIVATE)->Scope);
6700+ uid = novfs_scope_get_uid(((struct inode_data *) inode->i_private)->Scope);
6701 } else {
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
6706 {
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();
6712 type = USER_LIST;
6713 } else if (IS_ROOT(file->f_dentry->d_parent)) {
6714 DbgPrint
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);
6719 type = SERVER_LIST;
6720 } else {
6721 DbgPrint
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);
6728 type = VOLUME_LIST;
6729 }
6730
6731@@ -1580,76 +1269,46 @@ int Novfs_dir_readdir(struct file *file,
6732 return 1;
6733 }
6734
6735-/*++======================================================================*/
6736-int Novfs_dir_fsync(struct file *file, struct dentry *dentry, int datasync)
6737-/*
6738- * Arguments:
6739- *
6740- * Returns:
6741- *
6742- * Abstract:
6743- *
6744- * Notes:
6745- *
6746- * Environment:
6747- *
6748- *========================================================================*/
6749+int novfs_dir_fsync(struct file *file, struct dentry *dentry, int datasync)
6750 {
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));
6755 }
6756
6757-/*++======================================================================*/
6758-ssize_t Novfs_f_read(struct file * file, char *buf, size_t len, loff_t * off)
6759-/*
6760- * Arguments:
6761- *
6762- * Returns:
6763- *
6764- * Abstract:
6765- *
6766- * Notes:
6767- *
6768- * Environment:
6769- *
6770- *========================================================================*/
6771+ssize_t novfs_f_read(struct file * file, char *buf, size_t len, loff_t * off)
6772 {
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;
6779
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)) {
6784
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",
6787 file->private_data,
6788 buf, len, offset,
6789 file->f_dentry->d_name.len,
6790 file->f_dentry->d_name.name);
6791
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);
6795-#else
6796+ if (novfs_page_cache && !(file->f_flags & O_DIRECT) && id->CacheFlag) {
6797 totalread = do_sync_read(file, buf, len, off);
6798-#endif
6799 } else {
6800- session = Scope_Get_SessionId(id->Scope);
6801+ session = novfs_scope_get_sessionId(id->Scope);
6802 if (0 == SC_PRESENT(session)) {
6803 id->Scope =
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);
6808 }
6809
6810 while (len > 0 && (offset < i_size_read(inode))) {
6811 int retval;
6812 thisread = len;
6813 retval =
6814- Novfs_Read_File(file->private_data, buf,
6815+ novfs_read_file(file->private_data, buf,
6816 &thisread, &offset,
6817 session);
6818 if (retval || !thisread) {
6819@@ -1658,7 +1317,7 @@ ssize_t Novfs_f_read(struct file * file,
6820 }
6821 break;
6822 }
6823- DbgPrint("Novfs_f_read thisread = 0x%x\n",
6824+ DbgPrint("novfs_f_read thisread = 0x%x\n",
6825 thisread);
6826 len -= thisread;
6827 buf += thisread;
6828@@ -1668,77 +1327,60 @@ ssize_t Novfs_f_read(struct file * file,
6829 *off = offset;
6830 }
6831 }
6832- DbgPrint("Novfs_f_read return = %d\n", totalread);
6833+ DbgPrint("novfs_f_read return = %d\n", totalread);
6834
6835 return (totalread);
6836 }
6837
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,
6841 loff_t * off)
6842-/*
6843- * Arguments:
6844- *
6845- * Returns:
6846- *
6847- * Abstract:
6848- *
6849- * Notes:
6850- *
6851- * Environment:
6852- *
6853- *========================================================================*/
6854 {
6855 ssize_t thiswrite, totalwrite = 0;
6856 loff_t offset = *off;
6857- session_t session;
6858+ struct novfs_schandle session;
6859 struct inode *inode;
6860 int status;
6861 struct inode_data *id;
6862
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);
6872
6873- if (PageCache &&
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);
6879-#else
6880 totalwrite = do_sync_write(file, buf, len, off);
6881-#endif
6882 } else {
6883 if (file->f_flags & O_APPEND) {
6884 offset = i_size_read(inode);
6885 DbgPrint
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);
6890 }
6891
6892- session = Scope_Get_SessionId(id->Scope);
6893+ session = novfs_scope_get_sessionId(id->Scope);
6894 if (0 == SC_PRESENT(session)) {
6895 id->Scope =
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);
6900 }
6901
6902 while (len > 0) {
6903 thiswrite = len;
6904 if ((status =
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;
6911 break;
6912 }
6913- DbgPrint("Novfs_f_write thiswrite = 0x%x\n",
6914+ DbgPrint("novfs_f_write thiswrite = 0x%x\n",
6915 thiswrite);
6916 len -= thiswrite;
6917 buf += thiswrite;
6918@@ -1757,69 +1399,43 @@ ssize_t Novfs_f_write(struct file * file
6919 *off = offset;
6920 }
6921 }
6922- DbgPrint("Novfs_f_write return = 0x%x\n", totalwrite);
6923+ DbgPrint("novfs_f_write return = 0x%x\n", totalwrite);
6924
6925 return (totalwrite);
6926 }
6927
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)
6930 {
6931 return -EISDIR;
6932 }
6933
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,
6936 unsigned long arg)
6937 {
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,
6940 arg);
6941
6942 return -ENOSYS;
6943 }
6944
6945-/*++======================================================================*/
6946-int Novfs_f_mmap(struct file *file, struct vm_area_struct *vma)
6947-/*
6948- * Arguments:
6949- *
6950- * Returns:
6951- *
6952- * Abstract:
6953- *
6954- * Notes:
6955- *
6956- * Environment:
6957- *
6958- *========================================================================*/
6959+int novfs_f_mmap(struct file *file, struct vm_area_struct *vma)
6960 {
6961 int retCode = -EINVAL;
6962
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);
6966
6967 retCode = generic_file_mmap(file, vma);
6968
6969- DbgPrint("Novfs_f_mmap: retCode=0x%x\n", retCode);
6970+ DbgPrint("novfs_f_mmap: retCode=0x%x\n", retCode);
6971 return (retCode);
6972 }
6973
6974-/*++======================================================================*/
6975-int Novfs_f_open(struct inode *inode, struct file *file)
6976-/*
6977- * Arguments:
6978- *
6979- * Returns:
6980- *
6981- * Abstract:
6982- *
6983- * Notes:
6984- *
6985- * Environment:
6986- *
6987- *========================================================================*/
6988+int novfs_f_open(struct inode *inode, struct file *file)
6989 {
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;
6995 char *path;
6996 struct dentry *parent;
6997 ino_t ino;
6998@@ -1827,32 +1443,35 @@ int Novfs_f_open(struct inode *inode, st
6999 int errInfo;
7000
7001 DbgPrint
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) {
7007 DbgPrint
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);
7012 }
7013
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);
7025 }
7026
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);
7030 if (info) {
7031 path =
7032- Novfs_dget_path(file->f_dentry, info->name,
7033+ novfs_dget_path(file->f_dentry, info->name,
7034 PATH_LENGTH_BUFFER);
7035 if (path) {
7036 if (file->f_flags & O_TRUNC) {
7037- errInfo = Novfs_Get_File_Info(path, info, &session);
7038+ errInfo =
7039+ novfs_get_file_info(path, info,
7040+ session);
7041
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
7045 }
7046 }
7047
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,
7052 file->
7053 f_flags & ~O_EXCL,
7054 info,
7055 &file->private_data,
7056 session);
7057
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);
7061 if (!retCode) {
7062 /*
7063@@ -1877,28 +1496,31 @@ int Novfs_f_open(struct inode *inode, st
7064 */
7065 //id->FileHandle = file->private_data;
7066 id->CacheFlag =
7067- Novfs_Get_File_Cache_Flag(path,
7068+ novfs_get_file_cache_flag(path,
7069 session);
7070
7071- if (!Novfs_Get_File_Info(path, info, &session))
7072+ if (!novfs_get_file_info
7073+ (path, info, session)) {
7074 update_inode(inode, info);
7075+ }
7076
7077 parent = dget_parent(file->f_dentry);
7078
7079 if (parent && parent->d_inode) {
7080 struct inode *dir =
7081 parent->d_inode;
7082- Novfs_lock_inode_cache(dir);
7083+ novfs_lock_inode_cache(dir);
7084 ino = 0;
7085- if (Novfs_get_entry
7086+ if (novfs_get_entry
7087 (dir,
7088 &file->f_dentry->d_name,
7089 &ino, info)) {
7090- ((struct inode_data *)inode->FSPRIVATE)->Flags |=
7091+ ((struct inode_data *) inode->
7092+ i_private)->Flags |=
7093 UPDATE_INODE;
7094 }
7095
7096- Novfs_unlock_inode_cache(dir);
7097+ novfs_unlock_inode_cache(dir);
7098 }
7099 dput(parent);
7100 }
7101@@ -1906,25 +1528,12 @@ int Novfs_f_open(struct inode *inode, st
7102 kfree(info);
7103 }
7104 }
7105- DbgPrint("Novfs_f_open: retCode=0x%x\n", retCode);
7106+ DbgPrint("novfs_f_open: retCode=0x%x\n", retCode);
7107 return (retCode);
7108 }
7109
7110-/*++======================================================================*/
7111-int Novfs_flush_mapping(HANDLE Handle, struct address_space *mapping,
7112- session_t Session)
7113-/*
7114- * Arguments:
7115- *
7116- * Returns:
7117- *
7118- * Abstract:
7119- *
7120- * Notes:
7121- *
7122- * Environment:
7123- *
7124- *========================================================================*/
7125+int novfs_flush_mapping(void *Handle, struct address_space *mapping,
7126+ struct novfs_schandle Session)
7127 {
7128 struct pagevec pagevec;
7129 unsigned nrpages;
7130@@ -1944,20 +1553,20 @@ int Novfs_flush_mapping(HANDLE Handle, s
7131 struct page *page;
7132 int i;
7133
7134- DbgPrint("Novfs_flush_mapping: %u\n", nrpages);
7135+ DbgPrint("novfs_flush_mapping: %u\n", nrpages);
7136
7137 done = 0;
7138 for (i = 0; !rc && (i < nrpages); i++) {
7139 page = pagevec.pages[i];
7140
7141- DbgPrint("Novfs_flush_mapping: page 0x%p %lu\n",
7142+ DbgPrint("novfs_flush_mapping: page 0x%p %lu\n",
7143 page, page->index);
7144
7145 lock_page(page);
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,
7151 page,
7152 Session);
7153 if (!rc) {
7154@@ -1978,61 +1587,44 @@ int Novfs_flush_mapping(HANDLE Handle, s
7155 }
7156 } while (!rc && !done);
7157
7158- DbgPrint("Novfs_flush_mapping: return %d\n", rc);
7159+ DbgPrint("novfs_flush_mapping: return %d\n", rc);
7160
7161 return (rc);
7162 }
7163
7164-/*++======================================================================*/
7165-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
7166-int Novfs_f_flush(struct file *file)
7167-#else
7168-int Novfs_f_flush(struct file *file, fl_owner_t ownid)
7169-#endif
7170-/*
7171- * Arguments:
7172- *
7173- * Returns:
7174- *
7175- * Abstract:
7176- *
7177- * Notes:
7178- *
7179- * Environment:
7180- *
7181- *========================================================================*/
7182+int novfs_f_flush(struct file *file, fl_owner_t ownid)
7183 {
7184
7185 int rc = 0;
7186 #ifdef FLUSH
7187 struct inode *inode;
7188- session_t session;
7189+ struct novfs_schandle session;
7190 struct inode_data *id;
7191
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)) {
7198
7199 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
7200 inode = file->f_dentry->d_inode;
7201 DbgPrint
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);
7207
7208- session = Scope_Get_SessionId(id->Scope);
7209+ session = novfs_scope_get_sessionId(id->Scope);
7210 if (0 == SC_PRESENT(session)) {
7211 id->Scope =
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);
7216 }
7217
7218 if (inode &&
7219 inode->i_mapping && inode->i_mapping->nrpages) {
7220
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_
7227 d_inode->
7228 i_mapping);
7229 } else {
7230- rc = Novfs_flush_mapping(file->
7231+ rc = novfs_flush_mapping(file->
7232 private_data,
7233 file->
7234 f_dentry->
7235@@ -2062,46 +1654,33 @@ int Novfs_f_flush(struct file *file, fl_
7236 return (rc);
7237 }
7238
7239-/*++======================================================================*/
7240-int Novfs_f_release(struct inode *inode, struct file *file)
7241-/*
7242- * Arguments:
7243- *
7244- * Returns:
7245- *
7246- * Abstract:
7247- *
7248- * Notes:
7249- *
7250- * Environment:
7251- *
7252- *========================================================================*/
7253+int novfs_f_release(struct inode *inode, struct file *file)
7254 {
7255 int retCode = -EACCES;
7256- session_t session;
7257+ struct novfs_schandle session;
7258 struct inode_data *id;
7259
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);
7264
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);
7274 }
7275
7276 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
7277 DbgPrint
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);
7283
7284 if (inode->i_mapping && inode->i_mapping->nrpages) {
7285
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);
7294 } else {
7295- Novfs_flush_mapping(file->private_data,
7296+ novfs_flush_mapping(file->private_data,
7297 file->f_dentry->
7298 d_inode->i_mapping,
7299 session);
7300@@ -2123,40 +1702,27 @@ int Novfs_f_release(struct inode *inode,
7301 invalidate_remote_inode(file->f_dentry->d_inode);
7302 }
7303
7304- retCode = Novfs_Close_File(file->private_data, session);
7305+ retCode = novfs_close_file(file->private_data, session);
7306 //id->FileHandle = 0;
7307 }
7308 return (retCode);
7309 }
7310
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)
7313 {
7314 return 0;
7315 }
7316
7317-/*++======================================================================*/
7318-int Novfs_f_llseek(struct file *file, loff_t offset, int origin)
7319-/*
7320- * Arguments:
7321- *
7322- * Returns:
7323- *
7324- * Abstract:
7325- *
7326- * Notes:
7327- *
7328- * Environment:
7329- *
7330- *========================================================================*/
7331+int novfs_f_llseek(struct file *file, loff_t offset, int origin)
7332 {
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,
7336 offset, origin);
7337 return (generic_file_llseek(file, offset, origin));
7338 }
7339
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)
7343 /*
7344 * Arguments:
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.
7349 *
7350- * Environment:
7351 *
7352 *========================================================================*/
7353 {
7354 int err_code;
7355
7356 struct inode *inode;
7357- session_t session;
7358+ struct novfs_schandle session;
7359 struct inode_data *id;
7360 loff_t len;
7361
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);
7365 DbgPrint
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);
7369 DbgPrint
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);
7373
7374 err_code = -1;
7375@@ -2209,17 +1774,17 @@ int Novfs_f_lock(struct file *file, int
7376
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);
7386
7387- session = Scope_Get_SessionId(id->Scope);
7388+ session = novfs_scope_get_sessionId(id->Scope);
7389 if (0 == SC_PRESENT(session)) {
7390 id->Scope =
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);
7395 }
7396
7397 /* fl_type = F_RDLCK, F_WRLCK, F_UNLCK */
7398@@ -2230,7 +1795,7 @@ int Novfs_f_lock(struct file *file, int
7399 #endif
7400
7401 err_code =
7402- Novfs_Set_File_Lock(session,
7403+ novfs_set_file_lock(session,
7404 file->private_data,
7405 lock->fl_type,
7406 lock->fl_start, len);
7407@@ -2241,7 +1806,7 @@ int Novfs_f_lock(struct file *file, int
7408 case F_SETLKW64:
7409 #endif
7410 err_code =
7411- Novfs_Set_File_Lock(session,
7412+ novfs_set_file_lock(session,
7413 file->private_data,
7414 lock->fl_type,
7415 lock->fl_start, len);
7416@@ -2259,16 +1824,16 @@ int Novfs_f_lock(struct file *file, int
7417
7418 default:
7419 printk
7420- ("<1> novfs in Novfs_f_lock, not implemented cmd = %d\n",
7421+ ("<1> novfs in novfs_f_lock, not implemented cmd = %d\n",
7422 cmd);
7423 DbgPrint
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",
7426 cmd);
7427 break;
7428 }
7429 }
7430
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);
7434
7435 if ((err_code != 0) && (err_code != -1)
7436@@ -2283,21 +1848,9 @@ int Novfs_f_lock(struct file *file, int
7437 }
7438
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)
7444-/*
7445- * Arguments:
7446- *
7447- * Returns:
7448- *
7449- * Abstract:
7450- *
7451- * Notes:
7452- *
7453- * Environment:
7454- *
7455- *========================================================================*/
7456 {
7457 struct page *page;
7458 char *target;
7459@@ -2340,30 +1893,17 @@ static void Novfs_copy_cache_pages(struc
7460 return;
7461 }
7462
7463-/*++======================================================================*/
7464-int Novfs_a_writepage(struct page *page, struct writeback_control *wbc)
7465-/*
7466- * Arguments:
7467- *
7468- * Returns:
7469- *
7470- * Abstract:
7471- *
7472- * Notes:
7473- *
7474- * Environment:
7475- *
7476- *========================================================================*/
7477+int novfs_a_writepage(struct page *page, struct writeback_control *wbc)
7478 {
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;
7489
7490- session = Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
7491+ session = novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->Scope);
7492
7493 page_cache_get(page);
7494
7495@@ -2384,7 +1924,7 @@ int Novfs_a_writepage(struct page *page,
7496 len = (size_t) (i_size_read(inode) - pos);
7497 }
7498
7499- retCode = Novfs_Write_Pages(id->FileHandle, dlst, 2, len, pos, session);
7500+ retCode = novfs_write_pages(id->FileHandle, dlst, 2, len, pos, session);
7501 if (!retCode) {
7502 SetPageUptodate(page);
7503 }
7504@@ -2395,32 +1935,18 @@ int Novfs_a_writepage(struct page *page,
7505 return (retCode);
7506 }
7507
7508-/*++======================================================================*/
7509-int Novfs_a_writepages(struct address_space *mapping,
7510+int novfs_a_writepages(struct address_space *mapping,
7511 struct writeback_control *wbc)
7512-/*
7513- * Arguments:
7514- *
7515- * Returns:
7516- *
7517- * Abstract:
7518- *
7519- * Notes:
7520- *
7521- * Environment:
7522- *
7523- *========================================================================*/
7524 {
7525 int retCode = 0;
7526 struct inode *inode = mapping->host;
7527- session_t session;
7528- HANDLE fh = 0;
7529+ struct novfs_schandle session;
7530+ void *fh = NULL;
7531 struct inode_data *id = NULL;
7532
7533- int max_page_lookup = MaxIoSize / PAGE_CACHE_SIZE;
7534+ int max_page_lookup = novfs_max_iosize / PAGE_CACHE_SIZE;
7535
7536- struct data_list *dlist;
7537- struct data_list *dlptr;
7538+ struct novfs_data_list *dlist, *dlptr;
7539 struct page **pages;
7540
7541 int dlist_idx, i = 0;
7542@@ -2430,31 +1956,32 @@ int Novfs_a_writepages(struct address_sp
7543
7544 SC_INITIALIZE(session);
7545 DbgPrint
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);
7549
7550 if (inode) {
7551 DbgPrint(" Inode=0x%p Ino=%d Id=0x%p\n", inode, inode->i_ino,
7552- inode->FSPRIVATE);
7553+ inode->i_private);
7554
7555- if (NULL != (id = inode->FSPRIVATE)) {
7556+ if (NULL != (id = inode->i_private)) {
7557 session =
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;
7563 }
7564 }
7565
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);
7568 pages =
7569- Novfs_Malloc(sizeof(struct page *) * max_page_lookup, GFP_KERNEL);
7570+ kmalloc(sizeof(struct page *) * max_page_lookup, GFP_KERNEL);
7571
7572 if (id)
7573 DbgPrint
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);
7577 else
7578 DbgPrint
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);
7582
7583 if (dlist && pages) {
7584@@ -2481,13 +2008,13 @@ int Novfs_a_writepages(struct address_sp
7585 dlist_idx = 0;
7586 dlptr = &dlist[1];
7587
7588- DbgPrint("Novfs_a_writepages1: nr_pages=%d\n",
7589+ DbgPrint("novfs_a_writepages1: nr_pages=%d\n",
7590 nr_pages);
7591 if (!nr_pages) {
7592 memset(pages, 0,
7593 sizeof(struct page *) * max_page_lookup);
7594
7595- AS_TREE_LOCK(&mapping->tree_lock);
7596+ read_lock_irq(&mapping->tree_lock);
7597
7598 /*
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
7601 1,
7602 PAGECACHE_TAG_DIRTY);
7603
7604- DbgPrint("Novfs_a_writepages2: nr_pages=%d\n",
7605+ DbgPrint("novfs_a_writepages2: nr_pages=%d\n",
7606 nr_pages);
7607 /*
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);
7611 done = 1;
7612 DbgPrint
7613- ("Novfs_a_writepage: set_bit AS_EIO\n");
7614+ ("novfs_a_writepage: set_bit AS_EIO\n");
7615 break;
7616 }
7617
7618@@ -2521,7 +2048,7 @@ int Novfs_a_writepages(struct address_sp
7619 page_cache_get(pages[i]);
7620 }
7621
7622- AS_TREE_UNLOCK(&mapping->tree_lock);
7623+ read_unlock_irq(&mapping->tree_lock);
7624
7625 if (nr_pages) {
7626 index = pages[nr_pages - 1]->index + 1;
7627@@ -2561,7 +2088,7 @@ int Novfs_a_writepages(struct address_sp
7628 */
7629
7630 DbgPrint
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);
7634
7635 if (page->index != next_index) {
7636@@ -2588,11 +2115,11 @@ int Novfs_a_writepages(struct address_sp
7637 dlptr[dlist_idx].rwflag = DLREAD;
7638 dlist_idx++;
7639 DbgPrint
7640- ("Novfs_a_writepages: Add page=0x%p index=0x%lx\n",
7641+ ("novfs_a_writepages: Add page=0x%p index=0x%lx\n",
7642 page, page->index);
7643 }
7644
7645- DbgPrint("Novfs_a_writepages: dlist_idx=%d\n",
7646+ DbgPrint("novfs_a_writepages: dlist_idx=%d\n",
7647 dlist_idx);
7648 if (dlist_idx) {
7649 tsize = dlist_idx * PAGE_CACHE_SIZE;
7650@@ -2605,7 +2132,7 @@ int Novfs_a_writepages(struct address_sp
7651 }
7652
7653 retCode =
7654- Novfs_Write_Pages(fh, dlist, dlist_idx + 1,
7655+ novfs_write_pages(fh, dlist, dlist_idx + 1,
7656 tsize, pos, session);
7657 switch (retCode) {
7658 case 0:
7659@@ -2630,7 +2157,7 @@ int Novfs_a_writepages(struct address_sp
7660 dlptr[dlist_idx -
7661 1].page);
7662 DbgPrint
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,
7666 ((struct page *)
7667 dlptr[dlist_idx -
7668@@ -2649,7 +2176,7 @@ int Novfs_a_writepages(struct address_sp
7669 mapping->writeback_index = index;
7670
7671 } else {
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);
7675 }
7676 if (dlist)
7677@@ -2657,25 +2184,12 @@ int Novfs_a_writepages(struct address_sp
7678 if (pages)
7679 kfree(pages);
7680
7681- DbgPrint("Novfs_a_writepage: retCode=%d\n", retCode);
7682+ DbgPrint("novfs_a_writepage: retCode=%d\n", retCode);
7683 return (0);
7684
7685 }
7686
7687-/*++======================================================================*/
7688-int Novfs_a_readpage(struct file *file, struct page *page)
7689-/*
7690- * Arguments:
7691- *
7692- * Returns:
7693- *
7694- * Abstract:
7695- *
7696- * Notes:
7697- *
7698- * Environment:
7699- *
7700- *========================================================================*/
7701+int novfs_a_readpage(struct file *file, struct page *page)
7702 {
7703 int retCode = 0;
7704 void *pbuf;
7705@@ -2683,10 +2197,10 @@ int Novfs_a_readpage(struct file *file,
7706 struct dentry *dentry = NULL;
7707 loff_t offset;
7708 size_t len;
7709- session_t session;
7710+ struct novfs_schandle session;
7711
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);
7716
7717 dentry = file->f_dentry;
7718@@ -2702,14 +2216,16 @@ int Novfs_a_readpage(struct file *file,
7719 if (inode) {
7720 DbgPrint(" Inode=0x%p Ino=%d", inode, inode->i_ino);
7721
7722- if (inode->FSPRIVATE) {
7723+ if (inode->i_private) {
7724 session =
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);
7735+ session =
7736+ novfs_scope_get_sessionId(((struct inode_data *) inode->
7737+ i_private)->Scope);
7738 }
7739 }
7740 }
7741@@ -2717,7 +2233,7 @@ int Novfs_a_readpage(struct file *file,
7742 DbgPrint("\n");
7743
7744 if (!PageUptodate(page)) {
7745- struct data_list dlst[2];
7746+ struct novfs_data_list dlst[2];
7747
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;
7753
7754- DbgPrint("Novfs_a_readpage: calling= Novfs_Read_Pages %lld\n",
7755+ DbgPrint("novfs_a_readpage: calling= novfs_Read_Pages %lld\n",
7756 offset);
7757 retCode =
7758- Novfs_Read_Pages(file->private_data, dlst, 2, &len, &offset,
7759+ novfs_read_pages(file->private_data, dlst, 2, &len, &offset,
7760 session);
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,
7764 }
7765 unlock_page(page);
7766
7767- DbgPrint("Novfs_a_readpage: retCode=%d\n", retCode);
7768+ DbgPrint("novfs_a_readpage: retCode=%d\n", retCode);
7769 return (retCode);
7770
7771 }
7772
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)
7777-/*
7778- * Arguments:
7779- *
7780- * Returns:
7781- *
7782- * Abstract:
7783- *
7784- * Notes:
7785- *
7786- * Environment:
7787- *
7788- *========================================================================*/
7789 {
7790 int retCode = 0;
7791 struct inode *inode = NULL;
7792 struct dentry *dentry = NULL;
7793- session_t session;
7794+ struct novfs_schandle session;
7795 loff_t offset;
7796 size_t len;
7797
7798@@ -2781,7 +2284,7 @@ int Novfs_a_readpages(struct file *file,
7799 char *rbuf, done = 0;
7800 SC_INITIALIZE(session);
7801
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,
7805 nr_pages);
7806
7807@@ -2798,21 +2301,21 @@ int Novfs_a_readpages(struct file *file,
7808 if (inode) {
7809 DbgPrint(" Inode=0x%p Ino=%d\n", inode, inode->i_ino);
7810
7811- if (inode->FSPRIVATE) {
7812+ if (inode->i_private) {
7813 session =
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);
7823 session =
7824- Scope_Get_SessionId(((struct inode_data *) inode->
7825- FSPRIVATE)->Scope);
7826+ novfs_scope_get_sessionId(((struct inode_data *) inode->
7827+ i_private)->Scope);
7828 }
7829 }
7830 }
7831
7832- rbuf = (char *)Novfs_Malloc(MaxIoSize, GFP_KERNEL);
7833+ rbuf = kmalloc(novfs_max_iosize, GFP_KERNEL);
7834 if (rbuf) {
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,
7838 */
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)) {
7843 break;
7844 }
7845 len += PAGE_SIZE;
7846@@ -2840,7 +2343,7 @@ int Novfs_a_readpages(struct file *file,
7847 }
7848
7849 if (len && !done) {
7850- struct data_list dllst[2];
7851+ struct novfs_data_list dllst[2];
7852
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;
7857
7858 DbgPrint
7859- ("Novfs_a_readpages: calling Novfs_Read_Pages %lld\n",
7860+ ("novfs_a_readpages: calling novfs_Read_Pages %lld\n",
7861 offset);
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,
7868 page_lst, len,
7869 rbuf, &lru_pvec);
7870 page_idx += len >> PAGE_CACHE_SHIFT;
7871@@ -2886,37 +2389,24 @@ int Novfs_a_readpages(struct file *file,
7872 retCode = -ENOMEM;
7873 }
7874
7875- DbgPrint("Novfs_a_readpages: retCode=%d\n", retCode);
7876+ DbgPrint("novfs_a_readpages: retCode=%d\n", retCode);
7877 return (retCode);
7878
7879 }
7880
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,
7884 unsigned to)
7885-/*
7886- * Arguments:
7887- *
7888- * Returns:
7889- *
7890- * Abstract:
7891- *
7892- * Notes:
7893- *
7894- * Environment:
7895- *
7896- *========================================================================*/
7897 {
7898 int retVal = 0;
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);
7907
7908 DbgPrint
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
7915 * Get session.
7916 */
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) {
7920 session =
7921- Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
7922+ novfs_scope_get_sessionId(((struct inode_data *)
7923+ inode->
7924+ i_private)->
7925+ Scope);
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);
7932+ session =
7933+ novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->Scope);
7934 }
7935 }
7936 }
7937@@ -2963,9 +2459,9 @@ int Novfs_a_prepare_write(struct file *f
7938 dllst[1].rwflag = DLWRITE;
7939
7940 DbgPrint
7941- ("Novfs_a_prepare_write: calling Novfs_Read_Pages %lld\n",
7942+ ("novfs_a_prepare_write: calling novfs_Read_Pages %lld\n",
7943 offset);
7944- Novfs_Read_Pages(file->private_data, dllst, 2,
7945+ novfs_read_pages(file->private_data, dllst, 2,
7946 &len, &offset, session);
7947
7948 /*
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);
7952
7953- DbgPrint("Novfs_a_prepare_write: memset 0x%p\n", adr);
7954+ DbgPrint("novfs_a_prepare_write: memset 0x%p\n", adr);
7955 }
7956 flush_dcache_page(page);
7957 SetPageUptodate(page);
7958 }
7959-// DbgPrint("Novfs_a_prepare_write: return %d\n", retVal);
7960+// DbgPrint("novfs_a_prepare_write: return %d\n", retVal);
7961 return (retVal);
7962 }
7963
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,
7967 unsigned to)
7968-/*
7969- * Arguments:
7970- *
7971- * Returns:
7972- *
7973- * Abstract:
7974- *
7975- * Notes:
7976- *
7977- * Environment:
7978- *
7979- *========================================================================*/
7980 {
7981 int retCode = 0;
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;
7990
7991 SC_INITIALIZE(session);
7992
7993 DbgPrint
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);
8007 }
8008
8009 /*
8010@@ -3055,7 +2538,7 @@ int Novfs_a_commit_write(struct file *fi
8011 dlst[0].rwflag = DLREAD;
8012
8013 retCode =
8014- Novfs_Write_Pages(id->FileHandle, dlst, 1, len, pos,
8015+ novfs_write_pages(id->FileHandle, dlst, 1, len, pos,
8016 session);
8017
8018 } else {
8019@@ -3067,51 +2550,32 @@ int Novfs_a_commit_write(struct file *fi
8020 }
8021
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)
8027 /*
8028- * Arguments:
8029- *
8030- * Returns:
8031- *
8032- * Abstract:
8033 *
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.
8040 *
8041- * Environment:
8042- *
8043 *========================================================================*/
8044 {
8045 return (-EIO);
8046 }
8047
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)
8052-/*
8053- * Arguments:
8054- *
8055- * Returns:
8056- *
8057- * Abstract:
8058- *
8059- * Notes:
8060- *
8061- * Environment:
8062- *
8063- *========================================================================*/
8064 {
8065 char *path, *buf;
8066- struct entry_info info;
8067- HANDLE handle;
8068- session_t session;
8069+ struct novfs_entry_info info;
8070+ void *handle;
8071+ struct novfs_schandle session;
8072 int retCode = -EACCES;
8073
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);
8077
8078 if (IS_ROOT(dentry) || /* Root */
8079@@ -3122,38 +2586,42 @@ int Novfs_i_create(struct inode *dir, st
8080 }
8081
8082 if (mode | S_IFREG) {
8083- if (dir->FSPRIVATE) {
8084+ if (dir->i_private) {
8085 session =
8086- Scope_Get_SessionId(((struct inode_data *)dir->FSPRIVATE)->
8087+ novfs_scope_get_sessionId(((struct inode_data *) dir->i_private)->
8088 Scope);
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);
8095+ session =
8096+ novfs_scope_get_sessionId(((struct inode_data *) dir->
8097+ i_private)->Scope);
8098 }
8099
8100- buf =
8101- (char *)Novfs_Malloc(PATH_LENGTH_BUFFER,
8102- GFP_KERNEL);
8103+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8104 if (buf) {
8105 path =
8106- Novfs_dget_path(dentry, buf,
8107+ novfs_dget_path(dentry, buf,
8108 PATH_LENGTH_BUFFER);
8109 if (path) {
8110 retCode =
8111- Novfs_Open_File(path,
8112+ novfs_open_file(path,
8113 nd->
8114 NDOPENFLAGS |
8115 O_RDWR, &info,
8116 &handle, session);
8117 if (!retCode && handle) {
8118- Novfs_Close_File(handle,
8119+ novfs_close_file(handle,
8120 session);
8121- if (!Novfs_i_mknod
8122+ if (!novfs_i_mknod
8123 (dir, dentry,
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 *)
8128+ dentry->
8129+ d_inode->
8130+ i_private)->
8131+ Flags |= UPDATE_INODE;
8132 }
8133 }
8134 }
8135@@ -3165,20 +2633,7 @@ int Novfs_i_create(struct inode *dir, st
8136 return (retCode);
8137 }
8138
8139-/*++======================================================================*/
8140-void update_inode(struct inode *Inode, struct entry_info *Info)
8141-/*
8142- * Arguments:
8143- *
8144- * Returns:
8145- *
8146- * Abstract:
8147- *
8148- * Notes:
8149- *
8150- * Environment:
8151- *
8152- *========================================================================*/
8153+void update_inode(struct inode *Inode, struct novfs_entry_info *Info)
8154 {
8155 static char dbuf[128];
8156
8157@@ -3219,35 +2674,24 @@ void update_inode(struct inode *Inode, s
8158 Inode->i_mtime = Info->mtime;
8159
8160 if (Inode->i_size && Inode->i_sb->s_blocksize) {
8161- Inode->i_blocks = (unsigned long) (Info->size >> (loff_t) Inode->i_blkbits);
8162+ Inode->i_blocks =
8163+ (unsigned long) (Info->size >> (loff_t) Inode->i_blkbits);
8164 Inode->i_bytes = Info->size & (Inode->i_sb->s_blocksize - 1);
8165
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);
8172 }
8173 }
8174
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)
8179-/*
8180- * Arguments:
8181- *
8182- * Returns:
8183- *
8184- * Abstract:
8185- *
8186- * Notes:
8187- *
8188- * Environment:
8189- *
8190- *========================================================================*/
8191 {
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
8200 struct qstr name;
8201 char *buf;
8202
8203- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8204+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8205 if (buf) {
8206 char *path;
8207- path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8208+ path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8209 if (path) {
8210 DbgPrint
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);
8215 }
8216 kfree(buf);
8217 } else {
8218 DbgPrint
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);
8223 }
8224
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;
8229 igrab(dir);
8230 d_add(dentry, dir);
8231 return NULL;
8232 }
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;
8237 igrab(dir);
8238 d_add(dentry, dir);
8239 return NULL;
8240 }
8241
8242- if (dir && (id = dir->FSPRIVATE)) {
8243+ if (dir && (id = dir->i_private)) {
8244 retVal = 0;
8245 if (IS_ROOT(dentry)) {
8246- DbgPrint("Novfs_i_lookup: Root entry=0x%p\n",
8247- Novfs_root);
8248- inode = Novfs_root->d_inode;
8249+ DbgPrint("novfs_i_lookup: Root entry=0x%p\n",
8250+ novfs_root);
8251+ inode = novfs_root->d_inode;
8252 return (0);
8253 } else {
8254 info =
8255- Novfs_Malloc(sizeof(struct entry_info) +
8256+ kmalloc(sizeof(struct novfs_entry_info) +
8257 PATH_LENGTH_BUFFER, GFP_KERNEL);
8258 if (info) {
8259 if (NULL ==
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);
8266
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)) {
8272 inode =
8273 ilookup(dentry->
8274@@ -3319,21 +2763,21 @@ struct dentry *Novfs_i_lookup(struct ino
8275 info);
8276 }
8277 }
8278- Novfs_unlock_inode_cache(dir);
8279+ novfs_unlock_inode_cache(dir);
8280 }
8281
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);
8289 if (inode) {
8290- if (!Novfs_get_entry(dir, &dentry->d_name, &ino, info)) {
8291+ if (!novfs_get_entry(dir, &dentry->d_name, &ino, info)) {
8292 update_inode
8293 (inode,
8294 info);
8295 }
8296 }
8297- Novfs_unlock_inode_cache
8298+ novfs_unlock_inode_cache
8299 (dir);
8300 }
8301 }
8302@@ -3343,10 +2787,10 @@ struct dentry *Novfs_i_lookup(struct ino
8303 }
8304
8305 if (!retVal) {
8306- dentry->d_op = &Novfs_dentry_operations;
8307+ dentry->d_op = &novfs_dentry_operations;
8308 if (inode) {
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);
8312 dput(parent);
8313 } else {
8314 d_add(dentry, inode);
8315@@ -3357,42 +2801,29 @@ struct dentry *Novfs_i_lookup(struct ino
8316 kfree(info);
8317
8318 DbgPrint
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);
8322
8323 return (retVal);
8324 }
8325
8326-/*++======================================================================*/
8327-int Novfs_i_unlink(struct inode *dir, struct dentry *dentry)
8328-/*
8329- * Arguments:
8330- *
8331- * Returns:
8332- *
8333- * Abstract:
8334- *
8335- * Notes:
8336- *
8337- * Environment:
8338- *
8339- *========================================================================*/
8340+int novfs_i_unlink(struct inode *dir, struct dentry *dentry)
8341 {
8342 int retCode = -ENOENT;
8343 struct inode *inode;
8344- session_t session;
8345+ struct novfs_schandle session;
8346 char *path, *buf;
8347 uint64_t t64;
8348
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));
8360 DbgPrint
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));
8364
8365 if (IS_ROOT(dentry) || /* Root */
8366@@ -3405,44 +2836,46 @@ int Novfs_i_unlink(struct inode *dir, st
8367 inode = dentry->d_inode;
8368 if (inode) {
8369 DbgPrint
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) {
8375 session =
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);
8384+ session =
8385+ novfs_scope_get_sessionId(((struct inode_data *) inode->
8386+ i_private)->Scope);
8387 }
8388
8389- buf =
8390- (char *)Novfs_Malloc(PATH_LENGTH_BUFFER,
8391- GFP_KERNEL);
8392+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8393 if (buf) {
8394 path =
8395- Novfs_dget_path(dentry, buf,
8396+ novfs_dget_path(dentry, buf,
8397 PATH_LENGTH_BUFFER);
8398 if (path) {
8399 DbgPrint
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);
8406 } else {
8407 retCode =
8408- Novfs_Delete(path,
8409+ novfs_delete(path,
8410 S_ISDIR(inode->
8411 i_mode),
8412 session);
8413 }
8414 if (!retCode || IS_DEADDIR(inode)) {
8415- Novfs_remove_inode_entry(dir,
8416+ novfs_remove_inode_entry(dir,
8417 &dentry->
8418 d_name,
8419 0);
8420 dentry->d_time = 0;
8421 t64 = 0;
8422- Scope_Set_UserSpace(&t64, &t64,
8423+ novfs_scope_set_userspace(&t64, &t64,
8424 &t64, &t64);
8425 retCode = 0;
8426 }
8427@@ -3452,33 +2885,20 @@ int Novfs_i_unlink(struct inode *dir, st
8428 }
8429 }
8430
8431- DbgPrint("Novfs_i_unlink: retCode 0x%x\n", retCode);
8432+ DbgPrint("novfs_i_unlink: retCode 0x%x\n", retCode);
8433 return (retCode);
8434 }
8435
8436-/*++======================================================================*/
8437-int Novfs_i_mkdir(struct inode *dir, struct dentry *dentry, int mode)
8438-/*
8439- * Arguments:
8440- *
8441- * Returns:
8442- *
8443- * Abstract:
8444- *
8445- * Notes:
8446- *
8447- * Environment:
8448- *
8449- *========================================================================*/
8450+int novfs_i_mkdir(struct inode *dir, struct dentry *dentry, int mode)
8451 {
8452 char *path, *buf;
8453- session_t session;
8454+ struct novfs_schandle session;
8455 int retCode = 0;
8456 struct inode *inode;
8457- struct entry_info info;
8458+ struct novfs_entry_info info;
8459 uid_t uid;
8460
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);
8465
8466@@ -3491,46 +2911,53 @@ int Novfs_i_mkdir(struct inode *dir, str
8467
8468 mode |= S_IFDIR;
8469 mode &= (S_IFMT | S_IRWXU);
8470- if (dir->FSPRIVATE) {
8471+ if (dir->i_private) {
8472 session =
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);
8480 session =
8481- Scope_Get_SessionId(((struct inode_data *)dir->FSPRIVATE)->Scope);
8482+ novfs_scope_get_sessionId(((struct inode_data *) dir->i_private)->
8483+ Scope);
8484 }
8485
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);
8490 if (buf) {
8491- path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8492+ path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8493 if (path) {
8494- DbgPrint("Novfs_i_mkdir: path %s\n", path);
8495+ DbgPrint("novfs_i_mkdir: path %s\n", path);
8496 retCode =
8497- Novfs_Create(path, S_ISDIR(mode), session);
8498+ novfs_create(path, S_ISDIR(mode), session);
8499 if (!retCode) {
8500- retCode = Novfs_Get_File_Info(path, &info, &session);
8501+ retCode =
8502+ novfs_get_file_info(path, &info,
8503+ session);
8504 if (!retCode) {
8505- retCode = Novfs_i_mknod(dir, dentry, mode, 0);
8506+ retCode =
8507+ novfs_i_mknod(dir, dentry,
8508+ mode, 0);
8509 inode = dentry->d_inode;
8510 if (inode) {
8511 update_inode(inode,
8512 &info);
8513- ((struct inode_data *)inode->FSPRIVATE)->Flags &= ~UPDATE_INODE;
8514+ ((struct inode_data *) inode->
8515+ i_private)->Flags &=
8516+ ~UPDATE_INODE;
8517
8518 dentry->d_time =
8519 jiffies +
8520- (File_update_timeout
8521+ (novfs_update_timeout
8522 * HZ);
8523
8524- Novfs_lock_inode_cache
8525+ novfs_lock_inode_cache
8526 (dir);
8527- if (Novfs_update_entry
8528+ if (novfs_update_entry
8529 (dir,
8530 &dentry->d_name, 0,
8531 &info)) {
8532- Novfs_add_inode_entry
8533+ novfs_add_inode_entry
8534 (dir,
8535 &dentry->
8536 d_name,
8537@@ -3538,7 +2965,7 @@ int Novfs_i_mkdir(struct inode *dir, str
8538 i_ino,
8539 &info);
8540 }
8541- Novfs_unlock_inode_cache
8542+ novfs_unlock_inode_cache
8543 (dir);
8544 }
8545
8546@@ -3551,39 +2978,13 @@ int Novfs_i_mkdir(struct inode *dir, str
8547
8548 return (retCode);
8549 }
8550-
8551-/*++======================================================================*/
8552-int Novfs_i_rmdir(struct inode *inode, struct dentry *dentry)
8553-/*
8554- * Arguments:
8555- *
8556- * Returns:
8557- *
8558- * Abstract:
8559- *
8560- * Notes:
8561- *
8562- * Environment:
8563- *
8564- *========================================================================*/
8565+
8566+int novfs_i_rmdir(struct inode *inode, struct dentry *dentry)
8567 {
8568- return (Novfs_i_unlink(inode, dentry));
8569+ return (novfs_i_unlink(inode, dentry));
8570 }
8571
8572-/*++======================================================================*/
8573-int Novfs_i_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
8574-/*
8575- * Arguments:
8576- *
8577- * Returns:
8578- *
8579- * Abstract:
8580- *
8581- * Notes:
8582- *
8583- * Environment:
8584- *
8585- *========================================================================*/
8586+int novfs_i_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
8587 {
8588 struct inode *inode = NULL;
8589 int retCode = -EACCES;
8590@@ -3597,44 +2998,44 @@ int Novfs_i_mknod(struct inode *dir, str
8591 return (-EACCES);
8592 }
8593
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)) {
8599 inode =
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);
8602 }
8603 }
8604 if (inode) {
8605- struct entry_info info;
8606+ struct novfs_entry_info info;
8607
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,
8619 &info);
8620- Novfs_unlock_inode_cache(dir);
8621+ novfs_unlock_inode_cache(dir);
8622
8623 dput(parent);
8624
8625 retCode = 0;
8626 }
8627- DbgPrint("Novfs_i_mknod: return 0x%x\n", retCode);
8628+ DbgPrint("novfs_i_mknod: return 0x%x\n", retCode);
8629 return retCode;
8630 }
8631
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,
8634 struct dentry *nd)
8635 {
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;
8642 int oldlen, newlen;
8643- session_t session;
8644+ struct novfs_schandle session;
8645 ino_t ino;
8646
8647 if (IS_ROOT(od) || /* Root */
8648@@ -3644,29 +3045,29 @@ int Novfs_i_rename(struct inode *odir, s
8649 return (-EACCES);
8650 }
8651
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);
8655
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);
8667
8668 DbgPrint
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);
8672 if (nd->d_inode) {
8673 DbgPrint
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,
8677 newpath);
8678 } else {
8679 DbgPrint
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);
8683 }
8684
8685@@ -3675,9 +3076,9 @@ int Novfs_i_rename(struct inode *odir, s
8686 */
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",
8691 newcon, newpath);
8692- DbgPrint("Novfs_i_rename: oldcon=0x%p oldpath=0x%p\n",
8693+ DbgPrint("novfs_i_rename: oldcon=0x%p oldpath=0x%p\n",
8694 oldcon, oldpath);
8695 retCode = -EXDEV;
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);
8711 oldname.hash = 0;
8712- if (!Novfs_d_strcmp(&newname, &oldname)) {
8713+ if (!novfs_d_strcmp(&newname, &oldname)) {
8714
8715 if (od->d_inode
8716- && od->d_inode->FSPRIVATE) {
8717+ && od->d_inode->i_private) {
8718
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);
8725+ if (nd->d_inode
8726+ && nd->d_inode->
8727+ i_private) {
8728+ session =
8729+ novfs_scope_get_sessionId
8730+ (((struct inode_data *) ndir->i_private)->Scope);
8731+ if (0 ==
8732+ SC_PRESENT
8733+ (session)) {
8734+ ((struct inode_data *) ndir->i_private)->Scope = novfs_get_scope(nd);
8735+ session
8736+ =
8737+ novfs_scope_get_sessionId
8738+ (((struct inode_data *) ndir->i_private)->Scope);
8739 }
8740
8741- retCode = Novfs_Delete(newpath, S_ISDIR(nd->d_inode->i_mode), session);
8742+ retCode =
8743+ novfs_delete
8744+ (newpath,
8745+ S_ISDIR
8746+ (nd->
8747+ d_inode->
8748+ i_mode),
8749+ session);
8750 }
8751
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);
8759 }
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);
8762
8763 if (!retCode) {
8764- info = (struct entry_info *) oldbuf;
8765+ info = (struct novfs_entry_info *) oldbuf;
8766 od->d_time = 0;
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);
8775
8776 if (od->d_inode && od->d_inode->i_ino) {
8777 ino = od->d_inode-> i_ino;
8778 } else {
8779- ino = (ino_t)atomic_inc_return(&Novfs_Inode_Number);
8780+ ino = (ino_t)atomic_inc_return(&novfs_Inode_Number);
8781 }
8782- Novfs_add_inode_entry(ndir, &nd->d_name, ino, info);
8783+ novfs_add_inode_entry(ndir, &nd->d_name, ino, info);
8784 }
8785 }
8786 }
8787@@ -3744,44 +3160,12 @@ int Novfs_i_rename(struct inode *odir, s
8788 if (oldbuf)
8789 kfree(oldbuf);
8790
8791- DbgPrint("Novfs_i_rename: return %d\n", retCode);
8792+ DbgPrint("novfs_i_rename: return %d\n", retCode);
8793 return (retCode);
8794 }
8795
8796-/*++======================================================================*/
8797-int Novfs_i_permission(struct inode *inode, int mask)
8798-/*
8799- * Arguments:
8800- *
8801- * Returns:
8802- *
8803- * Abstract:
8804- *
8805- * Notes:
8806- *
8807- * Environment:
8808- *
8809- *========================================================================*/
8810-{
8811- int retCode = 0;
8812-
8813- return (retCode);
8814-}
8815
8816-/*++======================================================================*/
8817-int Novfs_i_setattr(struct dentry *dentry, struct iattr *attr)
8818-/*
8819- * Arguments:
8820- *
8821- * Returns:
8822- *
8823- * Abstract:
8824- *
8825- * Notes:
8826- *
8827- * Environment:
8828- *
8829- *========================================================================*/
8830+int novfs_i_setattr(struct dentry *dentry, struct iattr *attr)
8831 {
8832 char *path, *buf;
8833 struct inode *inode = dentry->d_inode;
8834@@ -3789,7 +3173,7 @@ int Novfs_i_setattr(struct dentry *dentr
8835 char mtime_buf[32];
8836 char ctime_buf[32];
8837 unsigned int ia_valid = attr->ia_valid;
8838- session_t session;
8839+ struct novfs_schandle session;
8840 int retVal = 0;
8841 struct iattr mattr;
8842
8843@@ -3800,20 +3184,21 @@ int Novfs_i_setattr(struct dentry *dentr
8844 return (-EACCES);
8845 }
8846
8847- if (inode && inode->FSPRIVATE) {
8848+ if (inode && inode->i_private) {
8849 session =
8850- Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->Scope);
8851+ novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->
8852+ Scope);
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);
8858 session =
8859- Scope_Get_SessionId(((struct inode_data *) inode->
8860- FSPRIVATE)->Scope);
8861+ novfs_scope_get_sessionId(((struct inode_data *) inode->
8862+ i_private)->Scope);
8863 }
8864
8865- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8866+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8867 if (buf) {
8868- path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8869+ path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
8870 if (path) {
8871 strcpy(atime_buf, "Unspecified");
8872 strcpy(mtime_buf, "Unspecified");
8873@@ -3831,7 +3216,7 @@ int Novfs_i_setattr(struct dentry *dentr
8874 ctime_buf);
8875 }
8876 /* Removed for Bug 132374. jlt */
8877- DbgPrint("Novfs_i_setattr: %s\n"
8878+ DbgPrint("novfs_i_setattr: %s\n"
8879 " ia_valid: 0x%x\n"
8880 " ia_mode: 0%o\n"
8881 " ia_uid: %d\n"
8882@@ -3855,19 +3240,28 @@ int Novfs_i_setattr(struct dentry *dentr
8883 ~(ATTR_FILE | ATTR_SIZE);
8884 attr = &mattr;
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...
8889+ retVal =
8890+ novfs_trunc_ex(attr->
8891+ ia_file->
8892+ private_data,
8893+ attr->
8894+ ia_size,
8895+ session);
8896 if (!retVal) {
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 |=
8901+ UPDATE_INODE;
8902 }
8903 #endif
8904 }
8905
8906 if (ia_valid
8907 && !(retVal =
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;
8913
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
8917 }
8918 kfree(buf);
8919 }
8920- DbgPrint("Novfs_i_setattr: return 0x%x\n", retVal);
8921+ DbgPrint("novfs_i_setattr: return 0x%x\n", retVal);
8922
8923 return (retVal);
8924 }
8925
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)
8930-/*
8931- * Arguments:
8932- *
8933- * Returns:
8934- *
8935- * Abstract:
8936- *
8937- * Notes:
8938- *
8939- * Environment:
8940- *
8941- *========================================================================*/
8942 {
8943 int retCode = 0;
8944 char atime_buf[32];
8945@@ -3913,32 +3294,32 @@ int Novfs_i_getattr(struct vfsmount *mnt
8946 char ctime_buf[32];
8947 struct inode *inode = dentry->d_inode;
8948
8949- struct entry_info info;
8950+ struct novfs_entry_info info;
8951 char *path, *buf;
8952- session_t session;
8953+ struct novfs_schandle session;
8954 struct inode_data *id;
8955
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;
8960
8961 if (id && (id->Flags & UPDATE_INODE)) {
8962- session = Scope_Get_SessionId(id->Scope);
8963+ session = novfs_scope_get_sessionId(id->Scope);
8964
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);
8970 }
8971
8972- buf =
8973- (char *)Novfs_Malloc(PATH_LENGTH_BUFFER,
8974- GFP_KERNEL);
8975+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
8976 if (buf) {
8977 path =
8978- Novfs_dget_path(dentry, buf,
8979+ novfs_dget_path(dentry, buf,
8980 PATH_LENGTH_BUFFER);
8981 if (path) {
8982- retCode = Novfs_Get_File_Info(path, &info, &session);
8983+ retCode =
8984+ novfs_get_file_info(path, &info,
8985+ session);
8986 if (!retCode) {
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);
8992
8993- DbgPrint("Novfs_i_getattr: 0x%x 0x%p <%.*s>\n"
8994+ DbgPrint("novfs_i_getattr: 0x%x 0x%p <%.*s>\n"
8995 " ino: %d\n"
8996 " dev: 0x%x\n"
8997 " mode: 0%o\n"
8998@@ -3997,24 +3378,11 @@ int Novfs_i_getattr(struct vfsmount *mnt
8999 return (retCode);
9000 }
9001
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,
9005 size_t buffer_size)
9006-/*
9007- * Arguments:
9008- *
9009- * Returns:
9010- *
9011- * Abstract:
9012- *
9013- * Notes:
9014- *
9015- * Environment:
9016- *
9017- *========================================================================*/
9018 {
9019 struct inode *inode = dentry->d_inode;
9020- session_t sessionId;
9021+ struct novfs_schandle sessionId;
9022 char *path, *buf, *bufRead;
9023 ssize_t dataLen;
9024
9025@@ -4022,44 +3390,53 @@ int Novfs_i_getxattr(struct dentry *dent
9026
9027 SC_INITIALIZE(sessionId);
9028
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); */
9031 DbgPrint
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);
9039
9040- if (inode && inode->FSPRIVATE) {
9041+ if (inode && inode->i_private) {
9042 sessionId =
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)->
9046+ Scope);
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);
9055+ sessionId =
9056+ novfs_scope_get_sessionId(((struct inode_data *) inode->
9057+ i_private)->Scope);
9058+ DbgPrint("novfs_i_getxattr: SessionId = %u\n",
9059 sessionId);
9060 }
9061 }
9062
9063 dataLen = 0;
9064- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9065+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9066 if (buf) {
9067- path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9068+ path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9069 if (path) {
9070- bufRead = (char *)Novfs_Malloc(XA_BUFFER, GFP_KERNEL);
9071+ bufRead = kmalloc(XA_BUFFER, GFP_KERNEL);
9072 if (bufRead) {
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);
9075+ retxcode =
9076+ novfs_getx_file_info(path, name, bufRead,
9077+ XA_BUFFER, &dataLen,
9078+ sessionId);
9079+ DbgPrint
9080+ ("novfs_i_getxattr: after novfs_GetX_File_Info retxcode = %d\n",
9081+ retxcode);
9082 if (!retxcode) {
9083- mydump(64, bufRead);
9084+ novfs_dump(64, bufRead);
9085 if (buffer_size != 0) {
9086 if (buffer_size >= dataLen) {
9087 memcpy(buffer, bufRead,
9088 dataLen);
9089 } else {
9090 DbgPrint
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",
9093 buffer_size,
9094 dataLen);
9095 retxcode = -ERANGE;
9096@@ -4086,25 +3463,12 @@ int Novfs_i_getxattr(struct dentry *dent
9097 return (dataLen);
9098 }
9099
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)
9104-/*
9105- * Arguments:
9106- *
9107- * Returns:
9108- *
9109- * Abstract:
9110- *
9111- * Notes:
9112- *
9113- * Environment:
9114- *
9115- *========================================================================*/
9116 {
9117
9118 struct inode *inode = dentry->d_inode;
9119- session_t sessionId;
9120+ struct novfs_schandle sessionId;
9121 char *path, *buf;
9122 unsigned long bytesWritten = 0;
9123 int retError = 0;
9124@@ -4112,42 +3476,42 @@ int Novfs_i_setxattr(struct dentry *dent
9125
9126 SC_INITIALIZE(sessionId);
9127
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); */
9130 DbgPrint
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);
9140
9141- if (inode && inode->FSPRIVATE) {
9142+ if (inode && inode->i_private) {
9143 sessionId =
9144- Scope_Get_SessionId(((struct inode_data *)inode->FSPRIVATE)->
9145+ novfs_scope_get_sessionId(((struct inode_data *) inode->i_private)->
9146 Scope);
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);
9155 sessionId =
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",
9162 sessionId);
9163 }
9164 }
9165
9166- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9167+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9168 if (buf) {
9169- path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9170+ path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9171 if (path) {
9172 retxcode =
9173- Novfs_SetX_File_Info(path, name, value, value_size,
9174+ novfs_setx_file_info(path, name, value, value_size,
9175 &bytesWritten, flags,
9176- &sessionId);
9177+ sessionId);
9178 if (!retxcode) {
9179 DbgPrint
9180- ("Novfs_i_setxattr: bytesWritten = %u\n",
9181+ ("novfs_i_setxattr: bytesWritten = %u\n",
9182 bytesWritten);
9183 }
9184 }
9185@@ -4164,53 +3528,59 @@ int Novfs_i_setxattr(struct dentry *dent
9186 return (retError);
9187 }
9188
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)
9191 {
9192 struct inode *inode = dentry->d_inode;
9193- session_t sessionId;
9194+ struct novfs_schandle sessionId;
9195 char *path, *buf, *bufList;
9196 ssize_t dataLen;
9197-
9198 int retxcode = 0;
9199
9200 SC_INITIALIZE(sessionId);
9201
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);
9204 DbgPrint
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);
9210
9211- if (inode && inode->FSPRIVATE) {
9212+ if (inode && inode->i_private) {
9213 sessionId =
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)->
9217+ Scope);
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);
9226+ sessionId =
9227+ novfs_scope_get_sessionId(((struct inode_data *) inode->
9228+ i_private)->Scope);
9229+ DbgPrint("novfs_i_listxattr: SessionId = %u\n",
9230 sessionId);
9231 }
9232 }
9233
9234 dataLen = 0;
9235- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9236+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9237 if (buf) {
9238- path = Novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9239+ path = novfs_dget_path(dentry, buf, PATH_LENGTH_BUFFER);
9240 if (path) {
9241- bufList = (char *)Novfs_Malloc(XA_BUFFER, GFP_KERNEL);
9242+ bufList = kmalloc(XA_BUFFER, GFP_KERNEL);
9243 if (bufList) {
9244- retxcode = Novfs_ListX_File_Info(path, bufList, XA_BUFFER, &dataLen, &sessionId);
9245+ retxcode =
9246+ novfs_listx_file_info(path, bufList,
9247+ XA_BUFFER, &dataLen,
9248+ sessionId);
9249
9250- mydump(64, bufList);
9251+ novfs_dump(64, bufList);
9252 if (buffer_size != 0) {
9253 if (buffer_size >= dataLen) {
9254 memcpy(buffer, bufList,
9255 dataLen);
9256 } else {
9257 DbgPrint
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);
9261 retxcode = -1;
9262 }
9263@@ -4236,120 +3606,92 @@ int Novfs_i_listxattr(struct dentry *den
9264 return (dataLen);
9265 }
9266
9267-int Novfs_i_revalidate(struct dentry *dentry)
9268+int novfs_i_revalidate(struct dentry *dentry)
9269 {
9270
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);
9274
9275 return (0);
9276 }
9277
9278-void Novfs_read_inode(struct inode *inode)
9279+void novfs_read_inode(struct inode *inode)
9280 {
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);
9283 }
9284
9285-void Novfs_write_inode(struct inode *inode)
9286+void novfs_write_inode(struct inode *inode)
9287 {
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);
9290 }
9291
9292-int Novfs_notify_change(struct dentry *dentry, struct iattr *attr)
9293+int novfs_notify_change(struct dentry *dentry, struct iattr *attr)
9294 {
9295 struct inode *inode = dentry->d_inode;
9296
9297 DbgPrint
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);
9302 return (0);
9303 }
9304
9305-/*++======================================================================*/
9306-void Novfs_clear_inode(struct inode *inode)
9307-/*
9308- * Arguments: sb - pointer to the super_block
9309- * buf - pointer to the statfs buffer
9310- *
9311- * Returns: 0
9312- *
9313- * Abstract: Called when statfs(2) system called.
9314- *
9315- * Notes:
9316- *
9317- * Environment: Superblock operation
9318- *
9319- *========================================================================*/
9320+void novfs_clear_inode(struct inode *inode)
9321 {
9322 InodeCount--;
9323
9324- if (inode->FSPRIVATE) {
9325- struct inode_data *id = inode->FSPRIVATE;
9326+ if (inode->i_private) {
9327+ struct inode_data *id = inode->i_private;
9328
9329 DbgPrint
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);
9333
9334- Novfs_free_inode_cache(inode);
9335+ novfs_free_inode_cache(inode);
9336
9337 down(&InodeList_lock);
9338 list_del(&id->IList);
9339 up(&InodeList_lock);
9340
9341- kfree(inode->FSPRIVATE);
9342- inode->FSPRIVATE = NULL;
9343+ kfree(inode->i_private);
9344+ inode->i_private = NULL;
9345
9346 remove_inode_hash(inode);
9347
9348 } else {
9349- DbgPrint("Novfs_clear_inode: inode=0x%p ino=%d\n", inode,
9350+ DbgPrint("novfs_clear_inode: inode=0x%p ino=%d\n", inode,
9351 inode->i_ino);
9352 }
9353 }
9354
9355-/*++======================================================================*/
9356-int Novfs_show_options(struct seq_file *s, struct vfsmount *m)
9357-/*
9358- * Arguments:
9359- *
9360- * Returns: 0
9361- *
9362- * Abstract: Called when /proc/mounts is read
9363- *
9364- * Notes:
9365- *
9366- * Environment:
9367- *
9368- *========================================================================*/
9369+/* Called when /proc/mounts is read */
9370+int novfs_show_options(struct seq_file *s, struct vfsmount *m)
9371 {
9372 char *buf, *path, *tmp;
9373
9374- buf = (char *)Novfs_Malloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9375+ buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
9376 if (buf) {
9377 struct path my_path;
9378 my_path.mnt = m;
9379 my_path.dentry = m->mnt_root;
9380 path = d_path(&my_path, buf, PATH_LENGTH_BUFFER);
9381 if (path) {
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);
9394- tmp =
9395- (char *)Novfs_Malloc(PATH_LENGTH_BUFFER -
9396+ tmp = kmalloc(PATH_LENGTH_BUFFER -
9397 (int)(path - buf),
9398 GFP_KERNEL);
9399 if (tmp) {
9400 strcpy(tmp, path);
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);
9408
9409 if (path) {
9410 kfree(path);
9411@@ -4362,37 +3704,17 @@ int Novfs_show_options(struct seq_file *
9412 return (0);
9413 }
9414
9415-/*++======================================================================*/
9416-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9417-int Novfs_statfs(struct dentry *de, struct kstatfs *buf)
9418-#else
9419-int Novfs_statfs(struct super_block *sb, struct kstatfs *buf)
9420-#endif
9421-/*
9422- * Arguments: sb - pointer to the super_block
9423- * buf - pointer to the statfs buffer
9424- *
9425- * Returns: 0
9426- *
9427- * Abstract: Called when statfs(2) system called.
9428- *
9429- * Notes:
9430- *
9431- * Environment: Superblock operation
9432- *
9433- *========================================================================*/
9434+/* Called when statfs(2) system called. */
9435+int novfs_statfs(struct dentry *de, struct kstatfs *buf)
9436 {
9437 uint64_t td, fd, te, fe;
9438-
9439-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9440 struct super_block *sb = de->d_sb;
9441-#endif
9442
9443- DbgPrint("Novfs_statfs:\n");
9444+ DbgPrint("novfs_statfs:\n");
9445
9446 td = fd = te = fe = 0;
9447
9448- Scope_Get_UserSpace(&td, &fd, &te, &fe);
9449+ novfs_scope_get_userspace(&td, &fd, &te, &fe);
9450
9451 DbgPrint("td=%llu\n", td);
9452 DbgPrint("fd=%llu\n", fd);
9453@@ -4430,7 +3752,7 @@ int Novfs_statfs(struct super_block *sb,
9454 return 0;
9455 }
9456
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)
9460 {
9461 struct inode *inode = new_inode(sb);
9462@@ -4440,37 +3762,32 @@ struct inode *Novfs_get_inode(struct sup
9463 inode->i_mode = mode;
9464 inode->i_uid = Uid;
9465 inode->i_gid = 0;
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;
9469-//#else
9470-// inode->i_sb->s_blocksize = sb->s_blocksize;
9471-//#endif
9472+ inode->i_sb->s_blocksize = sb->s_blocksize;
9473 inode->i_blkbits = sb->s_blocksize_bits;
9474 inode->i_blocks = 0;
9475 inode->i_rdev = 0;
9476- inode->i_ino = (ino) ? ino : (ino_t)atomic_inc_return(&Novfs_Inode_Number);
9477- if (PageCache) {
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;
9482 } else {
9483- inode->i_mapping->a_ops = &Novfs_nocache_aops;
9484+ inode->i_mapping->a_ops = &novfs_nocache_aops;
9485 }
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;
9491
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);
9495
9496 if (NULL !=
9497- (inode->FSPRIVATE =
9498- Novfs_Malloc(sizeof(struct inode_data) + name->len,
9499+ (inode->i_private =
9500+ kmalloc(sizeof(struct inode_data) + name->len,
9501 GFP_KERNEL))) {
9502 struct inode_data *id;
9503- id = inode->FSPRIVATE;
9504+ id = inode->i_private;
9505
9506- DbgPrint("Novfs_get_inode: FSPRIVATE 0x%p\n", id);
9507+ DbgPrint("novfs_get_inode: i_private 0x%p\n", id);
9508
9509 id->Scope = NULL;
9510 id->Flags = 0;
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';
9514
9515- DbgPrint("Novfs_get_inode: name %s\n", id->Name);
9516+ DbgPrint("novfs_get_inode: name %s\n", id->Name);
9517 }
9518
9519 insert_inode_hash(inode);
9520@@ -4502,19 +3819,15 @@ struct inode *Novfs_get_inode(struct sup
9521 switch (mode & S_IFMT) {
9522
9523 case S_IFREG:
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;
9528 break;
9529
9530 case S_IFDIR:
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;
9536-//#else
9537-// inode->i_sb->s_blocksize = 0;
9538-//#endif
9539+ inode->i_op = &novfs_inode_operations;
9540+ inode->i_fop = &novfs_dir_operations;
9541+
9542+ inode->i_sb->s_blocksize = 0;
9543 inode->i_blkbits = 0;
9544 break;
9545
9546@@ -4523,63 +3836,63 @@ struct inode *Novfs_get_inode(struct sup
9547 break;
9548 }
9549
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);
9563 }
9564
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);
9567 return (inode);
9568 }
9569
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)
9572 {
9573 struct inode *inode;
9574 struct dentry *server, *tree;
9575 struct qstr name;
9576- struct entry_info info;
9577+ struct novfs_entry_info info;
9578
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;
9586
9587 name.len = 1;
9588 name.name = "/";
9589
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);
9592 if (!inode) {
9593 return (-ENOMEM);
9594 }
9595
9596- Novfs_root = d_alloc_root(inode);
9597+ novfs_root = d_alloc_root(inode);
9598
9599- if (!Novfs_root) {
9600+ if (!novfs_root) {
9601 iput(inode);
9602 return (-ENOMEM);
9603 }
9604- Novfs_root->d_time = jiffies + (File_update_timeout * HZ);
9605+ novfs_root->d_time = jiffies + (novfs_update_timeout * HZ);
9606
9607 inode->i_atime = inode->i_ctime = inode->i_mtime = CURRENT_TIME;
9608
9609- SB->s_root = Novfs_root;
9610+ SB->s_root = novfs_root;
9611
9612- DbgPrint("Novfs_fill_super: root 0x%p\n", Novfs_root);
9613+ DbgPrint("novfs_fill_super: root 0x%p\n", novfs_root);
9614
9615- if (Novfs_root) {
9616- Novfs_root->d_op = &Novfs_dentry_operations;
9617+ if (novfs_root) {
9618+ novfs_root->d_op = &novfs_dentry_operations;
9619
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);
9624
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);
9627 if (inode) {
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;
9633
9634- server = d_alloc(Novfs_root, &name);
9635+ server = d_alloc(novfs_root, &name);
9636 if (server) {
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,
9647 &info);
9648 }
9649@@ -4605,9 +3918,9 @@ int Novfs_fill_super(struct super_block
9650
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);
9655
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);
9658 if (inode) {
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);
9667 if (tree) {
9668- tree->d_op = &Novfs_dentry_operations;
9669+ tree->d_op = &novfs_dentry_operations;
9670 tree->d_time = 0xffffffff;
9671
9672 d_add(tree, inode);
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,
9679 &info);
9680 }
9681@@ -4635,75 +3948,53 @@ int Novfs_fill_super(struct super_block
9682 return (0);
9683 }
9684
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)
9689-#else
9690-struct super_block *Novfs_get_sb(struct file_system_type *Fstype, int Flags,
9691- const char *Dev_name, void *Data)
9692-#endif
9693 {
9694-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9695- int sb;
9696-#else
9697- struct super_block *sb;
9698-#endif
9699-
9700-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
9701- sb = get_sb_nodev(Fstype, Flags, Data, Novfs_fill_super, Mnt);
9702-#else
9703- sb = get_sb_nodev(Fstype, Flags, Data, Novfs_fill_super);
9704-#endif
9705-
9706- DbgPrint("Novfs_get_sb: sb=0x%p Fstype=0x%x Dev_name=%s\n", sb, Fstype,
9707- Dev_name);
9708-
9709- return (sb);
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);
9712 }
9713
9714 static void novfs_kill_sb(struct super_block *super)
9715 {
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);
9720 }
9721
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,
9724 loff_t * ppos)
9725 {
9726 ssize_t retval = 0;
9727
9728- DbgPrint("Novfs_Control_read: kernel_locked 0x%x\n", kernel_locked());
9729+ DbgPrint("novfs_Control_read: kernel_locked 0x%x\n", kernel_locked());
9730
9731 return retval;
9732 }
9733
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,
9736 loff_t * ppos)
9737 {
9738 ssize_t retval = 0;
9739
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) {
9743 }
9744
9745 return (retval);
9746 }
9747
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)
9751 {
9752 int retval = 0;
9753
9754- DbgPrint("Novfs_Control_ioctl: kernel_locked 0x%x\n", kernel_locked());
9755+ DbgPrint("novfs_Control_ioctl: kernel_locked 0x%x\n", kernel_locked());
9756
9757 return (retval);
9758 }
9759
9760-static struct file_system_type Novfs_fs_type = {
9761+static struct file_system_type novfs_fs_type = {
9762 .name = "novfs",
9763- .get_sb = Novfs_get_sb,
9764+ .get_sb = novfs_get_sb,
9765 .kill_sb = novfs_kill_sb,
9766 .owner = THIS_MODULE,
9767 };
9768@@ -4718,20 +4009,20 @@ int __init init_novfs(void)
9769 inHAX = 0;
9770 inHAXTime = get_nanosecond_time();
9771
9772- retCode = Init_Procfs_Interface();
9773+ retCode = novfs_proc_init();
9774
9775- init_profile();
9776+ novfs_profile_init();
9777
9778 if (!retCode) {
9779 DbgPrint("init_novfs: %s %s %s\n", __DATE__, __TIME__,
9780 NOVFS_VERSION_STRING);
9781- Init_Daemon_Queue();
9782- Scope_Init();
9783- retCode = register_filesystem(&Novfs_fs_type);
9784+ novfs_daemon_queue_init();
9785+ novfs_scope_init();
9786+ retCode = register_filesystem(&novfs_fs_type);
9787 if (retCode) {
9788- Uninit_Procfs_Interface();
9789- Uninit_Daemon_Queue();
9790- Scope_Uninit();
9791+ novfs_proc_exit();
9792+ novfs_daemon_queue_exit();
9793+ novfs_scope_exit();
9794 }
9795 }
9796 return (retCode);
9797@@ -4741,80 +4032,52 @@ void __exit exit_novfs(void)
9798 {
9799 printk(KERN_INFO "exit_novfs\n");
9800
9801- Scope_Uninit();
9802+ novfs_scope_exit();
9803 printk(KERN_INFO "exit_novfs after Scope_Uninit\n");
9804
9805- Uninit_Daemon_Queue();
9806+ novfs_daemon_queue_exit();
9807 printk(KERN_INFO "exit_novfs after Uninit_Daemon_Queue\n");
9808
9809- uninit_profile();
9810- printk(KERN_INFO "exit_novfs after uninit_profile\n");
9811+ novfs_profile_exit();
9812+ printk(KERN_INFO "exit_novfs after profile_exit\n");
9813
9814- Uninit_Procfs_Interface();
9815+ novfs_proc_exit();
9816 printk(KERN_INFO "exit_novfs Uninit_Procfs_Interface\n");
9817
9818- unregister_filesystem(&Novfs_fs_type);
9819+ unregister_filesystem(&novfs_fs_type);
9820 printk(KERN_INFO "exit_novfs: Exit\n");
9821
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;
9828 }
9829 }
9830
9831-int Novfs_lock_inode_cache(struct inode *i)
9832-/*
9833- *
9834- * Arguments: struct inode *i - pointer to directory inode
9835- *
9836- * Returns: 0 - locked
9837- * -1 - not locked
9838- *
9839- * Abstract: Locks the inode cache.
9840- *
9841- * Notes:
9842- *
9843- * Environment:
9844- *
9845- *========================================================================*/
9846+int novfs_lock_inode_cache(struct inode *i)
9847 {
9848 struct inode_data *id;
9849 int retVal = 0;
9850
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);
9856 retVal = 1;
9857 }
9858- DbgPrint("Novfs_lock_inode_cache: return %d\n", retVal);
9859+ DbgPrint("novfs_lock_inode_cache: return %d\n", retVal);
9860 return (retVal);
9861 }
9862
9863-/*++======================================================================*/
9864-void Novfs_unlock_inode_cache(struct inode *i)
9865-/*
9866- * Arguments: struct inode *i - pointer to directory inode
9867- *
9868- * Returns: nothing
9869- *
9870- * Abstract: Unlocks inode cache.
9871- *
9872- * Notes:
9873- *
9874- * Environment:
9875- *
9876- *========================================================================*/
9877+void novfs_unlock_inode_cache(struct inode *i)
9878 {
9879 struct inode_data *id;
9880
9881- if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
9882+ if (i && (id = i->i_private) && id->DirCache.next) {
9883 up(&id->DirCacheLock);
9884 }
9885 }
9886
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)
9892 /*
9893 * Arguments: struct inode *i - pointer to directory inode
9894 *
9895@@ -4824,17 +4087,14 @@ int Novfs_enumerate_inode_cache(struct i
9896 * Abstract: Unlocks inode cache.
9897 *
9898 * Notes: DirCacheLock should be held before calling this routine.
9899- *
9900- * Environment:
9901- *
9902 *========================================================================*/
9903 {
9904 struct inode_data *id;
9905- struct dir_cache *dc;
9906+ struct novfs_dir_cache *dc;
9907 struct list_head *l = NULL;
9908 int retVal = -1;
9909
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;
9914 } else {
9915@@ -4844,7 +4104,7 @@ int Novfs_enumerate_inode_cache(struct i
9916 if (l == &id->DirCache) {
9917 l = NULL;
9918 } else {
9919- dc = list_entry(l, struct dir_cache, list);
9920+ dc = list_entry(l, struct novfs_dir_cache, list);
9921
9922 *ino = dc->ino;
9923 info->type = 0;
9924@@ -4865,35 +4125,23 @@ int Novfs_enumerate_inode_cache(struct i
9925 return (retVal);
9926 }
9927
9928-/*++======================================================================*/
9929-int Novfs_get_entry(struct inode *i, struct qstr *name, ino_t * ino,
9930- struct entry_info *info)
9931-/*
9932- * Arguments:
9933- *
9934- * Returns:
9935- *
9936- * Abstract:
9937- *
9938- * Notes: DirCacheLock should be held before calling this routine.
9939- *
9940- * Environment:
9941- *
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)
9946 {
9947 struct inode_data *id;
9948- struct dir_cache *dc;
9949+ struct novfs_dir_cache *dc;
9950 int retVal = -1;
9951 char *n = "<NULL>";
9952 int nl = 6;
9953
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;
9958 nl = name->len;
9959 }
9960
9961- dc = Novfs_lookup_inode_cache(i, name, *ino);
9962+ dc = novfs_lookup_inode_cache(i, name, *ino);
9963 if (dc) {
9964 dc->flags |= ENTRY_VALID;
9965 retVal = 0;
9966@@ -4910,36 +4158,25 @@ int Novfs_get_entry(struct inode *i, str
9967 retVal = 0;
9968 }
9969
9970- DbgPrint("Novfs_get_entry:\n"
9971+ DbgPrint("novfs_get_entry:\n"
9972 " inode: 0x%p\n"
9973 " name: %.*s\n" " ino: %d\n", i, nl, n, *ino);
9974 }
9975- DbgPrint("Novfs_get_entry: return %d\n", retVal);
9976+ DbgPrint("novfs_get_entry: return %d\n", retVal);
9977 return (retVal);
9978 }
9979
9980-int Novfs_get_entry_by_pos(struct inode *i, loff_t pos, ino_t * ino,
9981- struct entry_info *info)
9982-/*
9983- * Arguments:
9984- *
9985- * Returns:
9986- *
9987- * Abstract:
9988- *
9989- * Notes: DirCacheLock should be held before calling this routine.
9990- *
9991- * Environment:
9992- *
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)
9997 {
9998 int retVal = -1;
9999 loff_t count = 0;
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)) {
10004 DbgPrint
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",
10007 info->name);
10008 if (count == i_pos) {
10009 retVal = 0;
10010@@ -4951,38 +4188,26 @@ int Novfs_get_entry_by_pos(struct inode
10011 return retVal;
10012 }
10013
10014-/*++======================================================================*/
10015-int Novfs_get_entry_time(struct inode *i, struct qstr *name, ino_t * ino,
10016- struct entry_info *info, u64 * EntryTime)
10017-/*
10018- * Arguments:
10019- *
10020- * Returns:
10021- *
10022- * Abstract:
10023- *
10024- * Notes: DirCacheLock should be held before calling this routine.
10025- *
10026- * Environment:
10027- *
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)
10032 {
10033 struct inode_data *id;
10034- struct dir_cache *dc;
10035+ struct novfs_dir_cache *dc;
10036 int retVal = -1;
10037 char *n = "<NULL>";
10038 int nl = 6;
10039
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;
10044 nl = name->len;
10045 }
10046- DbgPrint("Novfs_get_entry_time:\n"
10047+ DbgPrint("novfs_get_entry_time:\n"
10048 " inode: 0x%p\n"
10049 " name: %.*s\n" " ino: %d\n", i, nl, n, *ino);
10050
10051- dc = Novfs_lookup_inode_cache(i, name, *ino);
10052+ dc = novfs_lookup_inode_cache(i, name, *ino);
10053 if (dc) {
10054 retVal = 0;
10055 *ino = dc->ino;
10056@@ -5001,36 +4226,29 @@ int Novfs_get_entry_time(struct inode *i
10057 retVal = 0;
10058 }
10059 }
10060- DbgPrint("Novfs_get_entry_time: return %d\n", retVal);
10061+ DbgPrint("novfs_get_entry_time: return %d\n", retVal);
10062 return (retVal);
10063 }
10064
10065-/*++======================================================================*/
10066-int Novfs_get_remove_entry(struct inode *i, ino_t * ino, struct entry_info *info)
10067 /*
10068- * Arguments:
10069- *
10070- * Returns:
10071- *
10072 * Abstract: This routine will return the first entry on the list
10073 * and then remove it.
10074 *
10075 * Notes: DirCacheLock should be held before calling this routine.
10076 *
10077- * Environment:
10078- *
10079- *========================================================================*/
10080+ */
10081+int novfs_get_remove_entry(struct inode *i, ino_t * ino, struct novfs_entry_info *info)
10082 {
10083 struct inode_data *id;
10084- struct dir_cache *dc;
10085+ struct novfs_dir_cache *dc;
10086 struct list_head *l = NULL;
10087 int retVal = -1;
10088
10089- if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10090+ if (i && (id = i->i_private) && id->DirCache.next) {
10091 l = id->DirCache.next;
10092
10093 if (l != &id->DirCache) {
10094- dc = list_entry(l, struct dir_cache, list);
10095+ dc = list_entry(l, struct novfs_dir_cache, list);
10096
10097 *ino = dc->ino;
10098 info->type = 0;
10099@@ -5054,41 +4272,31 @@ int Novfs_get_remove_entry(struct inode
10100 return (retVal);
10101 }
10102
10103-/*++======================================================================*/
10104-void Novfs_invalidate_inode_cache(struct inode *i)
10105 /*
10106- * Arguments: struct inode *i - pointer to directory inode
10107- *
10108- * Returns: nothing
10109- *
10110 * Abstract: Marks all entries in the directory cache as invalid.
10111 *
10112 * Notes: DirCacheLock should be held before calling this routine.
10113 *
10114- * Environment:
10115- *
10116 *========================================================================*/
10117+void novfs_invalidate_inode_cache(struct inode *i)
10118 {
10119 struct inode_data *id;
10120- struct dir_cache *dc;
10121+ struct novfs_dir_cache *dc;
10122 struct list_head *l;
10123
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;
10130 }
10131 }
10132 }
10133
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,
10137+ ino_t ino)
10138 /*
10139- * Arguments: struct inode *i - pointer to directory inode
10140- * struct qstr *name - pointer to name
10141- * ino_t - inode number
10142- *
10143- * Returns: struct dir_cache entry if match
10144+ * Returns: struct novfs_dir_cache entry if match
10145 * NULL - if there is no match.
10146 *
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
10149 *
10150 * Notes: DirCacheLock should be held before calling this routine.
10151 *
10152- * Environment:
10153- *
10154 *========================================================================*/
10155 {
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>";
10162 int nl = 6;
10163 int hash = 0;
10164
10165- if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10166+ if (i && (id = i->i_private) && id->DirCache.next) {
10167 if (name && name->name) {
10168 nl = name->len;
10169 n = (char *)name->name;
10170 hash = name->hash;
10171 }
10172- DbgPrint("Novfs_lookup_inode_cache:\n"
10173+ DbgPrint("novfs_lookup_inode_cache:\n"
10174 " inode: 0x%p\n"
10175 " name: %.*s\n"
10176 " hash: 0x%x\n"
10177@@ -5123,10 +4328,10 @@ static struct dir_cache *Novfs_lookup_in
10178 " ino: %d\n", i, nl, n, hash, nl, ino);
10179
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);
10183 if (name) {
10184
10185-/* DbgPrint("Novfs_lookup_inode_cache: 0x%p\n" \
10186+/* DbgPrint("novfs_lookup_inode_cache: 0x%p\n" \
10187 " ino: %d\n" \
10188 " hash: 0x%x\n" \
10189 " len: %d\n" \
10190@@ -5149,46 +4354,34 @@ static struct dir_cache *Novfs_lookup_in
10191 }
10192 }
10193
10194- DbgPrint("Novfs_lookup_inode_cache: return 0x%p\n", retVal);
10195+ DbgPrint("novfs_lookup_inode_cache: return 0x%p\n", retVal);
10196 return (retVal);
10197 }
10198
10199-/*++======================================================================*/
10200-int Novfs_lookup_validate(struct inode *i, struct qstr *name, ino_t ino)
10201 /*
10202- * Arguments: struct inode *i - pointer to directory inode
10203- * struct qstr *name - pointer to name
10204- * ino_t - inode number
10205- *
10206- * Returns: 0 if found
10207- * !0 if not found
10208- *
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
10211- * is set.
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.
10214 *
10215- * Notes: DirCacheLock should be held before calling this routine.
10216- *
10217- * Environment:
10218- *
10219- *========================================================================*/
10220+ * DirCacheLock should be held before calling this routine.
10221+ */
10222+int novfs_lookup_validate(struct inode *i, struct qstr *name, ino_t ino)
10223 {
10224 struct inode_data *id;
10225- struct dir_cache *dc;
10226+ struct novfs_dir_cache *dc;
10227 int retVal = -1;
10228 char *n = "<NULL>";
10229 int nl = 6;
10230
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;
10235 nl = name->len;
10236 }
10237- DbgPrint("Novfs_update_entry:\n"
10238+ DbgPrint("novfs_update_entry:\n"
10239 " inode: 0x%p\n"
10240 " name: %.*s\n" " ino: %d\n", i, nl, n, ino);
10241
10242- dc = Novfs_lookup_inode_cache(i, name, ino);
10243+ dc = novfs_lookup_inode_cache(i, name, ino);
10244 if (dc) {
10245 dc->flags |= ENTRY_VALID;
10246 retVal = 0;
10247@@ -5197,46 +4390,37 @@ int Novfs_lookup_validate(struct inode *
10248 return (retVal);
10249 }
10250
10251-/*++======================================================================*/
10252-int Novfs_add_inode_entry(struct inode *i,
10253- struct qstr *name, ino_t ino, struct entry_info *info)
10254 /*
10255- * Arguments:
10256- *
10257- * Returns: -ENOMEM - alloc error.
10258- * 0 - success.
10259- *
10260- * Abstract: Added entry to directory cache.
10261- *
10262- * Notes: DirCacheLock should be held before calling this routine.
10263- *
10264- * Environment:
10265+ * Added entry to directory cache.
10266 *
10267- *========================================================================*/
10268+ * DirCacheLock should be held before calling this routine.
10269+ */
10270+int novfs_add_inode_entry(struct inode *i,
10271+ struct qstr *name, ino_t ino, struct novfs_entry_info *info)
10272 {
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;
10280
10281 //SClark
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);
10291 }
10292 //SClark
10293
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);
10298 if (new) {
10299 id->cntDC++;
10300
10301 DCCount++;
10302- DbgPrint("Novfs_add_inode_entry:\n"
10303+ DbgPrint("novfs_add_inode_entry:\n"
10304 " inode: 0x%p\n"
10305 " id: 0x%p\n"
10306 " DC: 0x%p\n"
10307@@ -5265,7 +4449,7 @@ int Novfs_add_inode_entry(struct inode *
10308
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);
10313
10314 list_del(&todel->list);
10315
10316@@ -5274,29 +4458,20 @@ int Novfs_add_inode_entry(struct inode *
10317 DCCount--;
10318 id->cntDC--;
10319 }
10320+
10321 }
10322 }
10323 return (retVal);
10324 }
10325
10326-/*++======================================================================*/
10327-int Novfs_update_entry(struct inode *i, struct qstr *name, ino_t ino,
10328- struct entry_info *info)
10329 /*
10330- * Arguments:
10331- *
10332- * Returns:
10333- *
10334- * Abstract:
10335- *
10336- * Notes: DirCacheLock should be held before calling this routine.
10337- *
10338- * Environment:
10339- *
10340- *========================================================================*/
10341+ * DirCacheLock should be held before calling this routine.
10342+ */
10343+int novfs_update_entry(struct inode *i, struct qstr *name, ino_t ino,
10344+ struct novfs_entry_info *info)
10345 {
10346 struct inode_data *id;
10347- struct dir_cache *dc;
10348+ struct novfs_dir_cache *dc;
10349 int retVal = -1;
10350 char *n = "<NULL>";
10351 int nl = 6;
10352@@ -5304,7 +4479,7 @@ int Novfs_update_entry(struct inode *i,
10353 char mtime_buf[32];
10354 char ctime_buf[32];
10355
10356- if (i && (id = i->FSPRIVATE) && id->DirCache.next) {
10357+ if (i && (id = i->i_private) && id->DirCache.next) {
10358
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"
10367 " inode: 0x%p\n"
10368 " name: %.*s\n"
10369 " ino: %d\n"
10370@@ -5324,7 +4499,7 @@ int Novfs_update_entry(struct inode *i,
10371 i, nl, n, ino, info->size, atime_buf, mtime_buf,
10372 ctime_buf);
10373
10374- dc = Novfs_lookup_inode_cache(i, name, ino);
10375+ dc = novfs_lookup_inode_cache(i, name, ino);
10376 if (dc) {
10377 retVal = 0;
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"
10385 " flags: 0x%x\n"
10386 " jiffies: %lld\n"
10387 " ino: %d\n"
10388@@ -5356,39 +4531,31 @@ int Novfs_update_entry(struct inode *i,
10389 dc->nameLen, dc->name);
10390 }
10391 }
10392- DbgPrint("Novfs_update_entry: return %d\n", retVal);
10393+ DbgPrint("novfs_update_entry: return %d\n", retVal);
10394 return (retVal);
10395 }
10396
10397-/*++======================================================================*/
10398-void Novfs_remove_inode_entry(struct inode *i, struct qstr *name, ino_t ino)
10399 /*
10400- * Arguments:
10401- *
10402- * Returns: nothing
10403- *
10404- * Abstract: Removes entry from directory cache. You can specify a name
10405- * or an inode number.
10406- *
10407- * Notes: DirCacheLock should be held before calling this routine.
10408- *
10409- * Environment:
10410+ * Removes entry from directory cache. You can specify a name
10411+ * or an inode number.
10412 *
10413- *========================================================================*/
10414+ * DirCacheLock should be held before calling this routine.
10415+ */
10416+void novfs_remove_inode_entry(struct inode *i, struct qstr *name, ino_t ino)
10417 {
10418 struct inode_data *id;
10419- struct dir_cache *dc;
10420+ struct novfs_dir_cache *dc;
10421 char *n = "<NULL>";
10422 int nl = 6;
10423
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);
10428 if (dc) {
10429 if (name && name->name) {
10430 nl = name->len;
10431 n = (char *)name->name;
10432 }
10433- DbgPrint("Novfs_remove_inode_entry:\n"
10434+ DbgPrint("novfs_remove_inode_entry:\n"
10435 " inode: 0x%p\n"
10436 " id: 0x%p\n"
10437 " DC: 0x%p\n"
10438@@ -5411,30 +4578,22 @@ void Novfs_remove_inode_entry(struct ino
10439 }
10440 }
10441
10442-/*++======================================================================*/
10443-void Novfs_free_invalid_entries(struct inode *i)
10444 /*
10445- * Arguments: struct inode *i - pointer to directory inode.
10446- *
10447- * Returns: nothing
10448- *
10449- * Abstract: Frees all invalid entries in the directory cache.
10450- *
10451- * Notes: DirCacheLock should be held before calling this routine.
10452- *
10453- * Environment:
10454+ * Frees all invalid entries in the directory cache.
10455 *
10456- *========================================================================*/
10457+ * DirCacheLock should be held before calling this routine.
10458+ */
10459+void novfs_free_invalid_entries(struct inode *i)
10460 {
10461 struct inode_data *id;
10462- struct dir_cache *dc;
10463+ struct novfs_dir_cache *dc;
10464 struct list_head *l;
10465
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"
10474 " inode: 0x%p\n"
10475 " id: 0x%p\n"
10476 " entry: 0x%p\n"
10477@@ -5453,28 +4612,20 @@ void Novfs_free_invalid_entries(struct i
10478 }
10479 }
10480
10481-/*++======================================================================*/
10482-void Novfs_free_inode_cache(struct inode *i)
10483 /*
10484- * Arguments: struct inode *i - pointer to directory inode.
10485- *
10486- * Returns: nothing
10487- *
10488- * Abstract: Frees all entries in the inode cache.
10489- *
10490- * Notes: DirCacheLock should be held before calling this routine.
10491- *
10492- * Environment:
10493+ * Frees all entries in the inode cache.
10494 *
10495- *========================================================================*/
10496+ * DirCacheLock should be held before calling this routine.
10497+ */
10498+void novfs_free_inode_cache(struct inode *i)
10499 {
10500 struct inode_data *id;
10501- struct dir_cache *dc;
10502+ struct novfs_dir_cache *dc;
10503 struct list_head *l;
10504
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);
10510 l = l->prev;
10511 list_del(&dc->list);
10512 kfree(dc);
10513@@ -5485,12 +4636,12 @@ void Novfs_free_inode_cache(struct inode
10514 }
10515 }
10516
10517-void Novfs_dump_inode(void *pf)
10518+void novfs_dump_inode(void *pf)
10519 {
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));
10530 }
10531
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,
10534 id->Scope);
10535
10536 if (id->DirCache.next) {
10537 list_for_each(l, &id->DirCache) {
10538 dccnt++;
10539- dc = list_entry(l, struct dir_cache, list);
10540+ dc = list_entry(l, struct novfs_dir_cache,
10541+ list);
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 @@
10548 #include "vfs.h"
10549 #include "commands.h"
10550
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)
10555+#endif
10556
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);
10559
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)
10563 {
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;
10572 int retCode = 0;
10573 unsigned long cmdlen, datalen, replylen, cpylen;
10574 char *data;
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);
10579+
10580 if (!cmd)
10581 return -ENOMEM;
10582+
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;
10587
10588 cmd->dataLen = datalen;
10589- openConn = (PNwdCOpenConnByName) cmd->data;
10590+ openConn = (struct nwd_open_conn_by_name *) cmd->data;
10591
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);
10596
10597 openConn->oServiceType = openConn->oName + openConn->nameLen;
10598- cpylen = copy_from_user(data, ocbn.pName->pString, openConn->nameLen);
10599+ cpylen =
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);
10604+ cpylen =
10605+ copy_from_user(data, ocbn.pServiceType,
10606+ openConn->serviceLen);
10607
10608- retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10609- (void **)&reply, &replylen,
10610- INTERRUPTIBLE);
10611+ retCode =
10612+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10613+ (void **)&reply, &replylen,
10614+ INTERRUPTIBLE);
10615 if (reply) {
10616 /*
10617 * we got reply data from the daemon
10618 */
10619- connReply = (PNwdCOpenConnByName) reply->data;
10620+ connReply = (struct nwd_open_conn_by_name *) reply->data;
10621 retCode = reply->Reply.ErrorCode;
10622 if (!retCode) {
10623 /*
10624 * we got valid data.
10625 */
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;
10630
10631@@ -92,18 +103,17 @@ int NwOpenConnByName(PXPLAT pdata, HANDL
10632 }
10633
10634 kfree(cmd);
10635-
10636- return retCode;
10637+ return ((int)retCode);
10638
10639 }
10640
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)
10643 {
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;
10654 int retCode = 0;
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);
10661+
10662 if (!cmd)
10663 return -ENOMEM;
10664
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;
10671
10672- cpylen = copy_from_user(&tranAddr, ocba.pTranAddr, sizeof(tranAddr));
10673+ cpylen =
10674+ copy_from_user(&tranAddr, ocba.pTranAddr, sizeof(tranAddr));
10675
10676 DbgPrint("NwOpenConnByAddr: tranAddr\n");
10677- mydump(sizeof(tranAddr), &tranAddr);
10678+ novfs_dump(sizeof(tranAddr), &tranAddr);
10679
10680 openConn->TranAddr.uTransportType = tranAddr.uTransportType;
10681 openConn->TranAddr.uAddressLength = tranAddr.uAddressLength;
10682 memset(addr, 0xcc, sizeof(addr) - 1);
10683
10684- cpylen = copy_from_user(addr, tranAddr.puAddress, tranAddr.uAddressLength);
10685+ cpylen =
10686+ copy_from_user(addr, tranAddr.puAddress,
10687+ tranAddr.uAddressLength);
10688
10689 DbgPrint("NwOpenConnByAddr: addr\n");
10690- mydump(sizeof(addr), addr);
10691+ novfs_dump(sizeof(addr), addr);
10692
10693- openConn->TranAddr.oAddress = *(unsigned int*) (&addr[2]);
10694+ openConn->TranAddr.oAddress = *(unsigned int *) (&addr[2]);
10695
10696- retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10697- (void **)&reply, &replylen,
10698- INTERRUPTIBLE);
10699+ retCode =
10700+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10701+ (void **)&reply, &replylen,
10702+ INTERRUPTIBLE);
10703 if (reply) {
10704 /*
10705 * we got reply data from the daemon
10706 */
10707- connReply = (PNwdCOpenConnByAddr) reply->data;
10708+ connReply = (struct nwd_open_conn_by_addr *) reply->data;
10709 retCode = reply->Reply.ErrorCode;
10710 if (!retCode) {
10711 /*
10712 * we got valid data.
10713 */
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);
10722+ cpylen =
10723+ copy_to_user(pdata->reqData, &ocba,
10724+ sizeof(ocba));
10725+ DbgPrint("New Conn Handle = %X\n",
10726+ connReply->ConnHandle);
10727 }
10728 kfree(reply);
10729 }
10730
10731 kfree(cmd);
10732- return retCode;
10733+
10734+ return (retCode);
10735+
10736 }
10737
10738-/*++======================================================================*/
10739-int NwOpenConnByRef(PXPLAT pdata, HANDLE * Handle, session_t Session)
10740-/*
10741- * Arguments:
10742- *
10743- * Returns:
10744- *
10745- * Abstract:
10746- *
10747- * Notes:
10748- *
10749- * Environment:
10750- *
10751- *========================================================================*/
10752-{
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)
10758+{
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;
10765
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;
10772
10773- openConn->uConnReference = (HANDLE) (unsigned long) ocbr.uConnReference;
10774+ openConn->uConnReference =
10775+ (void *) (unsigned long) ocbr.uConnReference;
10776 openConn->uConnFlags = ocbr.uConnFlags;
10777
10778- retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10779- (void **)&reply, &replylen,
10780- INTERRUPTIBLE);
10781+ retCode =
10782+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10783+ (void **)&reply, &replylen,
10784+ INTERRUPTIBLE);
10785 if (reply) {
10786 /*
10787 * we got reply data from the daemon
10788 */
10789- openConn = (PNwdCOpenConnByRef) reply->data;
10790+ openConn = (struct nwd_open_conn_by_ref *) reply->data;
10791 retCode = reply->Reply.ErrorCode;
10792 if (!retCode) {
10793 /*
10794 * we got valid data.
10795 */
10796- ocbr.ConnHandle = HandletoUint32(openConn->ConnHandle);
10797+ ocbr.ConnHandle =
10798+ HandletoUint32(openConn->ConnHandle);
10799 *Handle = openConn->ConnHandle;
10800
10801- cpylen = copy_to_user(pdata->reqData, &ocbr, sizeof(ocbr));
10802- DbgPrint("New Conn Handle = %X\n", openConn->ConnHandle);
10803+ cpylen =
10804+ copy_to_user(pdata->reqData, &ocbr,
10805+ sizeof(ocbr));
10806+ DbgPrint("New Conn Handle = %X\n",
10807+ openConn->ConnHandle);
10808 }
10809 kfree(reply);
10810 }
10811@@ -230,19 +244,17 @@ int NwOpenConnByRef(PXPLAT pdata, HANDLE
10812
10813 }
10814
10815-int NwRawSend(PXPLAT pdata, session_t Session)
10816+int novfs_raw_send(struct novfs_xplat *pdata, struct novfs_schandle Session)
10817 {
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;
10830 unsigned int x;
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;
10837
10838@@ -252,13 +264,18 @@ int NwRawSend(PXPLAT pdata, session_t Se
10839 /*
10840 * Figure out the length of the request
10841 */
10842- frag = kmalloc(xRequest.uNumReplyFrags * sizeof(NwcFrag), GFP_KERNEL);
10843- DbgPrint("[XPLAT RawNCP] - Reply Frag Count 0x%X\n", xRequest.uNumReplyFrags);
10844+ frag =
10845+ kmalloc(xRequest.uNumReplyFrags * sizeof(struct nwc_frag), GFP_KERNEL);
10846+
10847+ DbgPrint("[XPLAT RawNCP] - Reply Frag Count 0x%X\n",
10848+ xRequest.uNumReplyFrags);
10849
10850 if (!frag)
10851- goto exit;
10852+ return (retCode);
10853
10854- cpylen = copy_from_user(frag, xRequest.pReplyFrags, xRequest.uNumReplyFrags * sizeof(NwcFrag));
10855+ cpylen =
10856+ copy_from_user(frag, xRequest.pReplyFrags,
10857+ xRequest.uNumReplyFrags * sizeof(struct nwc_frag));
10858 totalLen = 0;
10859
10860 cFrag = frag;
10861@@ -270,11 +287,17 @@ int NwRawSend(PXPLAT pdata, session_t Se
10862
10863 DbgPrint("[XPLAT - RawNCP] - totalLen = %d\n", totalLen);
10864 datalen = 0;
10865- reqFrag = kmalloc(xRequest.uNumRequestFrags * sizeof(NwcFrag), GFP_KERNEL);
10866- if (!reqFrag)
10867- goto exit;
10868+ reqFrag =
10869+ kmalloc(xRequest.uNumRequestFrags * sizeof(struct nwc_frag),
10870+ GFP_KERNEL);
10871+ if (!reqFrag) {
10872+ kfree(frag);
10873+ return (retCode);
10874+ }
10875
10876- cpylen = copy_from_user(reqFrag, xRequest.pRequestFrags, xRequest.uNumRequestFrags * sizeof(NwcFrag));
10877+ cpylen =
10878+ copy_from_user(reqFrag, xRequest.pRequestFrags,
10879+ xRequest.uNumRequestFrags * sizeof(struct nwc_frag));
10880 cFrag = reqFrag;
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
10885 */
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);
10891
10892 cmd = kmalloc(cmdlen, GFP_KERNEL);
10893 if (!cmd)
10894- goto exit;
10895+ return -ENOMEM;
10896
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
10901 */
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;
10910
10911 reqData = ncpData->data;
10912@@ -312,15 +336,16 @@ int NwRawSend(PXPLAT pdata, session_t Se
10913
10914 for (x = 0; x < xRequest.uNumRequestFrags; x++) {
10915 cpylen =
10916- copy_from_user(reqData, cFrag->pData,
10917- cFrag->uLength);
10918+ copy_from_user(reqData, cFrag->pData,
10919+ cFrag->uLength);
10920 reqData += cFrag->uLength;
10921 cFrag++;
10922 }
10923
10924- retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10925- (void **)&reply, &replylen,
10926- INTERRUPTIBLE);
10927+ retCode =
10928+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
10929+ (void **)&reply, &replylen,
10930+ INTERRUPTIBLE);
10931 DbgPrint("RawNCP - reply = %x\n", reply);
10932 DbgPrint("RawNCP - retCode = %x\n", retCode);
10933
10934@@ -328,11 +353,11 @@ int NwRawSend(PXPLAT pdata, session_t Se
10935 /*
10936 * we got reply data from the daemon
10937 */
10938- ncpReply = (PNwdCNCPRep) reply->data;
10939+ ncpReply = (struct nwd_ncp_rep *) reply->data;
10940 retCode = reply->Reply.ErrorCode;
10941
10942 DbgPrint("RawNCP - Reply Frag Count 0x%X\n",
10943- xRequest.uNumReplyFrags);
10944+ xRequest.uNumReplyFrags);
10945
10946 /*
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++) {
10950
10951 DbgPrint("RawNCP - Copy Frag %d: 0x%X\n", x,
10952- cFrag->uLength);
10953+ cFrag->uLength);
10954
10955- datalen = min((unsigned long)cFrag->uLength, totalLen);
10956+ datalen =
10957+ min((unsigned long) cFrag->uLength, totalLen);
10958
10959- cpylen = copy_to_user(cFrag->pData, reqData, datalen);
10960+ cpylen =
10961+ copy_to_user(cFrag->pData, reqData,
10962+ datalen);
10963 totalLen -= datalen;
10964 reqData += datalen;
10965 actualReplyLength += datalen;
10966@@ -362,22 +390,21 @@ int NwRawSend(PXPLAT pdata, session_t Se
10967 }
10968
10969 kfree(cmd);
10970-
10971 xRequest.uActualReplyLength = actualReplyLength;
10972 cpylen = copy_to_user(pdata->reqData, &xRequest, sizeof(xRequest));
10973
10974-exit:
10975 kfree(reqFrag);
10976 kfree(frag);
10977- return retCode;
10978+
10979+ return (retCode);
10980 }
10981
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)
10984 {
10985- PXPLAT_CALL_REQUEST cmd;
10986- PXPLAT_CALL_REPLY reply;
10987- NwcCloseConn cc;
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;
10993 int retCode = 0;
10994 unsigned long cmdlen, datalen, replylen, cpylen;
10995
10996@@ -388,35 +415,36 @@ int NwConnClose(PXPLAT pdata, HANDLE * H
10997 cmd = kmalloc(cmdlen, GFP_KERNEL);
10998 if (!cmd)
10999 return -ENOMEM;
11000-
11001 cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11002 cmd->Command.SequenceNumber = 0;
11003 cmd->Command.SessionId = Session;
11004 cmd->NwcCommand = NWC_CLOSE_CONN;
11005
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);
11010
11011 /*
11012 * send the request
11013 */
11014- retCode = Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11015- (void **)&reply, &replylen, 0);
11016+ retCode =
11017+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11018+ (void **)&reply, &replylen, 0);
11019 if (reply) {
11020 retCode = reply->Reply.ErrorCode;
11021 kfree(reply);
11022 }
11023 kfree(cmd);
11024- return retCode;
11025+ return (retCode);
11026+
11027 }
11028
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)
11031 {
11032- PXPLAT_CALL_REQUEST cmd;
11033- PXPLAT_CALL_REPLY reply;
11034- NwcCloseConn cc;
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;
11042
11043@@ -424,133 +452,87 @@ int NwSysConnClose(PXPLAT pdata, unsigne
11044
11045 datalen = sizeof(*nwdClose);
11046 cmdlen = datalen + sizeof(*cmd);
11047- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11048- if (cmd) {
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;
11053-
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);
11059+ if (!cmd)
11060+ return -ENOMEM;
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;
11065
11066- /*
11067- * send the request
11068- */
11069- retCode =
11070- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11071- (void **)&reply, &replylen, 0);
11072- if (reply) {
11073- retCode = reply->Reply.ErrorCode;
11074- kfree(reply);
11075- }
11076- kfree(cmd);
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;
11081
11082+ /*
11083+ * send the request
11084+ */
11085+ retCode =
11086+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0, (void **)&reply, &replylen, 0);
11087+ if (reply) {
11088+ retCode = reply->Reply.ErrorCode;
11089+ kfree(reply);
11090 }
11091-
11092+ kfree(cmd);
11093 return (retCode);
11094
11095 }
11096
11097-/*++======================================================================*/
11098-int NwLoginIdentity(PXPLAT pdata, struct schandle *Session)
11099-/*
11100- * Arguments:
11101- *
11102- * Returns:
11103- *
11104- * Abstract:
11105- *
11106- * Notes:
11107- *
11108- * Environment:
11109- *
11110- *========================================================================*/
11111+int novfs_login_id(struct novfs_xplat *pdata, struct novfs_schandle Session)
11112 {
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;
11125
11126 cpylen = copy_from_user(&lgn, pdata->reqData, sizeof(lgn));
11127
11128 DbgPrint("NwLoginIdentity:\n");
11129- mydump(sizeof(lgn), &lgn);
11130+ novfs_dump(sizeof(lgn), &lgn);
11131
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);
11136
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);
11147
11148- cpylen =
11149- copy_from_user(&nwcStr, lgn.pObjectName,
11150- sizeof(nwcStr));
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);
11155
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,
11163- username.len)) {
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);
11168
11169- cpylen =
11170- copy_from_user(&nwcStr,
11171- lgn.pPassword,
11172- sizeof(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);
11177
11178- if ((password.buffer =
11179- Novfs_Malloc(nwcStr.DataLen,
11180- GFP_KERNEL))) {
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,
11186- nwcStr.pBuffer,
11187- password.len)) {
11188- retCode =
11189- do_login(&server,
11190- &username,
11191- &password,
11192- (HANDLE *)&lgn.AuthenticationId,
11193- Session);
11194+ if (!copy_from_user((void *)password.buffer, nwcStr.pBuffer, password.len)) {
11195+ retCode = novfs_do_login(&server, &username, &password, (void **)&lgn.AuthenticationId, &Session);
11196 if (retCode) {
11197 lgn.AuthenticationId = 0;
11198 }
11199
11200- plgn =
11201- (NwcLoginIdentity *)
11202- pdata->reqData;
11203- cpylen =
11204- copy_to_user(&plgn->
11205- AuthenticationId,
11206- &lgn.
11207- AuthenticationId,
11208- sizeof
11209- (plgn->
11210- AuthenticationId));
11211-
11212+ plgn = (struct nwc_login_id *)pdata->reqData;
11213+ cpylen = copy_to_user(&plgn->AuthenticationId, &lgn.AuthenticationId, sizeof(plgn->AuthenticationId));
11214 }
11215- memset(password.buffer, 0,
11216- password.len);
11217+ memset(password.buffer, 0, password.len);
11218 kfree(password.buffer);
11219 }
11220 }
11221@@ -563,633 +545,504 @@ int NwLoginIdentity(PXPLAT pdata, struct
11222 return (retCode);
11223 }
11224
11225-/*++======================================================================*/
11226-int NwAuthConnWithId(PXPLAT pdata, session_t Session)
11227-/*
11228- * Arguments:
11229- *
11230- * Returns:
11231- *
11232- * Abstract:
11233- *
11234- * Notes:
11235- *
11236- * Environment:
11237- *
11238- *========================================================================*/
11239-{
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)
11245+{
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;
11252
11253 datalen = sizeof(*pDauth);
11254 cmdlen = datalen + sizeof(*cmd);
11255- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11256+ cmd = kmalloc(cmdlen, GFP_KERNEL);
11257+ if (!cmd)
11258+ return -ENOMEM;
11259
11260- if (cmd) {
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;
11265-
11266- cpylen = copy_from_user(&pauth, pdata->reqData, sizeof(pauth));
11267-
11268- pDauth = (PNwdCAuthenticateWithId) cmd->data;
11269- cmd->dataLen = datalen;
11270- pDauth->AuthenticationId = pauth.AuthenticationId;
11271- pDauth->ConnHandle = (HANDLE) (unsigned long) pauth.ConnHandle;
11272-
11273- retCode =
11274- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11275- (void **)&reply, &replylen,
11276- INTERRUPTIBLE);
11277- if (reply) {
11278- retCode = reply->Reply.ErrorCode;
11279- kfree(reply);
11280- }
11281- kfree(cmd);
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;
11286+
11287+ cpylen = copy_from_user(&pauth, pdata->reqData, sizeof(pauth));
11288+
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;
11293+
11294+ retCode =
11295+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11296+ (void **)&reply, &replylen,
11297+ INTERRUPTIBLE);
11298+ if (reply) {
11299+ retCode = reply->Reply.ErrorCode;
11300+ kfree(reply);
11301 }
11302 return (retCode);
11303 }
11304
11305-/*++======================================================================*/
11306-int NwLicenseConn(PXPLAT pdata, session_t Session)
11307-/*
11308- * Arguments:
11309- *
11310- * Returns:
11311- *
11312- * Abstract:
11313- *
11314- * Notes:
11315- *
11316- * Environment:
11317- *
11318- *========================================================================*/
11319-{
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)
11325+{
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;
11332
11333 datalen = sizeof(*pDLisc);
11334 cmdlen = datalen + sizeof(*cmd);
11335- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11336+ cmd = kmalloc(cmdlen, GFP_KERNEL);
11337+ if (!cmd)
11338+ return -ENOMEM;
11339
11340- if (cmd) {
11341- cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11342- cmd->Command.SequenceNumber = 0;
11343- cmd->Command.SessionId = Session;
11344- cmd->NwcCommand = NWC_LICENSE_CONN;
11345-
11346- cpylen = copy_from_user(&lisc, pdata->reqData, sizeof(lisc));
11347-
11348- pDLisc = (PNwdCLicenseConn) cmd->data;
11349- cmd->dataLen = datalen;
11350- pDLisc->ConnHandle = (HANDLE) (unsigned long) lisc.ConnHandle;
11351-
11352- retCode =
11353- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11354- (void **)&reply, &replylen,
11355- INTERRUPTIBLE);
11356- if (reply) {
11357- retCode = reply->Reply.ErrorCode;
11358- kfree(reply);
11359- }
11360- kfree(cmd);
11361+ cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11362+ cmd->Command.SequenceNumber = 0;
11363+ cmd->Command.SessionId = Session;
11364+ cmd->NwcCommand = NWC_LICENSE_CONN;
11365+
11366+ cpylen = copy_from_user(&lisc, pdata->reqData, sizeof(lisc));
11367+
11368+ pDLisc = (struct nwc_lisc_id *) cmd->data;
11369+ cmd->dataLen = datalen;
11370+ pDLisc->ConnHandle = (void *) (unsigned long) lisc.ConnHandle;
11371+
11372+ retCode =
11373+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11374+ (void **)&reply, &replylen,
11375+ INTERRUPTIBLE);
11376+ if (reply) {
11377+ retCode = reply->Reply.ErrorCode;
11378+ kfree(reply);
11379 }
11380+ kfree(cmd);
11381 return (retCode);
11382 }
11383
11384-/*++======================================================================*/
11385-int NwLogoutIdentity(PXPLAT pdata, session_t Session)
11386-/*
11387- * Arguments:
11388- *
11389- * Returns:
11390- *
11391- * Abstract:
11392- *
11393- * Notes:
11394- *
11395- * Environment:
11396- *
11397- *========================================================================*/
11398-{
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)
11404+{
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;
11410
11411 datalen = sizeof(*pDLogout);
11412 cmdlen = datalen + sizeof(*cmd);
11413- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11414+ cmd = kmalloc(cmdlen, GFP_KERNEL);
11415
11416- if (cmd) {
11417- cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11418- cmd->Command.SequenceNumber = 0;
11419- cmd->Command.SessionId = Session;
11420- cmd->NwcCommand = NWC_LOGOUT_IDENTITY;
11421+ if (!cmd)
11422+ return -ENOMEM;
11423+ cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11424+ cmd->Command.SequenceNumber = 0;
11425+ cmd->Command.SessionId = Session;
11426+ cmd->NwcCommand = NWC_LOGOUT_IDENTITY;
11427
11428- cpylen =
11429- copy_from_user(&logout, pdata->reqData, sizeof(logout));
11430+ cpylen =
11431+ copy_from_user(&logout, pdata->reqData, sizeof(logout));
11432
11433- pDLogout = (PNwdCLogoutIdentity) cmd->data;
11434- cmd->dataLen = datalen;
11435- pDLogout->AuthenticationId = logout.AuthenticationId;
11436-
11437- retCode =
11438- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11439- (void **)&reply, &replylen,
11440- INTERRUPTIBLE);
11441- if (reply) {
11442- retCode = reply->Reply.ErrorCode;
11443- kfree(reply);
11444- }
11445- kfree(cmd);
11446+ pDLogout = (struct nwc_lo_id *) cmd->data;
11447+ cmd->dataLen = datalen;
11448+ pDLogout->AuthenticationId = logout.AuthenticationId;
11449+
11450+ retCode =
11451+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11452+ (void **)&reply, &replylen,
11453+ INTERRUPTIBLE);
11454+ if (reply) {
11455+ retCode = reply->Reply.ErrorCode;
11456+ kfree(reply);
11457 }
11458+ kfree(cmd);
11459 return (retCode);
11460 }
11461
11462-/*++======================================================================*/
11463-int NwUnlicenseConn(PXPLAT pdata, session_t Session)
11464-/*
11465- * Arguments:
11466- *
11467- * Returns:
11468- *
11469- * Abstract:
11470- *
11471- * Notes:
11472- *
11473- * Environment:
11474- *
11475- *========================================================================*/
11476-{
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)
11482+{
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;
11488
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);
11493- if (cmd) {
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;
11500-
11501- pUconn->ConnHandle = (HANDLE) (unsigned long) ulc.ConnHandle;
11502- retCode =
11503- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11504- (void **)&reply, &replylen,
11505- INTERRUPTIBLE);
11506- if (reply) {
11507- /*
11508- * we got reply data from the daemon
11509- */
11510- retCode = reply->Reply.ErrorCode;
11511- kfree(reply);
11512- }
11513+ cmd = kmalloc(cmdlen, GFP_KERNEL);
11514+ if (!cmd)
11515+ return -ENOMEM;
11516+
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;
11523
11524- kfree(cmd);
11525+ pUconn->ConnHandle = (void *) (unsigned long) ulc.ConnHandle;
11526+ retCode =
11527+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11528+ (void **)&reply, &replylen,
11529+ INTERRUPTIBLE);
11530+ if (reply) {
11531+ /*
11532+ * we got reply data from the daemon
11533+ */
11534+ retCode = reply->Reply.ErrorCode;
11535+ kfree(reply);
11536 }
11537 return (retCode);
11538
11539 }
11540
11541-/*++======================================================================*/
11542-int NwUnAuthenticate(PXPLAT pdata, session_t Session)
11543-/*
11544- * Arguments:
11545- *
11546- * Returns:
11547- *
11548- * Abstract:
11549- *
11550- * Notes:
11551- *
11552- * Environment:
11553- *
11554- *========================================================================*/
11555-{
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)
11561+{
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;
11567
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);
11572
11573- if (cmd) {
11574- cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11575- cmd->Command.SequenceNumber = 0;
11576- cmd->Command.SessionId = Session;
11577- cmd->NwcCommand = NWC_UNAUTHENTICATE_CONN;
11578-
11579- cpylen = copy_from_user(&auth, pdata->reqData, sizeof(auth));
11580-
11581- pDAuth = (PNwdCUnauthenticate) cmd->data;
11582- cmd->dataLen = datalen;
11583- pDAuth->AuthenticationId = auth.AuthenticationId;
11584- pDAuth->ConnHandle = (HANDLE) (unsigned long) auth.ConnHandle;
11585-
11586- retCode =
11587- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11588- (void **)&reply, &replylen,
11589- INTERRUPTIBLE);
11590- if (reply) {
11591- retCode = reply->Reply.ErrorCode;
11592- kfree(reply);
11593- }
11594- kfree(cmd);
11595+ if (!cmd)
11596+ return -ENOMEM;
11597+ cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
11598+ cmd->Command.SequenceNumber = 0;
11599+ cmd->Command.SessionId = Session;
11600+ cmd->NwcCommand = NWC_UNAUTHENTICATE_CONN;
11601+
11602+ cpylen = copy_from_user(&auth, pdata->reqData, sizeof(auth));
11603+
11604+ pDAuth = (struct nwc_unauthenticate *) cmd->data;
11605+ cmd->dataLen = datalen;
11606+ pDAuth->AuthenticationId = auth.AuthenticationId;
11607+ pDAuth->ConnHandle = (void *) (unsigned long) auth.ConnHandle;
11608+
11609+ retCode =
11610+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11611+ (void **)&reply, &replylen,
11612+ INTERRUPTIBLE);
11613+ if (reply) {
11614+ retCode = reply->Reply.ErrorCode;
11615+ kfree(reply);
11616 }
11617+ kfree(cmd);
11618 return (retCode);
11619
11620 }
11621
11622-/*++======================================================================*/
11623-int NwGetConnInfo(PXPLAT pdata, session_t Session)
11624-/*
11625- * Arguments:
11626- *
11627- * Returns:
11628- *
11629- * Abstract:
11630- *
11631- * Notes:
11632- *
11633- * Environment:
11634- *
11635- *========================================================================*/
11636-{
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)
11642+{
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;
11649
11650 cmdlen = sizeof(*cmd) + sizeof(*pDConnInfo);
11651- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11652+ cmd = kmalloc(cmdlen, GFP_KERNEL);
11653 cpylen =
11654- copy_from_user(&connInfo, pdata->reqData, sizeof(NwcGetConnInfo));
11655+ copy_from_user(&connInfo, pdata->reqData, sizeof(struct nwc_get_conn_info));
11656
11657- if (cmd) {
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;
11662-
11663- pDConnInfo = (PNwdCGetConnInfo) cmd->data;
11664-
11665- pDConnInfo->ConnHandle = (HANDLE) (unsigned long) connInfo.ConnHandle;
11666- pDConnInfo->uInfoLevel = connInfo.uInfoLevel;
11667- pDConnInfo->uInfoLength = connInfo.uInfoLength;
11668- cmd->dataLen = sizeof(*pDConnInfo);
11669-
11670- retCode =
11671- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11672- (void **)&reply, &replylen,
11673- INTERRUPTIBLE);
11674- if (reply) {
11675- retCode = reply->Reply.ErrorCode;
11676- if (!retCode) {
11677- GetConnData(&connInfo, cmd, reply);
11678- }
11679+ if (!cmd)
11680+ return -ENOMEM;
11681+
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;
11686
11687- kfree(reply);
11688+ pDConnInfo = (struct nwd_conn_info *) cmd->data;
11689+
11690+ pDConnInfo->ConnHandle = (void *) (unsigned long) connInfo.ConnHandle;
11691+ pDConnInfo->uInfoLevel = connInfo.uInfoLevel;
11692+ pDConnInfo->uInfoLength = connInfo.uInfoLength;
11693+ cmd->dataLen = sizeof(*pDConnInfo);
11694+
11695+ retCode =
11696+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11697+ (void **)&reply, &replylen,
11698+ INTERRUPTIBLE);
11699+ if (reply) {
11700+ retCode = reply->Reply.ErrorCode;
11701+ if (!retCode) {
11702+ GetConnData(&connInfo, cmd, reply);
11703 }
11704- kfree(cmd);
11705
11706+ kfree(reply);
11707 }
11708-
11709+ kfree(cmd);
11710 return (retCode);
11711
11712 }
11713
11714-/*++======================================================================*/
11715-int NwSetConnInfo(PXPLAT pdata, session_t Session)
11716-/*
11717- * Arguments:
11718- *
11719- * Returns:
11720- *
11721- * Abstract:
11722- *
11723- * Notes:
11724- *
11725- * Environment:
11726- *
11727- *========================================================================*/
11728-{
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)
11734+{
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;
11741
11742 cmdlen = sizeof(*cmd) + sizeof(*pDConnInfo);
11743- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
11744+ cmd = kmalloc(cmdlen, GFP_KERNEL);
11745 cpylen =
11746- copy_from_user(&connInfo, pdata->reqData, sizeof(NwcSetConnInfo));
11747+ copy_from_user(&connInfo, pdata->reqData, sizeof(struct nwc_set_conn_info));
11748
11749- if (cmd) {
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;
11754-
11755- pDConnInfo = (PNwdCSetConnInfo) cmd->data;
11756-
11757- pDConnInfo->ConnHandle = (HANDLE) (unsigned long) connInfo.ConnHandle;
11758- pDConnInfo->uInfoLevel = connInfo.uInfoLevel;
11759- pDConnInfo->uInfoLength = connInfo.uInfoLength;
11760- cmd->dataLen = sizeof(*pDConnInfo);
11761-
11762- retCode =
11763- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11764- (void **)&reply, &replylen,
11765- INTERRUPTIBLE);
11766- if (reply) {
11767- retCode = reply->Reply.ErrorCode;
11768- kfree(reply);
11769- }
11770- kfree(cmd);
11771+ if (!cmd)
11772+ return -ENOMEM;
11773
11774- }
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;
11779
11780+ pDConnInfo = (struct nwd_set_conn_info *) cmd->data;
11781+
11782+ pDConnInfo->ConnHandle = (void *) (unsigned long) connInfo.ConnHandle;
11783+ pDConnInfo->uInfoLevel = connInfo.uInfoLevel;
11784+ pDConnInfo->uInfoLength = connInfo.uInfoLength;
11785+ cmd->dataLen = sizeof(*pDConnInfo);
11786+
11787+ retCode =
11788+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11789+ (void **)&reply, &replylen,
11790+ INTERRUPTIBLE);
11791+ if (reply) {
11792+ retCode = reply->Reply.ErrorCode;
11793+ kfree(reply);
11794+ }
11795+ kfree(cmd);
11796 return (retCode);
11797
11798 }
11799
11800-/*++======================================================================*/
11801-int NwGetIdentityInfo(PXPLAT pdata, session_t Session)
11802-/*
11803- * Arguments:
11804- *
11805- * Returns:
11806- *
11807- * Abstract:
11808- *
11809- * Notes:
11810- *
11811- * Environment:
11812- *
11813- *========================================================================*/
11814-{
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)
11821+{
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;
11827 char *str;
11828 int retCode = -ENOMEM;
11829 unsigned long cmdlen, replylen, cpylen;
11830
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));
11835
11836- if (cmd) {
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;
11841-
11842- idInfo = (PNwdCGetIdentityInfo) cmd->data;
11843-
11844- idInfo->AuthenticationId = qidInfo.AuthenticationId;
11845- cmd->dataLen = sizeof(*idInfo);
11846-
11847- retCode =
11848- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11849- (void **)&reply, &replylen,
11850- INTERRUPTIBLE);
11851- if (reply) {
11852- retCode = reply->Reply.ErrorCode;
11853-
11854- if (!reply->Reply.ErrorCode) {
11855- /*
11856- * Save the return info to the user structure.
11857- */
11858- gId = pdata->reqData;
11859- idInfo = (PNwdCGetIdentityInfo) reply->data;
11860- cpylen =
11861- copy_to_user(&gId->AuthenticationId,
11862- &idInfo->AuthenticationId,
11863- sizeof(idInfo->
11864+ if (!cmd)
11865+ return -ENOMEM;
11866+
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;
11871+
11872+ idInfo = (struct nwd_get_id_info *) cmd->data;
11873+
11874+ idInfo->AuthenticationId = qidInfo.AuthenticationId;
11875+ cmd->dataLen = sizeof(*idInfo);
11876+
11877+ retCode =
11878+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
11879+ (void **)&reply, &replylen,
11880+ INTERRUPTIBLE);
11881+ if (reply) {
11882+ retCode = reply->Reply.ErrorCode;
11883+
11884+ if (!reply->Reply.ErrorCode) {
11885+ /*
11886+ * Save the return info to the user structure.
11887+ */
11888+ gId = pdata->reqData;
11889+ idInfo = (struct nwd_get_id_info *) reply->data;
11890+ cpylen =
11891+ copy_to_user(&gId->AuthenticationId,
11892+ &idInfo->AuthenticationId,
11893+ sizeof(idInfo->
11894 AuthenticationId));
11895- cpylen =
11896- copy_to_user(&gId->AuthType,
11897- &idInfo->AuthType,
11898- sizeof(idInfo->AuthType));
11899- cpylen =
11900- copy_to_user(&gId->IdentityFlags,
11901- &idInfo->IdentityFlags,
11902- sizeof(idInfo->IdentityFlags));
11903- cpylen =
11904- copy_to_user(&gId->NameType,
11905- &idInfo->NameType,
11906- sizeof(idInfo->NameType));
11907- cpylen =
11908- copy_to_user(&gId->ObjectType,
11909- &idInfo->ObjectType,
11910- sizeof(idInfo->ObjectType));
11911-
11912- cpylen =
11913- copy_from_user(&xferStr, gId->pDomainName,
11914- sizeof(NwcString));
11915- str =
11916- (char *)((char *)reply->data +
11917- idInfo->pDomainNameOffset);
11918- cpylen =
11919- copy_to_user(xferStr.pBuffer, str,
11920- idInfo->domainLen);
11921- xferStr.DataType = NWC_STRING_TYPE_ASCII;
11922- xferStr.DataLen = idInfo->domainLen;
11923- cpylen =
11924- copy_to_user(gId->pDomainName, &xferStr,
11925- sizeof(NwcString));
11926-
11927- cpylen =
11928- copy_from_user(&xferStr, gId->pObjectName,
11929- sizeof(NwcString));
11930- str =
11931- (char *)((char *)reply->data +
11932- idInfo->pObjectNameOffset);
11933- cpylen =
11934- copy_to_user(xferStr.pBuffer, str,
11935- idInfo->objectLen);
11936- xferStr.DataLen = idInfo->objectLen - 1;
11937- xferStr.DataType = NWC_STRING_TYPE_ASCII;
11938- cpylen =
11939- copy_to_user(gId->pObjectName, &xferStr,
11940- sizeof(NwcString));
11941- }
11942+ cpylen =
11943+ copy_to_user(&gId->AuthType,
11944+ &idInfo->AuthType,
11945+ sizeof(idInfo->AuthType));
11946+ cpylen =
11947+ copy_to_user(&gId->IdentityFlags,
11948+ &idInfo->IdentityFlags,
11949+ sizeof(idInfo->IdentityFlags));
11950+ cpylen =
11951+ copy_to_user(&gId->NameType,
11952+ &idInfo->NameType,
11953+ sizeof(idInfo->NameType));
11954+ cpylen =
11955+ copy_to_user(&gId->ObjectType,
11956+ &idInfo->ObjectType,
11957+ sizeof(idInfo->ObjectType));
11958
11959- kfree(reply);
11960+ cpylen =
11961+ copy_from_user(&xferStr, gId->pDomainName,
11962+ sizeof(struct nwc_string));
11963+ str =
11964+ (char *)((char *)reply->data +
11965+ idInfo->pDomainNameOffset);
11966+ cpylen =
11967+ copy_to_user(xferStr.pBuffer, str,
11968+ idInfo->domainLen);
11969+ xferStr.DataType = NWC_STRING_TYPE_ASCII;
11970+ xferStr.DataLen = idInfo->domainLen;
11971+ cpylen =
11972+ copy_to_user(gId->pDomainName, &xferStr,
11973+ sizeof(struct nwc_string));
11974+
11975+ cpylen =
11976+ copy_from_user(&xferStr, gId->pObjectName,
11977+ sizeof(struct nwc_string));
11978+ str =
11979+ (char *)((char *)reply->data +
11980+ idInfo->pObjectNameOffset);
11981+ cpylen =
11982+ copy_to_user(xferStr.pBuffer, str,
11983+ idInfo->objectLen);
11984+ xferStr.DataLen = idInfo->objectLen - 1;
11985+ xferStr.DataType = NWC_STRING_TYPE_ASCII;
11986+ cpylen =
11987+ copy_to_user(gId->pObjectName, &xferStr,
11988+ sizeof(struct nwc_string));
11989 }
11990- kfree(cmd);
11991
11992+ kfree(reply);
11993 }
11994-
11995+ kfree(cmd);
11996 return (retCode);
11997 }
11998
11999-/*++======================================================================*/
12000-int NwScanConnInfo(PXPLAT pdata, session_t Session)
12001-/*
12002- * Arguments:
12003- *
12004- * Returns:
12005- *
12006- * Abstract:
12007- *
12008- * Notes:
12009- *
12010- * Environment:
12011- *
12012- *========================================================================*/
12013-{
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)
12019+{
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;
12027
12028 cpylen =
12029- copy_from_user(&connInfo, pdata->reqData, sizeof(NwcScanConnInfo));
12030+ copy_from_user(&connInfo, pdata->reqData, sizeof(struct nwc_scan_conn_info));
12031
12032 cmdlen = sizeof(*cmd) + sizeof(*pDConnInfo) + connInfo.uScanInfoLen;
12033- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12034+ cmd = kmalloc(cmdlen, GFP_KERNEL);
12035+ if (!cmd)
12036+ return -ENOMEM;
12037
12038- if (cmd) {
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;
12043-
12044- pDConnInfo = (PNwdCScanConnInfo) cmd->data;
12045-
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);
12059-
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;
12068-
12069- if (pDConnInfo->uScanInfoLen) {
12070- localData = (unsigned char *) pDConnInfo;
12071- pDConnInfo->uScanConnInfoOffset = sizeof(*pDConnInfo);
12072- localData += pDConnInfo->uScanConnInfoOffset;
12073- cpylen =
12074- copy_from_user(localData, connInfo.pScanConnInfo,
12075- connInfo.uScanInfoLen);
12076- } else {
12077- pDConnInfo->uScanConnInfoOffset = 0;
12078- }
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;
12083+
12084+ pDConnInfo = (struct nwd_scan_conn_info *) cmd->data;
12085+
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);
12099+
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;
12108+
12109+ if (pDConnInfo->uScanInfoLen) {
12110+ localData = (unsigned char *) pDConnInfo;
12111+ pDConnInfo->uScanConnInfoOffset = sizeof(*pDConnInfo);
12112+ localData += pDConnInfo->uScanConnInfoOffset;
12113+ cpylen =
12114+ copy_from_user(localData, connInfo.pScanConnInfo,
12115+ connInfo.uScanInfoLen);
12116+ } else {
12117+ pDConnInfo->uScanConnInfoOffset = 0;
12118+ }
12119+
12120+ cmd->dataLen = sizeof(*pDConnInfo);
12121
12122- cmd->dataLen = sizeof(*pDConnInfo);
12123+ retCode =
12124+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12125+ (void **)&reply, &replylen,
12126+ INTERRUPTIBLE);
12127+ if (reply) {
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);
12132
12133- retCode =
12134- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12135- (void **)&reply, &replylen,
12136- INTERRUPTIBLE);
12137- if (reply) {
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);
12142-
12143- pDConnInfo = (PNwdCScanConnInfo) reply->data;
12144- retCode = (unsigned long) reply->Reply.ErrorCode;
12145- if (!retCode) {
12146- GetUserData(&connInfo, cmd, reply);
12147- rInfo = (NwcScanConnInfo *) pdata->repData;
12148- cpylen =
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;
12154+ if (!retCode) {
12155+ GetUserData(&connInfo, cmd, reply);
12156+ rInfo = (struct nwc_scan_conn_info *) pdata->repData;
12157+ cpylen =
12158+ copy_to_user(pdata->repData,
12159+ &pDConnInfo->uScanIndex,
12160+ sizeof(pDConnInfo->
12161 uScanIndex));
12162- cpylen =
12163- copy_to_user(&rInfo->uConnectionReference,
12164- &pDConnInfo->
12165- uConnectionReference,
12166- sizeof(pDConnInfo->
12167+ cpylen =
12168+ copy_to_user(&rInfo->uConnectionReference,
12169+ &pDConnInfo->
12170+ uConnectionReference,
12171+ sizeof(pDConnInfo->
12172 uConnectionReference));
12173- } else {
12174- unsigned long x;
12175+ } else {
12176+ unsigned long x;
12177
12178- x = 0;
12179- rInfo = (NwcScanConnInfo *) pdata->reqData;
12180- cpylen =
12181- copy_to_user(&rInfo->uConnectionReference,
12182- &x,
12183- sizeof(rInfo->
12184+ x = 0;
12185+ rInfo = (struct nwc_scan_conn_info *) pdata->reqData;
12186+ cpylen =
12187+ copy_to_user(&rInfo->uConnectionReference,
12188+ &x,
12189+ sizeof(rInfo->
12190 uConnectionReference));
12191- }
12192-
12193- kfree(reply);
12194- } else {
12195- retCode = -EIO;
12196 }
12197- kfree(cmd);
12198
12199+ kfree(reply);
12200+ } else {
12201+ retCode = -EIO;
12202 }
12203-
12204+ kfree(cmd);
12205 return (retCode);
12206 }
12207
12208-/*++======================================================================*/
12209-static void GetUserData(NwcScanConnInfo * connInfo, PXPLAT_CALL_REQUEST cmd, PXPLAT_CALL_REPLY reply)
12210 /*
12211- * Abstract: Copies the user data out of the scan conn info call.
12212- *
12213- *========================================================================*/
12214+ * Copies the user data out of the scan conn info call.
12215+ */
12216+static void GetUserData(struct nwc_scan_conn_info * connInfo, struct novfs_xplat_call_request *cmd, struct novfs_xplat_call_reply *reply)
12217 {
12218 unsigned long uLevel;
12219- PNwdCScanConnInfo pDConnInfo;
12220+ struct nwd_scan_conn_info *pDConnInfo;
12221
12222 unsigned char *srcData = NULL;
12223 unsigned long dataLen = 0, cpylen;
12224
12225- pDConnInfo = (PNwdCScanConnInfo) reply->data;
12226+ pDConnInfo = (struct nwd_scan_conn_info *) reply->data;
12227 uLevel = pDConnInfo->uReturnInfoLevel;
12228 DbgPrint
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:
12232 {
12233 unsigned char *dstData = connInfo->pReturnConnInfo;
12234- NwcTranAddr tranAddr;
12235+ struct nwc_tran_addr tranAddr;
12236
12237 srcData = (unsigned char *) reply->data;
12238 dataLen = reply->dataLen;
12239@@ -1238,20 +1091,20 @@ static void GetUserData(NwcScanConnInfo
12240 sizeof(tranAddr));
12241
12242 srcData +=
12243- ((PNwdCScanConnInfo) srcData)->
12244+ ((struct nwd_scan_conn_info *) srcData)->
12245 uReturnConnInfoOffset;
12246
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;
12253
12254 cpylen =
12255 copy_to_user(dstData, &tranAddr, sizeof(tranAddr));
12256 cpylen =
12257 copy_to_user(tranAddr.puAddress,
12258- ((PNwdTranAddr) srcData)->Buffer,
12259- ((PNwdTranAddr) srcData)->
12260+ ((struct tagNwdTranAddrEx *) srcData)->Buffer,
12261+ ((struct tagNwdTranAddrEx *) srcData)->
12262 uAddressLength);
12263 dataLen = 0;
12264 break;
12265@@ -1276,20 +1129,18 @@ static void GetUserData(NwcScanConnInfo
12266 return;
12267 }
12268
12269-/*++======================================================================*/
12270-static void GetConnData(NwcGetConnInfo * connInfo, PXPLAT_CALL_REQUEST cmd, PXPLAT_CALL_REPLY reply)
12271 /*
12272- * Abstract: Copies the user data out of the scan conn info call.
12273- *
12274- *========================================================================*/
12275+ * Copies the user data out of the scan conn info call.
12276+ */
12277+static void GetConnData(struct nwc_get_conn_info * connInfo, struct novfs_xplat_call_request *cmd, struct novfs_xplat_call_reply *reply)
12278 {
12279 unsigned long uLevel;
12280- PNwdCGetConnInfo pDConnInfo;
12281+ struct nwd_conn_info * pDConnInfo;
12282
12283 unsigned char *srcData = NULL;
12284 unsigned long dataLen = 0, cpylen;
12285
12286- pDConnInfo = (PNwdCGetConnInfo) cmd->data;
12287+ pDConnInfo = (struct nwd_conn_info *) cmd->data;
12288 uLevel = pDConnInfo->uInfoLevel;
12289
12290 switch (uLevel) {
12291@@ -1305,7 +1156,7 @@ static void GetConnData(NwcGetConnInfo *
12292 case NWC_CONN_INFO_TRAN_ADDR:
12293 {
12294 unsigned char *dstData = connInfo->pConnInfo;
12295- NwcTranAddr tranAddr;
12296+ struct nwc_tran_addr tranAddr;
12297
12298 srcData = (unsigned char *) reply->data;
12299
12300@@ -1313,16 +1164,16 @@ static void GetConnData(NwcGetConnInfo *
12301 copy_from_user(&tranAddr, dstData,
12302 sizeof(tranAddr));
12303 tranAddr.uTransportType =
12304- ((PNwdTranAddr) srcData)->uTransportType;
12305+ ((struct tagNwdTranAddrEx *) srcData)->uTransportType;
12306 tranAddr.uAddressLength =
12307- ((PNwdTranAddr) srcData)->uAddressLength;
12308+ ((struct tagNwdTranAddrEx *) srcData)->uAddressLength;
12309
12310 cpylen =
12311 copy_to_user(dstData, &tranAddr, sizeof(tranAddr));
12312 cpylen =
12313 copy_to_user(tranAddr.puAddress,
12314- ((PNwdTranAddr) srcData)->Buffer,
12315- ((PNwdTranAddr) srcData)->
12316+ ((struct tagNwdTranAddrEx *) srcData)->Buffer,
12317+ ((struct tagNwdTranAddrEx *) srcData)->
12318 uAddressLength);
12319 dataLen = 0;
12320 break;
12321@@ -1376,343 +1227,282 @@ static void GetConnData(NwcGetConnInfo *
12322 return;
12323 }
12324
12325-/*++======================================================================*/
12326-int NwGetDaemonVersion(PXPLAT pdata, session_t Session)
12327-/*
12328- * Arguments:
12329- *
12330- * Returns:
12331- *
12332- * Abstract:
12333- *
12334- * Notes:
12335- *
12336- * Environment:
12337- *
12338- *========================================================================*/
12339-{
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)
12344+{
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;
12350
12351 datalen = sizeof(*pDVersion);
12352 cmdlen = datalen + sizeof(*cmd);
12353- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
12354-
12355- if (cmd) {
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);
12361- retCode =
12362- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12363- (void **)&reply, &replylen,
12364- INTERRUPTIBLE);
12365- if (reply) {
12366- retCode = reply->Reply.ErrorCode;
12367- pDVersion = (PNwdCGetRequesterVersion) reply->data;
12368- cpylen =
12369- copy_to_user(pDVersion, pdata->reqData,
12370- sizeof(*pDVersion));
12371- kfree(reply);
12372- }
12373- kfree(cmd);
12374- }
12375- return (retCode);
12376-
12377-}
12378+ cmd = kmalloc(cmdlen, GFP_KERNEL);
12379+ if (!cmd)
12380+ return -ENOMEM;
12381
12382-/*++======================================================================*/
12383-int NwcGetPreferredDSTree(PXPLAT pdata, session_t Session)
12384-/*
12385- * Arguments:
12386- *
12387- * Returns:
12388- *
12389- * Abstract:
12390- *
12391- * Notes:
12392- *
12393- * Environment:
12394- *
12395- *========================================================================*/
12396-{
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);
12406+ retCode =
12407+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12408+ (void **)&reply, &replylen,
12409+ INTERRUPTIBLE);
12410+ if (reply) {
12411+ retCode = reply->Reply.ErrorCode;
12412+ pDVersion = (struct nwd_get_reqversion *) reply->data;
12413+ cpylen =
12414+ copy_to_user(pDVersion, pdata->reqData,
12415+ sizeof(*pDVersion));
12416+ kfree(reply);
12417+ }
12418+ kfree(cmd);
12419+ return (retCode);
12420+
12421+}
12422+
12423+int novfs_get_preferred_DS_tree(struct novfs_xplat *pdata, struct novfs_schandle Session)
12424+{
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;
12432
12433 cpylen =
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);
12441
12442- if (cmd) {
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);
12448-
12449- retCode =
12450- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12451- (void **)&reply, &replylen,
12452- INTERRUPTIBLE);
12453- if (reply) {
12454- retCode = reply->Reply.ErrorCode;
12455- if (!retCode) {
12456- pDGetTree =
12457- (PNwdCGetPreferredDsTree) reply->data;
12458- dPtr =
12459- reply->data + pDGetTree->DsTreeNameOffset;
12460- p = (NwcGetPreferredDsTree *) pdata->reqData;
12461-
12462- DbgPrint
12463- ("NwcGetPreferredDSTree: Reply recieved\n");
12464- DbgPrint(" TreeLen = %x\n",
12465- pDGetTree->uTreeLength);
12466- DbgPrint(" TreeName = %s\n", dPtr);
12467-
12468- cpylen =
12469- copy_to_user(p, &pDGetTree->uTreeLength, 4);
12470- cpylen =
12471- copy_to_user(xplatCall.pDsTreeName, dPtr,
12472- pDGetTree->uTreeLength);
12473- }
12474- kfree(reply);
12475+ if (!cmd)
12476+ return -ENOMEM;
12477+
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);
12483+
12484+ retCode =
12485+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12486+ (void **)&reply, &replylen,
12487+ INTERRUPTIBLE);
12488+ if (reply) {
12489+ retCode = reply->Reply.ErrorCode;
12490+ if (!retCode) {
12491+ pDGetTree =
12492+ (struct nwd_get_pref_ds_tree *) reply->data;
12493+ dPtr =
12494+ reply->data + pDGetTree->DsTreeNameOffset;
12495+ p = (struct nwc_get_pref_ds_tree *) pdata->reqData;
12496+
12497+ DbgPrint
12498+ ("NwcGetPreferredDSTree: Reply recieved\n");
12499+ DbgPrint(" TreeLen = %x\n",
12500+ pDGetTree->uTreeLength);
12501+ DbgPrint(" TreeName = %s\n", dPtr);
12502+
12503+ cpylen =
12504+ copy_to_user(p, &pDGetTree->uTreeLength, 4);
12505+ cpylen =
12506+ copy_to_user(xplatCall.pDsTreeName, dPtr,
12507+ pDGetTree->uTreeLength);
12508 }
12509- kfree(cmd);
12510+ kfree(reply);
12511 }
12512+ kfree(cmd);
12513 return (retCode);
12514
12515 }
12516
12517-/*++======================================================================*/
12518-int NwcSetPreferredDSTree(PXPLAT pdata, session_t Session)
12519-/*
12520- * Arguments:
12521- *
12522- * Returns:
12523- *
12524- * Abstract:
12525- *
12526- * Notes:
12527- *
12528- * Environment:
12529- *
12530- *========================================================================*/
12531-{
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)
12537+{
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;
12545
12546 cpylen =
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);
12554
12555- if (cmd) {
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;
12560-
12561- pDSetTree = (PNwdCSetPreferredDsTree) cmd->data;
12562- pDSetTree->DsTreeNameOffset = sizeof(*pDSetTree);
12563- pDSetTree->uTreeLength = xplatCall.uTreeLength;
12564+ if (!cmd)
12565+ return -ENOMEM;
12566
12567- dPtr = cmd->data + sizeof(*pDSetTree);
12568- cpylen =
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;
12575
12576- retCode =
12577- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12578- (void **)&reply, &replylen,
12579- INTERRUPTIBLE);
12580- if (reply) {
12581- retCode = reply->Reply.ErrorCode;
12582- kfree(reply);
12583- }
12584- kfree(cmd);
12585+ pDSetTree = (struct nwd_set_pref_ds_tree *) cmd->data;
12586+ pDSetTree->DsTreeNameOffset = sizeof(*pDSetTree);
12587+ pDSetTree->uTreeLength = xplatCall.uTreeLength;
12588+
12589+ dPtr = cmd->data + sizeof(*pDSetTree);
12590+ cpylen =
12591+ copy_from_user(dPtr, xplatCall.pDsTreeName,
12592+ xplatCall.uTreeLength);
12593+
12594+ retCode =
12595+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12596+ (void **)&reply, &replylen,
12597+ INTERRUPTIBLE);
12598+ if (reply) {
12599+ retCode = reply->Reply.ErrorCode;
12600+ kfree(reply);
12601 }
12602+ kfree(cmd);
12603 return (retCode);
12604
12605 }
12606
12607-/*++======================================================================*/
12608-int NwcSetDefaultNameCtx(PXPLAT pdata, session_t Session)
12609-/*
12610- * Arguments:
12611- *
12612- * Returns:
12613- *
12614- * Abstract:
12615- *
12616- * Notes:
12617- *
12618- * Environment:
12619- *
12620- *========================================================================*/
12621-{
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)
12628+{
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;
12636
12637 cpylen =
12638 copy_from_user(&xplatCall, pdata->reqData,
12639- sizeof(NwcSetDefaultNameContext));
12640+ sizeof(struct nwc_set_def_name_ctx));
12641 datalen =
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);
12646
12647- if (cmd) {
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;
12652- cmd->dataLen =
12653- sizeof(NwdCSetDefaultNameContext) + xplatCall.uTreeLength +
12654- xplatCall.uNameLength;
12655-
12656- pDSet = (PNwdCSetDefaultNameContext) cmd->data;
12657- dPtr = cmd->data;
12658-
12659- pDSet->TreeOffset = sizeof(NwdCSetDefaultNameContext);
12660- pDSet->uTreeLength = xplatCall.uTreeLength;
12661- pDSet->NameContextOffset =
12662- pDSet->TreeOffset + xplatCall.uTreeLength;
12663- pDSet->uNameLength = xplatCall.uNameLength;
12664+ if (!cmd)
12665+ return -ENOMEM;
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;
12670+ cmd->dataLen =
12671+ sizeof(struct nwd_set_def_name_ctx) +
12672+ xplatCall.uTreeLength + xplatCall.uNameLength;
12673+
12674+ pDSet = (struct nwd_set_def_name_ctx *) cmd->data;
12675+ dPtr = cmd->data;
12676+
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;
12682
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
12685- cpylen =
12686- copy_from_user(dPtr + pDSet->NameContextOffset,
12687- xplatCall.pNameContext,
12688- xplatCall.uNameLength);
12689-
12690- retCode =
12691- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12692- (void **)&reply, &replylen,
12693- INTERRUPTIBLE);
12694- if (reply) {
12695- retCode = reply->Reply.ErrorCode;
12696- kfree(reply);
12697- }
12698- kfree(cmd);
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
12701+ cpylen =
12702+ copy_from_user(dPtr + pDSet->NameContextOffset,
12703+ xplatCall.pNameContext,
12704+ xplatCall.uNameLength);
12705+
12706+ retCode =
12707+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12708+ (void **)&reply, &replylen,
12709+ INTERRUPTIBLE);
12710+ if (reply) {
12711+ retCode = reply->Reply.ErrorCode;
12712+ kfree(reply);
12713 }
12714+ kfree(cmd);
12715 return (retCode);
12716
12717 }
12718
12719-/*++======================================================================*/
12720-int NwcGetDefaultNameCtx(PXPLAT pdata, session_t Session)
12721-/*
12722- * Arguments:
12723- *
12724- * Returns:
12725- *
12726- * Abstract:
12727- *
12728- * Notes:
12729- *
12730- * Environment:
12731- *
12732- *========================================================================*/
12733-{
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)
12740+{
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;
12745 char *dPtr;
12746 int retCode = -ENOMEM;
12747 unsigned long cmdlen, replylen, cpylen;
12748
12749 cpylen =
12750 copy_from_user(&xplatCall, pdata->reqData,
12751- sizeof(NwcGetDefaultNameContext));
12752+ sizeof(struct nwc_get_def_name_ctx));
12753 cmdlen =
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);
12759
12760- if (cmd) {
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;
12765- cmd->dataLen =
12766- sizeof(NwdCGetDefaultNameContext) + xplatCall.uTreeLength;
12767-
12768- pGet = (PNwdCGetDefaultNameContext) cmd->data;
12769- dPtr = cmd->data;
12770-
12771- pGet->TreeOffset = sizeof(NwdCGetDefaultNameContext);
12772- pGet->uTreeLength = xplatCall.uTreeLength;
12773-
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;
12777-
12778- retCode =
12779- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12780- (void **)&reply, &replylen,
12781- INTERRUPTIBLE);
12782- if (reply) {
12783- retCode = reply->Reply.ErrorCode;
12784- if (!retCode) {
12785- pGet = (PNwdCGetDefaultNameContext) reply->data;
12786-
12787- DbgPrint
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;
12795- }
12796- dPtr = (char *)pGet + pGet->NameContextOffset;
12797- cpylen =
12798- copy_to_user(xplatCall.pNameContext, dPtr,
12799- pGet->uNameLength);
12800- }
12801+ if (!cmd)
12802+ return -ENOMEM;
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;
12807+ cmd->dataLen =
12808+ sizeof(struct nwd_get_def_name_ctx) + xplatCall.uTreeLength;
12809+
12810+ pGet = (struct nwd_get_def_name_ctx *) cmd->data;
12811+ dPtr = cmd->data;
12812+
12813+ pGet->TreeOffset = sizeof(struct nwd_get_def_name_ctx );
12814+ pGet->uTreeLength = xplatCall.uTreeLength;
12815+
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;
12819+
12820+ retCode =
12821+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12822+ (void **)&reply, &replylen,
12823+ INTERRUPTIBLE);
12824+ if (reply) {
12825+ retCode = reply->Reply.ErrorCode;
12826+ if (!retCode) {
12827+ pGet = (struct nwd_get_def_name_ctx *) reply->data;
12828
12829- kfree(reply);
12830+ DbgPrint
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;
12838+ }
12839+ dPtr = (char *)pGet + pGet->NameContextOffset;
12840+ cpylen =
12841+ copy_to_user(xplatCall.pNameContext, dPtr,
12842+ pGet->uNameLength);
12843 }
12844- kfree(cmd);
12845+
12846+ kfree(reply);
12847 }
12848+ kfree(cmd);
12849 return (retCode);
12850
12851 }
12852
12853-int NwQueryFeature(PXPLAT pdata, session_t Session)
12854+int novfs_query_feature(struct novfs_xplat *pdata, struct novfs_schandle Session)
12855 {
12856- NwcQueryFeature xpCall;
12857+ struct nwc_query_feature xpCall;
12858 int status = 0;
12859 unsigned long cpylen;
12860
12861 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) {
12865 case NWC_FEAT_NDS:
12866 case NWC_FEAT_NDS_MTREE:
12867@@ -1725,372 +1515,306 @@ int NwQueryFeature(PXPLAT pdata, session
12868 return (status);
12869 }
12870
12871-/*++======================================================================*/
12872-int NwcGetTreeMonitoredConn(PXPLAT pdata, session_t Session)
12873-/*
12874- * Arguments:
12875- *
12876- * Returns:
12877- *
12878- * Abstract:
12879- *
12880- * Notes:
12881- *
12882- * Environment:
12883- *
12884- *========================================================================*/
12885-{
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)
12892+{
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;
12897 char *dPtr;
12898 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
12899
12900 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);
12908
12909- if (cmd) {
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;
12914-
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;
12919+ if (!cmd)
12920+ return -ENOMEM;
12921
12922- dPtr = cmd->data + sizeof(*pDConnRef);
12923- cpylen =
12924- copy_from_user(dPtr, xplatCall.pTreeName->pBuffer,
12925- pDConnRef->TreeName.len);
12926- status =
12927- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12928- (void **)&reply, &replylen,
12929- INTERRUPTIBLE);
12930- if (reply) {
12931- pDConnRef = (PNwdCGetTreeMonitoredConnRef) reply->data;
12932- dPtr = reply->data + pDConnRef->TreeName.boffset;
12933- p = (NwcGetTreeMonitoredConnRef *) pdata->reqData;
12934- cpylen =
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;
12941
12942- status = reply->Reply.ErrorCode;
12943- kfree(reply);
12944- }
12945- kfree(cmd);
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;
12950
12951- }
12952+ dPtr = cmd->data + sizeof(*pDConnRef);
12953+ cpylen =
12954+ copy_from_user(dPtr, xplatCall.pTreeName->pBuffer,
12955+ pDConnRef->TreeName.len);
12956+ status =
12957+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
12958+ (void **)&reply, &replylen,
12959+ INTERRUPTIBLE);
12960+ if (reply) {
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;
12964+ cpylen =
12965+ copy_to_user(&p->uConnReference,
12966+ &pDConnRef->uConnReference, 4);
12967
12968+ status = reply->Reply.ErrorCode;
12969+ kfree(reply);
12970+ }
12971+ kfree(cmd);
12972 return (status);
12973 }
12974
12975-/*++======================================================================*/
12976-int NwcEnumIdentities(PXPLAT pdata, session_t Session)
12977-/*
12978- * Arguments:
12979- *
12980- * Returns:
12981- *
12982- * Abstract:
12983- *
12984- * Notes:
12985- *
12986- * Environment:
12987- *
12988- *========================================================================*/
12989-{
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)
12996+{
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;
13002 char *str;
13003 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
13004
13005 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);
13013
13014- if (cmd) {
13015- cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13016- cmd->Command.SequenceNumber = 0;
13017- cmd->Command.SessionId = Session;
13018- cmd->NwcCommand = NWC_ENUMERATE_IDENTITIES;
13019-
13020- DbgPrint("NwcEnumIdentities: Send Request\n");
13021- DbgPrint(" iterator = %x\n", xplatCall.Iterator);
13022- DbgPrint(" cmdlen = %d\n", cmdlen);
13023-
13024- pEnum = (PNwdCEnumerateIdentities) cmd->data;
13025- pEnum->Iterator = xplatCall.Iterator;
13026- status =
13027- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13028- (void **)&reply, &replylen,
13029- INTERRUPTIBLE);
13030- if (reply) {
13031- status = reply->Reply.ErrorCode;
13032-
13033- eId = pdata->repData;
13034- pEnum = (PNwdCEnumerateIdentities) reply->data;
13035- cpylen =
13036- copy_to_user(&eId->Iterator, &pEnum->Iterator,
13037- sizeof(pEnum->Iterator));
13038- DbgPrint("[XPLAT NWCAPI] Found AuthId 0x%X\n",
13039- pEnum->AuthenticationId);
13040- cpylen =
13041- copy_to_user(&eId->AuthenticationId,
13042- &pEnum->AuthenticationId,
13043- sizeof(pEnum->AuthenticationId));
13044- cpylen =
13045- copy_to_user(&eId->AuthType, &pEnum->AuthType,
13046- sizeof(pEnum->AuthType));
13047- cpylen =
13048- copy_to_user(&eId->IdentityFlags,
13049- &pEnum->IdentityFlags,
13050- sizeof(pEnum->IdentityFlags));
13051- cpylen =
13052- copy_to_user(&eId->NameType, &pEnum->NameType,
13053- sizeof(pEnum->NameType));
13054- cpylen =
13055- copy_to_user(&eId->ObjectType, &pEnum->ObjectType,
13056- sizeof(pEnum->ObjectType));
13057-
13058- if (!status) {
13059- cpylen =
13060- copy_from_user(&xferStr, eId->pDomainName,
13061- sizeof(NwcString));
13062- str =
13063- (char *)((char *)reply->data +
13064- pEnum->domainNameOffset);
13065- DbgPrint("[XPLAT NWCAPI] Found Domain %s\n",
13066- str);
13067- cpylen =
13068- copy_to_user(xferStr.pBuffer, str,
13069- pEnum->domainNameLen);
13070- xferStr.DataType = NWC_STRING_TYPE_ASCII;
13071- xferStr.DataLen = pEnum->domainNameLen - 1;
13072- cpylen =
13073- copy_to_user(eId->pDomainName, &xferStr,
13074- sizeof(NwcString));
13075-
13076- cpylen =
13077- copy_from_user(&xferStr, eId->pObjectName,
13078- sizeof(NwcString));
13079- str =
13080- (char *)((char *)reply->data +
13081- pEnum->objectNameOffset);
13082- DbgPrint("[XPLAT NWCAPI] Found User %s\n", str);
13083- cpylen =
13084- copy_to_user(xferStr.pBuffer, str,
13085- pEnum->objectNameLen);
13086- xferStr.DataType = NWC_STRING_TYPE_ASCII;
13087- xferStr.DataLen = pEnum->objectNameLen - 1;
13088- cpylen =
13089- copy_to_user(eId->pObjectName, &xferStr,
13090- sizeof(NwcString));
13091- }
13092+ if (!cmd)
13093+ return -ENOMEM;
13094+
13095+ cmd->Command.CommandType = VFS_COMMAND_XPLAT_CALL;
13096+ cmd->Command.SequenceNumber = 0;
13097+ cmd->Command.SessionId = Session;
13098+ cmd->NwcCommand = NWC_ENUMERATE_IDENTITIES;
13099+
13100+ DbgPrint("NwcEnumIdentities: Send Request\n");
13101+ DbgPrint(" iterator = %x\n", xplatCall.Iterator);
13102+ DbgPrint(" cmdlen = %d\n", cmdlen);
13103
13104- kfree(reply);
13105+ pEnum = (struct nwd_enum_ids *) cmd->data;
13106+ pEnum->Iterator = xplatCall.Iterator;
13107+ status =
13108+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13109+ (void **)&reply, &replylen,
13110+ INTERRUPTIBLE);
13111+ if (reply) {
13112+ status = reply->Reply.ErrorCode;
13113
13114+ eId = pdata->repData;
13115+ pEnum = (struct nwd_enum_ids *) reply->data;
13116+ cpylen =
13117+ copy_to_user(&eId->Iterator, &pEnum->Iterator,
13118+ sizeof(pEnum->Iterator));
13119+ DbgPrint("[XPLAT NWCAPI] Found AuthId 0x%X\n",
13120+ pEnum->AuthenticationId);
13121+ cpylen =
13122+ copy_to_user(&eId->AuthenticationId,
13123+ &pEnum->AuthenticationId,
13124+ sizeof(pEnum->AuthenticationId));
13125+ cpylen =
13126+ copy_to_user(&eId->AuthType, &pEnum->AuthType,
13127+ sizeof(pEnum->AuthType));
13128+ cpylen =
13129+ copy_to_user(&eId->IdentityFlags,
13130+ &pEnum->IdentityFlags,
13131+ sizeof(pEnum->IdentityFlags));
13132+ cpylen =
13133+ copy_to_user(&eId->NameType, &pEnum->NameType,
13134+ sizeof(pEnum->NameType));
13135+ cpylen =
13136+ copy_to_user(&eId->ObjectType, &pEnum->ObjectType,
13137+ sizeof(pEnum->ObjectType));
13138+
13139+ if (!status) {
13140+ cpylen =
13141+ copy_from_user(&xferStr, eId->pDomainName,
13142+ sizeof(struct nwc_string));
13143+ str =
13144+ (char *)((char *)reply->data +
13145+ pEnum->domainNameOffset);
13146+ DbgPrint("[XPLAT NWCAPI] Found Domain %s\n",
13147+ str);
13148+ cpylen =
13149+ copy_to_user(xferStr.pBuffer, str,
13150+ pEnum->domainNameLen);
13151+ xferStr.DataType = NWC_STRING_TYPE_ASCII;
13152+ xferStr.DataLen = pEnum->domainNameLen - 1;
13153+ cpylen =
13154+ copy_to_user(eId->pDomainName, &xferStr,
13155+ sizeof(struct nwc_string));
13156+
13157+ cpylen =
13158+ copy_from_user(&xferStr, eId->pObjectName,
13159+ sizeof(struct nwc_string));
13160+ str =
13161+ (char *)((char *)reply->data +
13162+ pEnum->objectNameOffset);
13163+ DbgPrint("[XPLAT NWCAPI] Found User %s\n", str);
13164+ cpylen =
13165+ copy_to_user(xferStr.pBuffer, str,
13166+ pEnum->objectNameLen);
13167+ xferStr.DataType = NWC_STRING_TYPE_ASCII;
13168+ xferStr.DataLen = pEnum->objectNameLen - 1;
13169+ cpylen =
13170+ copy_to_user(eId->pObjectName, &xferStr,
13171+ sizeof(struct nwc_string));
13172 }
13173- kfree(cmd);
13174+
13175+ kfree(reply);
13176
13177 }
13178+ kfree(cmd);
13179 return (status);
13180 }
13181
13182-/*++======================================================================*/
13183-int NwcChangeAuthKey(PXPLAT pdata, session_t Session)
13184-/*
13185- * Arguments:
13186- *
13187- * Returns:
13188- *
13189- * Abstract: Change the password on the server
13190- *
13191- * Notes:
13192- *
13193- * Environment:
13194- *
13195- *========================================================================*/
13196-{
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)
13203+{
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;
13209 char *str;
13210 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
13211
13212 cpylen =
13213- copy_from_user(&xplatCall, pdata->reqData, sizeof(NwcChangeKey));
13214+ copy_from_user(&xplatCall, pdata->reqData, sizeof(struct nwc_change_key));
13215
13216 datalen =
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;
13221
13222 cmdlen = sizeof(*cmd) + datalen;
13223- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13224+ cmd = kmalloc(cmdlen, GFP_KERNEL);
13225
13226- if (cmd) {
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;
13233-
13234- pNewKey->NameType = xplatCall.NameType;
13235- pNewKey->ObjectType = xplatCall.ObjectType;
13236- pNewKey->AuthType = xplatCall.AuthType;
13237- str = (char *)pNewKey;
13238+ if (!cmd)
13239+ return -ENOMEM;
13240
13241- /*
13242- * Get the tree name
13243- */
13244- str += sizeof(*pNewKey);
13245- cpylen =
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;
13257
13258- /*
13259- * Get the User Name
13260- */
13261- str += pNewKey->domainNameLen;
13262- cpylen =
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;
13273
13274- /*
13275- * Get the New Password
13276- */
13277- str += pNewKey->objectNameLen;
13278- cpylen =
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;
13285+ /*
13286+ * Get the tree name
13287+ */
13288+ str += sizeof(*pNewKey);
13289+ cpylen =
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;
13295
13296- /*
13297- * Get the Verify Password
13298- */
13299- str += pNewKey->newPasswordLen;
13300- cpylen =
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;
13307-
13308- status =
13309- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13310- (void **)&reply, &replylen,
13311- INTERRUPTIBLE);
13312- if (reply) {
13313- status = reply->Reply.ErrorCode;
13314- kfree(reply);
13315- }
13316- memset(cmd, 0, cmdlen);
13317+ /*
13318+ * Get the User Name
13319+ */
13320+ str += pNewKey->domainNameLen;
13321+ cpylen =
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;
13328
13329- kfree(cmd);
13330+ /*
13331+ * Get the New Password
13332+ */
13333+ str += pNewKey->objectNameLen;
13334+ cpylen =
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;
13341+
13342+ /*
13343+ * Get the Verify Password
13344+ */
13345+ str += pNewKey->newPasswordLen;
13346+ cpylen =
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;
13353+
13354+ status =
13355+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13356+ (void **)&reply, &replylen,
13357+ INTERRUPTIBLE);
13358+ if (reply) {
13359+ status = reply->Reply.ErrorCode;
13360+ kfree(reply);
13361 }
13362+ memset(cmd, 0, cmdlen);
13363
13364+ kfree(cmd);
13365 return (status);
13366 }
13367
13368-/*++======================================================================*/
13369-int NwcSetPrimaryConn(PXPLAT pdata, session_t Session)
13370-/*
13371- * Arguments:
13372- *
13373- * Returns:
13374- *
13375- * Abstract: Set the primary connection Id
13376- *
13377- * Notes:
13378- *
13379- * Environment:
13380- *
13381- *========================================================================*/
13382-{
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)
13388+{
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;
13394
13395 cpylen =
13396 copy_from_user(&xplatCall, pdata->reqData,
13397- sizeof(NwcSetPrimaryConnection));
13398+ sizeof(struct nwc_set_primary_conn));
13399
13400- datalen = sizeof(NwdCSetPrimaryConnection);
13401+ datalen = sizeof(struct nwd_set_primary_conn);
13402 cmdlen = sizeof(*cmd) + datalen;
13403- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13404- if (cmd) {
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;
13412- status =
13413- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13414- (void **)&reply, &replylen,
13415- INTERRUPTIBLE);
13416-
13417- if (reply) {
13418- status = reply->Reply.ErrorCode;
13419- kfree(reply);
13420- }
13421+ cmd = kmalloc(cmdlen, GFP_KERNEL);
13422+ if (!cmd)
13423+ return -ENOMEM;
13424
13425- kfree(cmd);
13426- }
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;
13434+ status =
13435+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13436+ (void **)&reply, &replylen,
13437+ INTERRUPTIBLE);
13438
13439+ if (reply) {
13440+ status = reply->Reply.ErrorCode;
13441+ kfree(reply);
13442+ }
13443+ kfree(cmd);
13444 return (status);
13445 }
13446
13447-/*++======================================================================*/
13448-int NwcGetPrimaryConn(PXPLAT pdata, session_t Session)
13449-/*
13450- * Arguments:
13451- *
13452- * Returns:
13453- *
13454- * Abstract: Get the Primary connection
13455- *
13456- * Notes:
13457- *
13458- * Environment:
13459- *
13460- *========================================================================*/
13461+int novfs_get_pri_conn(struct novfs_xplat *pdata, struct novfs_schandle Session)
13462 {
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;
13468
13469- cmdlen = (unsigned long) (&((PXPLAT_CALL_REQUEST) 0)->data);
13470+ cmdlen = (unsigned long) (&((struct novfs_xplat_call_request *) 0)->data);
13471
13472 cmd.dataLen = 0;
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;
13476
13477 status =
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);
13482
13483 if (reply) {
13484 status = reply->Reply.ErrorCode;
13485 if (!status) {
13486 cpylen =
13487- copy_to_user(pdata->repData, reply->data,
13488- sizeof(unsigned long));
13489+ copy_to_user(pdata->repData, reply->data,
13490+ sizeof(unsigned long));
13491 }
13492
13493 kfree(reply);
13494@@ -2116,26 +1840,13 @@ int NwcGetPrimaryConn(PXPLAT pdata, sess
13495 return (status);
13496 }
13497
13498-/*++======================================================================*/
13499-int NwcSetMapDrive(PXPLAT pdata, session_t Session)
13500-/*
13501- * Arguments:
13502- *
13503- * Returns:
13504- *
13505- * Abstract: Get the Primary connection
13506- *
13507- * Notes:
13508- *
13509- * Environment:
13510- *
13511- *========================================================================*/
13512+int novfs_set_map_drive(struct novfs_xplat *pdata, struct novfs_schandle Session)
13513 {
13514
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;
13522
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);
13528
13529- mydump(sizeof(symInfo), &symInfo);
13530+ novfs_dump(sizeof(symInfo), &symInfo);
13531
13532 cmdlen += datalen;
13533
13534- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13535- if (cmd) {
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;
13541-
13542- cpylen = copy_from_user(cmd->data, pdata->reqData, datalen);
13543- status =
13544- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13545- (void **)&reply, &replylen,
13546- INTERRUPTIBLE);
13547-
13548- if (reply) {
13549- status = reply->Reply.ErrorCode;
13550- kfree(reply);
13551- }
13552- kfree(cmd);
13553+ cmd = kmalloc(cmdlen, GFP_KERNEL);
13554+ if (!cmd)
13555+ return -ENOMEM;
13556+
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;
13562+
13563+ cpylen = copy_from_user(cmd->data, pdata->reqData, datalen);
13564+ status =
13565+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13566+ (void **)&reply, &replylen,
13567+ INTERRUPTIBLE);
13568+
13569+ if (reply) {
13570+ status = reply->Reply.ErrorCode;
13571+ kfree(reply);
13572 }
13573+ kfree(cmd);
13574 return (status);
13575
13576 }
13577
13578-/*++======================================================================*/
13579-int NwcUnMapDrive(PXPLAT pdata, session_t Session)
13580-/*
13581- * Arguments:
13582- *
13583- * Returns:
13584- *
13585- * Abstract: Get the Primary connection
13586- *
13587- * Notes:
13588- *
13589- * Environment:
13590- *
13591- *========================================================================*/
13592+int novfs_unmap_drive(struct novfs_xplat *pdata, struct novfs_schandle Session)
13593 {
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;
13601
13602 DbgPrint("Call to NwcUnMapDrive\n");
13603
13604@@ -2206,47 +1905,34 @@ int NwcUnMapDrive(PXPLAT pdata, session_
13605 datalen = sizeof(symInfo) + symInfo.linkLen;
13606
13607 cmdlen += datalen;
13608- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13609- if (cmd) {
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;
13615-
13616- cpylen = copy_from_user(cmd->data, pdata->reqData, datalen);
13617- status =
13618- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13619- (void **)&reply, &replylen,
13620- INTERRUPTIBLE);
13621-
13622- if (reply) {
13623- status = reply->Reply.ErrorCode;
13624- kfree(reply);
13625- }
13626- kfree(cmd);
13627- }
13628+ cmd = kmalloc(cmdlen, GFP_KERNEL);
13629+ if (!cmd)
13630+ return -ENOMEM;
13631+
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;
13637+
13638+ cpylen = copy_from_user(cmd->data, pdata->reqData, datalen);
13639+ status =
13640+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13641+ (void **)&reply, &replylen,
13642+ INTERRUPTIBLE);
13643
13644+ if (reply) {
13645+ status = reply->Reply.ErrorCode;
13646+ kfree(reply);
13647+ }
13648+ kfree(cmd);
13649 return (status);
13650 }
13651
13652-/*++======================================================================*/
13653-int NwcEnumerateDrives(PXPLAT pdata, session_t Session)
13654-/*
13655- * Arguments:
13656- *
13657- * Returns:
13658- *
13659- * Abstract: Get the Primary connection
13660- *
13661- * Notes:
13662- *
13663- * Environment:
13664- *
13665- *========================================================================*/
13666+int novfs_enum_drives(struct novfs_xplat *pdata, struct novfs_schandle Session)
13667 {
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;
13674 char *cp;
13675@@ -2254,284 +1940,266 @@ int NwcEnumerateDrives(PXPLAT pdata, ses
13676 DbgPrint("Call to NwcEnumerateDrives\n");
13677
13678 cmdlen = sizeof(*cmd);
13679- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13680- if (cmd) {
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;
13686- status =
13687- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13688- (void **)&reply, &replylen,
13689- INTERRUPTIBLE);
13690-
13691- if (reply) {
13692- status = reply->Reply.ErrorCode;
13693- DbgPrint("Status Code = 0x%X\n", status);
13694- if (!status) {
13695- offset =
13696- sizeof(((PNwcGetMappedDrives) pdata->
13697- repData)->MapBuffLen);
13698- cp = reply->data;
13699- replylen =
13700- ((PNwcGetMappedDrives) pdata->repData)->
13701- MapBuffLen;
13702- cpylen =
13703- copy_to_user(pdata->repData, cp, offset);
13704- cp += offset;
13705- cpylen =
13706- copy_to_user(((PNwcGetMappedDrives) pdata->
13707- repData)->MapBuffer, cp,
13708- min(replylen - offset,
13709- reply->dataLen - offset));
13710- }
13711+ cmd = kmalloc(cmdlen, GFP_KERNEL);
13712+ if (!cmd)
13713+ return -ENOMEM;
13714
13715- kfree(reply);
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;
13721+ status =
13722+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13723+ (void **)&reply, &replylen,
13724+ INTERRUPTIBLE);
13725+
13726+ if (reply) {
13727+ status = reply->Reply.ErrorCode;
13728+ DbgPrint("Status Code = 0x%X\n", status);
13729+ if (!status) {
13730+ offset =
13731+ sizeof(((struct nwc_get_mapped_drives *) pdata->
13732+ repData)->MapBuffLen);
13733+ cp = reply->data;
13734+ replylen =
13735+ ((struct nwc_get_mapped_drives *) pdata->repData)->
13736+ MapBuffLen;
13737+ cpylen =
13738+ copy_to_user(pdata->repData, cp, offset);
13739+ cp += offset;
13740+ cpylen =
13741+ copy_to_user(((struct nwc_get_mapped_drives *) pdata->
13742+ repData)->MapBuffer, cp,
13743+ min(replylen - offset,
13744+ reply->dataLen - offset));
13745 }
13746- kfree(cmd);
13747- }
13748
13749+ kfree(reply);
13750+ }
13751+ kfree(cmd);
13752 return (status);
13753 }
13754
13755-/*++======================================================================*/
13756-int NwcGetBroadcastMessage(PXPLAT pdata, session_t Session)
13757-/*
13758- * Arguments:
13759- *
13760- * Returns:
13761- *
13762- * Abstract: Get the Primary connection
13763- *
13764- * Notes:
13765- *
13766- * Environment:
13767- *
13768- *========================================================================*/
13769+int novfs_get_bcast_msg(struct novfs_xplat *pdata, struct novfs_schandle Session)
13770 {
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;
13781
13782 cmdlen = sizeof(*cmd) + sizeof(*dmsg);
13783- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13784- if (cmd) {
13785+ cmd = kmalloc(cmdlen, GFP_KERNEL);
13786+ if (!cmd)
13787+ return -ENOMEM;
13788
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;
13794-
13795- cmd->NwcCommand = NWC_GET_BROADCAST_MESSAGE;
13796- dmsg = (PNwdCGetBroadcastNotification) cmd->data;
13797- dmsg->uConnReference = (HANDLE) (unsigned long) msg.uConnReference;
13798-
13799- status =
13800- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13801- (void **)&reply, &replylen,
13802- INTERRUPTIBLE);
13803-
13804- if (reply) {
13805- status = reply->Reply.ErrorCode;
13806-
13807- if (!status) {
13808- char *cp = pdata->repData;
13809-
13810- dmsg =
13811- (PNwdCGetBroadcastNotification) reply->data;
13812- if (pdata->repLen < dmsg->messageLen) {
13813- dmsg->messageLen = pdata->repLen;
13814- }
13815- msg.messageLen = dmsg->messageLen;
13816- cpylen = offsetof(NwcGetBroadcastNotification, message);
13817- cp += cpylen;
13818- cpylen = copy_to_user(pdata->repData, &msg, cpylen);
13819- cpylen = copy_to_user(cp, dmsg->message, msg.messageLen);
13820- } else {
13821- msg.messageLen = 0;
13822- msg.message[0] = 0;
13823- cpylen = offsetof(NwcGetBroadcastNotification, message);
13824- cpylen = copy_to_user(pdata->repData, &msg, sizeof(msg));
13825- }
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;
13831+
13832+ cmd->NwcCommand = NWC_GET_BROADCAST_MESSAGE;
13833+ dmsg = (struct nwd_get_bcast_notification *) cmd->data;
13834+ dmsg->uConnReference = (void *) (unsigned long) msg.uConnReference;
13835+
13836+ status =
13837+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13838+ (void **)&reply, &replylen,
13839+ INTERRUPTIBLE);
13840+
13841+ if (reply) {
13842+ status = reply->Reply.ErrorCode;
13843
13844- kfree(reply);
13845+ if (!status) {
13846+ char *cp = pdata->repData;
13847+
13848+ dmsg =
13849+ (struct nwd_get_bcast_notification *) reply->data;
13850+ if (pdata->repLen < dmsg->messageLen) {
13851+ dmsg->messageLen = pdata->repLen;
13852+ }
13853+ msg.messageLen = dmsg->messageLen;
13854+ cpylen =
13855+ offsetof(struct
13856+ nwc_get_bcast_notification,
13857+ message);
13858+ cp += cpylen;
13859+ cpylen =
13860+ copy_to_user(pdata->repData, &msg, cpylen);
13861+ cpylen =
13862+ copy_to_user(cp, dmsg->message,
13863+ msg.messageLen);
13864+ } else {
13865+ msg.messageLen = 0;
13866+ msg.message[0] = 0;
13867+ cpylen = offsetof(struct
13868+ nwc_get_bcast_notification,
13869+ message);
13870+ cpylen =
13871+ copy_to_user(pdata->repData, &msg,
13872+ sizeof(msg));
13873 }
13874- kfree(cmd);
13875+
13876+ kfree(reply);
13877 }
13878+ kfree(cmd);
13879 return (status);
13880 }
13881
13882-int NwdSetKeyValue(PXPLAT pdata, session_t Session)
13883+int novfs_set_key_value(struct novfs_xplat *pdata, struct novfs_schandle Session)
13884 {
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;
13895 char *str;
13896 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
13897
13898- cpylen = copy_from_user(&xplatCall, pdata->reqData, sizeof(NwcSetKey));
13899+ cpylen = copy_from_user(&xplatCall, pdata->reqData, sizeof(struct nwc_set_key));
13900 cpylen =
13901 copy_from_user(&cstrObjectName, xplatCall.pObjectName,
13902- sizeof(NwcString));
13903+ sizeof(struct nwc_string));
13904 cpylen =
13905 copy_from_user(&cstrPassword, xplatCall.pNewPassword,
13906- sizeof(NwcString));
13907+ sizeof(struct nwc_string));
13908
13909 datalen =
13910- sizeof(NwdCSetKey) + cstrObjectName.DataLen + cstrPassword.DataLen;
13911+ sizeof(struct nwd_set_key ) + cstrObjectName.DataLen + cstrPassword.DataLen;
13912
13913 cmdlen = sizeof(*cmd) + datalen;
13914- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
13915+ cmd = kmalloc(cmdlen, GFP_KERNEL);
13916
13917- if (cmd) {
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;
13924-
13925- pNewKey->ObjectType = xplatCall.ObjectType;
13926- pNewKey->AuthenticationId = xplatCall.AuthenticationId;
13927- pNewKey->ConnHandle = (HANDLE) (unsigned long) xplatCall.ConnHandle;
13928- str = (char *)pNewKey;
13929+ if (!cmd)
13930+ return -ENOMEM;
13931
13932- /*
13933- * Get the User Name
13934- */
13935- str += sizeof(NwdCSetKey);
13936- cpylen =
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;
13945
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;
13952
13953- /*
13954- * Get the Verify Password
13955- */
13956- cpylen =
13957- copy_from_user(str, cstrPassword.pBuffer,
13958- cstrPassword.DataLen);
13959+ /*
13960+ * Get the User Name
13961+ */
13962+ str += sizeof(struct nwd_set_key );
13963+ cpylen =
13964+ copy_from_user(str, cstrObjectName.pBuffer,
13965+ cstrObjectName.DataLen);
13966
13967- pNewKey->newPasswordLen = cstrPassword.DataLen;
13968- pNewKey->newPasswordOffset =
13969- pNewKey->objectNameOffset + pNewKey->objectNameLen;
13970-
13971- status =
13972- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13973- (void **)&reply, &replylen,
13974- INTERRUPTIBLE);
13975- if (reply) {
13976- status = reply->Reply.ErrorCode;
13977- kfree(reply);
13978- }
13979- memset(cmd, 0, cmdlen);
13980- kfree(cmd);
13981- }
13982+ str += pNewKey->objectNameLen = cstrObjectName.DataLen;
13983+ pNewKey->objectNameOffset = sizeof(struct nwd_set_key );
13984+
13985+ /*
13986+ * Get the Verify Password
13987+ */
13988+ cpylen =
13989+ copy_from_user(str, cstrPassword.pBuffer,
13990+ cstrPassword.DataLen);
13991
13992+ pNewKey->newPasswordLen = cstrPassword.DataLen;
13993+ pNewKey->newPasswordOffset =
13994+ pNewKey->objectNameOffset + pNewKey->objectNameLen;
13995+
13996+ status =
13997+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
13998+ (void **)&reply, &replylen,
13999+ INTERRUPTIBLE);
14000+ if (reply) {
14001+ status = reply->Reply.ErrorCode;
14002+ kfree(reply);
14003+ }
14004+ kfree(cmd);
14005 return (status);
14006 }
14007
14008-/*++======================================================================*/
14009-int NwdVerifyKeyValue(PXPLAT pdata, session_t Session)
14010-/*
14011- * Arguments:
14012- *
14013- * Returns:
14014- *
14015- * Abstract: Change the password on the server
14016- *
14017- * Notes:
14018- *
14019- * Environment:
14020- *
14021- *========================================================================*/
14022-{
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)
14029+{
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;
14035 char *str;
14036 unsigned long status = -ENOMEM, cmdlen, datalen, replylen, cpylen;
14037
14038 cpylen =
14039- copy_from_user(&xplatCall, pdata->reqData, sizeof(NwcVerifyKey));
14040+ copy_from_user(&xplatCall, pdata->reqData, sizeof(struct nwc_verify_key));
14041
14042 datalen =
14043- sizeof(NwdCVerifyKey) + xplatCall.pDomainName->DataLen +
14044+ sizeof(struct nwd_verify_key) + xplatCall.pDomainName->DataLen +
14045 xplatCall.pObjectName->DataLen + xplatCall.pVerifyPassword->DataLen;
14046
14047 cmdlen = sizeof(*cmd) + datalen;
14048- cmd = Novfs_Malloc(cmdlen, GFP_KERNEL);
14049+ cmd = (struct novfs_xplat_call_request *)kmalloc(cmdlen, GFP_KERNEL);
14050
14051- if (cmd) {
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;
14058-
14059- pNewKey->NameType = xplatCall.NameType;
14060- pNewKey->ObjectType = xplatCall.ObjectType;
14061- pNewKey->AuthType = xplatCall.AuthType;
14062- str = (char *)pNewKey;
14063+ if (!cmd)
14064+ return -ENOMEM;
14065
14066- /*
14067- * Get the tree name
14068- */
14069- str += sizeof(*pNewKey);
14070- cpylen =
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;
14082
14083- /*
14084- * Get the User Name
14085- */
14086- str += pNewKey->domainNameLen;
14087- cpylen =
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;
14098
14099- /*
14100- * Get the Verify Password
14101- */
14102- str += pNewKey->objectNameLen;
14103- cpylen =
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;
14110-
14111- status =
14112- Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
14113- (void **)&reply, &replylen,
14114- INTERRUPTIBLE);
14115- if (reply) {
14116- status = reply->Reply.ErrorCode;
14117- kfree(reply);
14118- }
14119- memset(cmd, 0, cmdlen);
14120- kfree(cmd);
14121- }
14122+ /*
14123+ * Get the tree name
14124+ */
14125+ str += sizeof(*pNewKey);
14126+ cpylen =
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;
14132+
14133+ /*
14134+ * Get the User Name
14135+ */
14136+ str += pNewKey->domainNameLen;
14137+ cpylen =
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;
14144+
14145+ /*
14146+ * Get the Verify Password
14147+ */
14148+ str += pNewKey->objectNameLen;
14149+ cpylen =
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;
14156
14157+ status =
14158+ Queue_Daemon_Command((void *)cmd, cmdlen, NULL, 0,
14159+ (void **)&reply, &replylen,
14160+ INTERRUPTIBLE);
14161+ if (reply) {
14162+ status = reply->Reply.ErrorCode;
14163+ kfree(reply);
14164+ }
14165+ kfree(cmd);
14166 return (status);
14167 }
14168--- a/fs/novfs/nwcapi.h
14169+++ b/fs/novfs/nwcapi.h
14170@@ -109,14 +109,14 @@
14171
14172 #define IOC_XPLAT 0x4a540002
14173
14174-typedef struct _XPLAT_ {
14175+struct novfs_xplat {
14176 int xfunction;
14177 unsigned long reqLen;
14178 void *reqData;
14179 unsigned long repLen;
14180 void *repData;
14181
14182-} XPLAT, *PXPLAT;
14183+};
14184
14185 #if 0
14186 N_EXTERN_LIBRARY(NWRCODE)
14187@@ -326,66 +326,30 @@ N_EXTERN_LIBRARY(NWRCODE)
14188
14189 //===[ Type definitions ]==================================================
14190
14191-//
14192-// Connection Handle returned from all OpenConnByXXXX calls
14193-//
14194-
14195-typedef u32 NW_CONN_HANDLE, *PNW_CONN_HANDLE;
14196-
14197-//
14198-// Authentication Id returned from the NwcCreateAuthenticationId call
14199-//
14200-
14201-typedef u32 AUTHEN_ID, *PAUTHEN_ID;
14202
14203 //
14204 // Structure for defining what a transport
14205 // address looks like
14206 //
14207
14208-typedef struct tagNwcTranAddr {
14209+struct nwc_tran_addr {
14210 u32 uTransportType;
14211 u32 uAddressLength;
14212 unsigned char *puAddress;
14213+};
14214
14215-} NwcTranAddr, *PNwcTranAddr;
14216-
14217-//
14218-// Structure for defining what a new transport
14219-// address looks like
14220-//
14221-
14222-typedef struct tagNwcTranAddrEx {
14223- u32 uTransportType;
14224- u32 uAddressLength;
14225- unsigned char buBuffer[MAX_ADDRESS_LENGTH];
14226-
14227-} NwcTranAddrEx, *PNwcTranAddrEx;
14228
14229-typedef struct tagNwcReferral {
14230- u32 uAddrCnt;
14231- PNwcTranAddrEx pAddrs;
14232-
14233-} NwcReferral, *PNwcReferral;
14234-
14235-typedef struct tagNwcServerVersion {
14236- u32 uMajorVersion;
14237- u16 uMinorVersion;
14238- u16 uRevision;
14239-
14240-} NwcServerVersion, *PNwcServerVersion;
14241-
14242-typedef struct tagNwcConnString {
14243+struct nwc_conn_string {
14244 char *pString;
14245 u32 uStringType;
14246 u32 uNameFormatType;
14247
14248-} NwcConnString, *PNwcConnString;
14249+};
14250
14251 //#if defined(NTYPES_H)
14252 //typedef NWCString NwcString, *PNwcString;
14253 //#else
14254-typedef struct tagNwcString {
14255+struct nwc_string {
14256 u32 DataType;
14257 u32 BuffSize;
14258 u32 DataLen;
14259@@ -393,36 +357,18 @@ typedef struct tagNwcString {
14260 u32 CodePage;
14261 u32 CountryCode;
14262
14263-} NwcString, *PNwcString;
14264+};
14265 //#endif
14266
14267 //
14268-// Structure used in NDS Resolve name
14269-//
14270-
14271-#define RESOLVE_INFO_SVC_V1_00 0x00FE0001
14272-
14273-typedef struct tagNwcResolveInfo {
14274- u32 uResolveInfoVersion;
14275- u32 luFlags;
14276- u32 luReqFlags;
14277- u32 luReqScope;
14278- u32 luResolveType;
14279- u32 luRepFlags;
14280- u32 luResolvedOffset;
14281- u32 luDerefNameLen;
14282- u16 *pDerefName;
14283-} NwcResolveInfo, *PNwcResolveInfo;
14284-
14285-//
14286 // Definition of a fragment for the Raw NCP requests
14287 //
14288
14289-typedef struct tagNwcFrag {
14290+struct nwc_frag {
14291 void *pData;
14292 u32 uLength;
14293
14294-} NwcFrag, *PNwcFrag;
14295+};
14296
14297 //
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
14303-
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;
14312- u32 uUserId;
14313- u32 ServerNameOffset;
14314- u32 uNdsState;
14315- u32 uMaxPacketSize;
14316- u32 uLicenseState;
14317- u32 uPublicState;
14318- u32 bcastState;
14319- u32 ServiceTypeOffset;
14320- u32 uDistance;
14321- u32 uAuthId;
14322- u32 uDisconnected;
14323- NwcServerVersion serverVersion;
14324- NwcTranAddrEx tranAddress;
14325- unsigned char buBuffer[NW_INFO_BUFFER_SIZE];
14326-
14327-} NwcConnInfo, *PNwcConnInfo;
14328-
14329-//
14330-// Get Browse Connection References
14331-//
14332-
14333-typedef struct _GetBrowseConnectionsRec {
14334-
14335- u32 recordSize;
14336- u32 numConnectionsReturned;
14337- u32 numConnectionsAvailable;
14338- u32 connReferences[1];
14339-
14340-} GetBrowseConnectionRec, *PGetBrowseConnectionRec;
14341-
14342-//++=======================================================================
14343-// API Name: NwcClearBroadcastMessage
14344-//
14345-// Arguments In: NONE
14346-//
14347-// Arguments Out: NONE
14348-//
14349-// Returns: STATUS_SUCCESS
14350-//
14351-// Abstract: This API is clears the broadcast message buffer.
14352-//
14353-// Notes:
14354-//
14355-// Environment: PASSIVE_LEVEL, LINUX
14356-//
14357-//=======================================================================--
14358-
14359 //++=======================================================================
14360 // API Name: NwcCloseConn
14361 //
14362@@ -514,10 +404,10 @@ typedef struct _GetBrowseConnectionsRec
14363 //
14364 //=======================================================================--
14365
14366-typedef struct tagNwcCloseConn {
14367- NW_CONN_HANDLE ConnHandle;
14368+struct nwc_close_conn {
14369+ u32 ConnHandle;
14370
14371-} NwcCloseConn, *PNwcCloseConn;
14372+};
14373
14374 //++=======================================================================
14375 // API Name: NwcConvertLocalFileHandle
14376@@ -548,11 +438,11 @@ typedef struct tagNwcCloseConn {
14377 //
14378 //=======================================================================--
14379
14380-typedef struct tagNwcConvertLocalHandle {
14381+struct nwc_convert_local_handle {
14382 u32 uConnReference;
14383 unsigned char NetWareHandle[6];
14384
14385-} NwcConvertLocalHandle, *PNwcConvertLocalHandle;
14386+};
14387
14388 //++=======================================================================
14389 // API Name: NwcConvertNetWareHandle
14390@@ -592,121 +482,13 @@ typedef struct tagNwcConvertLocalHandle
14391 // Environment: PASSIVE_LEVEL, LINUX
14392 //
14393 //=======================================================================--
14394-typedef struct tagNwcConvertNetWareHandle {
14395- NW_CONN_HANDLE ConnHandle;
14396+struct nwc_convert_netware_handle {
14397+ u32 ConnHandle;
14398 u32 uAccessMode;
14399 unsigned char NetWareHandle[6];
14400 u32 uFileSize;
14401-} NwcConvertNetWareHandle, *PNwcConvertNetWareHandle;
14402+};
14403
14404-//++=======================================================================
14405-// API Name: NwcFragmentRequest
14406-//
14407-// Arguments In: ConnHandle
14408-// The connection handle the request is being
14409-// directed to.
14410-//
14411-// uFunction
14412-// The NCP function to be called, should be 104
14413-// for NDS fragger/defragger requests.
14414-//
14415-// uSubFunction
14416-// The NCP subfunction to be called, should be
14417-// 2 for NDS fragger/defragger requests.
14418-//
14419-// uVerb
14420-// The actual operation to be completed on the
14421-// server backend.
14422-//
14423-// flags
14424-// Currently not implemented. Reserved for
14425-// future use.
14426-//
14427-// uNumRequestFrags
14428-// The number of fragments that the request packet
14429-// has been broken into.
14430-//
14431-// pRequestFrags
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.
14435-//
14436-// uNumReplyFrags
14437-// The number of fragments the reply packet has been
14438-// broken into.
14439-//
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.
14444-//
14445-// uActualReplyLength
14446-// Total size of the reply packet after any header
14447-// and tail information is removed.
14448-//
14449-// Returns: STATUS_SUCCESS
14450-// NWE_ACCESS_VIOLATION
14451-// NWE_CONN_INVALID
14452-//
14453-// Abstract: API for sending large NCP/NDS packets that are
14454-// larger than the max MTU size for the underlying
14455-// network.
14456-//
14457-// Notes:
14458-//
14459-// Environment: PASSIVE_LEVEL, LINUX
14460-//
14461-//=======================================================================--
14462-typedef struct tagNwcFragmentRequest {
14463- NW_CONN_HANDLE ConnHandle;
14464- u32 uFunction;
14465- u32 uSubFunction;
14466- u32 uVerb;
14467- u32 flags;
14468- u32 uNumRequestFrags;
14469- PNwcFrag pRequestFrags;
14470- u32 uNumReplyFrags;
14471- PNwcFrag pReplyFrags;
14472- u32 uActualReplyLength;
14473-} NwcFragmentRequest, *PNwcFragmentRequest;
14474-
14475-//++=======================================================================
14476-// API Name: NwcGetBroadcastMessage
14477-//
14478-// Arguments In: uMessageFlags - Not currently used.
14479-//
14480-// uConnReference - connection reference for
14481-// pending message.
14482-//
14483-// messageLen - length of message buffer.
14484-//
14485-// message - message buffer
14486-//
14487-// Arguments Out: messageLen - length of the message
14488-//
14489-// Returns: STATUS_SUCCESS
14490-// NWE_ACCESS_VIOLATION
14491-// NWE_NO_MORE_ENTRIES
14492-//
14493-// Abstract: This API is used for notifying a caller of pending
14494-// broadcast messages on the server.
14495-//
14496-// Notes:
14497-//
14498-// Environment: PASSIVE_LEVEL, LINUX
14499-//
14500-//=======================================================================--
14501-
14502-/* jlt
14503-typedef struct tagNwcGetBroadcastMessage
14504-{
14505- u32 uMessageFlags;
14506- u32 uConnReference;
14507- u32 messageLen;
14508- unsigned char message[255];
14509-
14510-} NwcGetBroadcastMessage, *PNwcGetBroadcastMessage;
14511-*/
14512
14513 //++=======================================================================
14514 // API Name: NwcGetConnInfo
14515@@ -746,13 +528,13 @@ typedef struct tagNwcGetBroadcastMess
14516 //
14517 //=======================================================================--
14518
14519-typedef struct tagNwcGetConnInfo {
14520- NW_CONN_HANDLE ConnHandle;
14521+struct nwc_get_conn_info {
14522+ u32 ConnHandle;
14523 u32 uInfoLevel;
14524 u32 uInfoLength;
14525 void *pConnInfo;
14526
14527-} NwcGetConnInfo, *PNwcGetConnInfo;
14528+};
14529
14530 //++=======================================================================
14531 // API Name: NwcGetDefaultNameContext
14532@@ -785,14 +567,14 @@ typedef struct tagNwcGetConnInfo {
14533 //
14534 //=======================================================================--
14535
14536-typedef struct tagNwcGetDefaultNameContext {
14537+struct nwc_get_def_name_ctx {
14538 u32 uTreeLength;
14539 unsigned char *pDsTreeName;
14540 u32 uNameLength;
14541 // unsigned short *pNameContext;
14542 unsigned char *pNameContext;
14543
14544-} NwcGetDefaultNameContext, *PNwcGetDefaultNameContext;
14545+};
14546
14547 //++=======================================================================
14548 // API Name: NwcGetTreeMonitoredConnReference
14549@@ -817,86 +599,12 @@ typedef struct tagNwcGetDefaultNameConte
14550 //
14551 //=======================================================================--
14552
14553-typedef struct tagNwcGetTreeMonitoredConnRef {
14554- PNwcString pTreeName;
14555+struct nwc_get_tree_monitored_conn_ref {
14556+ struct nwc_string *pTreeName;
14557 u32 uConnReference;
14558
14559-} NwcGetTreeMonitoredConnRef, *PNwcGetTreeMonitoredConnRef;
14560+};
14561
14562-//++=======================================================================
14563-// API Name: NwcGetNumberConns
14564-//
14565-// Arguments In: NONE
14566-//
14567-// Arguments Out: uMaxConns - The maximum number of connections
14568-// supported by the redirector. -1 for dynamic.
14569-//
14570-// uPublicConns - The current number of public
14571-// connections.
14572-//
14573-// uTasksPrivateConns - The current number of private
14574-// connections that are owned by the calling process.
14575-//
14576-// uOtherPrivateConns - The current number of private
14577-// connections that are not owned by the calling
14578-// process.
14579-//
14580-// Returns: STATUS_SUCCESS
14581-// NWE_ACCESS_VIOLATION
14582-// NWE_RESOURCE_LOCK
14583-//
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.
14589-//
14590-// Notes:
14591-//
14592-// Environment: PASSIVE_LEVEL, LINUX
14593-//
14594-//=======================================================================--
14595-
14596-typedef struct tagNwcGetNumberConns {
14597- u32 uMaxConns;
14598- u32 uPublicConns;
14599- u32 uTasksPrivateConns;
14600- u32 uOtherPrivateConns;
14601-
14602-} NwcGetNumberConns, *PNwcGetNumberConns;
14603-
14604-//++=======================================================================
14605-// API Name: NwcGetPreferredServer
14606-//
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.
14610-//
14611-// Arguments Out: pServerName - The buffer to copy the preferred server
14612-// name into.
14613-//
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
14620-//
14621-// Abstract: This API returns the configured preferred bindery
14622-// server previously set either by configuration or
14623-// by calling NwcSetPreferredServer.
14624-//
14625-// Notes:
14626-//
14627-// Environment: PASSIVE_LEVEL, LINUX
14628-//
14629-//=======================================================================--
14630-
14631-typedef struct tagNwcGetPreferredServer {
14632- u32 uServerNameLength;
14633- char *pServerName;
14634-
14635-} NwcGetPreferredServer, *PNwcGetPreferredServer;
14636
14637 //++=======================================================================
14638 // API Name: NwcGetPreferredDsTree
14639@@ -923,63 +631,10 @@ typedef struct tagNwcGetPreferredServer
14640 // Environment: PASSIVE_LEVEL, LINUX
14641 //
14642 //=======================================================================--
14643-typedef struct tagNwcGetPreferredDsTree {
14644+struct nwc_get_pref_ds_tree {
14645 u32 uTreeLength;
14646 unsigned char *pDsTreeName;
14647-} NwcGetPreferredDsTree, *PNwcGetPreferredDsTree;
14648-
14649-//++=======================================================================
14650-// API Name: NwcGetPrimaryConnection
14651-//
14652-// Arguments In: NONE
14653-//
14654-// Arguments Out: uConnReference - Reference to the primary connection.
14655-//
14656-// Returns: STATUS_SUCCESS
14657-// NWE_ACCESS_VIOLATION
14658-// NWE_CONN_PRIMARY_NOT_SET
14659-//
14660-// Abstract: This API returns the reference to the current primary
14661-// connection in the redirector.
14662-//
14663-// Notes:
14664-//
14665-// Environment: PASSIVE_LEVEL, LINUX
14666-//
14667-//=======================================================================--
14668-
14669-typedef struct tagNwcGetPrimaryConnection {
14670- u32 uConnReference;
14671-
14672-} NwcGetPrimaryConnection, *PNwcGetPrimaryConnection;
14673-
14674-//++=======================================================================
14675-// API Name: NwcGetRequesterVersion
14676-//
14677-// Arguments In: NONE
14678-//
14679-// Arguments Out: uMajorVersion
14680-// uMinorVersion
14681-// uRevision
14682-//
14683-// Returns: STATUS_SUCCESS
14684-// NWE_ACCESS_VIOLATION
14685-//
14686-// Abstract: This API returns the major version, minor version and
14687-// revision of the requester/redirector.
14688-//
14689-// Notes:
14690-//
14691-// Environment: PASSIVE_LEVEL, LINUX
14692-//
14693-//=======================================================================--
14694-
14695-typedef struct tagNwcGetRequesterVersion {
14696- u32 uMajorVersion;
14697- u32 uMinorVersion;
14698- u32 uRevision;
14699-
14700-} NwcGetRequesterVersion, *PNwcGetRequesterVersion;
14701+};
14702
14703 //++=======================================================================
14704 // API Name: NwcLicenseConn
14705@@ -1007,115 +662,10 @@ typedef struct tagNwcGetRequesterVersion
14706 //
14707 //=======================================================================--
14708
14709-typedef struct tagNwcLicenseConn {
14710- NW_CONN_HANDLE ConnHandle;
14711-
14712-} NwcLicenseConn, *PNwcLicenseConn;
14713-
14714-//++=======================================================================
14715-// API Name: NwcMakeConnPermanent
14716-//
14717-// Arguments In: ConnHandle - An open connection handle associated
14718-// with the connection to be made permanent.
14719-//
14720-// Arguments Out: NONE
14721-//
14722-// Returns: NWE_ACCESS_VIOLATION
14723-// NWE_CONN_INVALID
14724-// NWE_INVALID_OWNER
14725-//
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.
14731-//
14732-// Notes:
14733-//
14734-// Environment: PASSIVE_LEVEL, LINUX
14735-//
14736-//=======================================================================--
14737-
14738-typedef struct tagNwcMakeConnPermanent {
14739- NW_CONN_HANDLE ConnHandle;
14740-
14741-} NwcMakeConnPermanent, *PNwcMakeConnPermanent;
14742-
14743-//++=======================================================================
14744-// API Name: NwcMapDrive
14745-//
14746-// Arguments In: ConnHandle - The connection handle of the server
14747-// to where the drive is to be mapped.
14748-//
14749-// LocalUID - Local user ID
14750-//
14751-// LocalPathLen - Length of local/link directory path string,
14752-// including nul terminator.
14753-//
14754-// LocalPathOffset - Offset of local directory path that will
14755-// be mapped to NetWare directory path.
14756-//
14757-// NetWarePathLen - Offset of NetWare directory path,
14758-// including nul terminator.
14759-//
14760-// NetWarePathOffset - Offset of NetWare directory path in
14761-// structure.
14762-//
14763-// Arguments Out: NONE
14764-//
14765-// Returns: STATUS_SUCCESS
14766-// NWE_ACCESS_VIOLATION
14767-// NWE_CONN_INVALID
14768-// NWE_INSUFFICIENT_RESOURCES
14769-// NWE_STRING_TRANSLATION
14770-//
14771-// Abstract: This API maps the target drive to the specified
14772-// directory.
14773-//
14774-// Notes:
14775-//
14776-// Environment: PASSIVE_LEVEL, LINUX
14777-//
14778-//=======================================================================--
14779-
14780-typedef struct tagNwcMapDrive {
14781- NW_CONN_HANDLE ConnHandle;
14782- u32 LocalUID;
14783- u32 LinkPathLen;
14784- u32 LinkPathOffset;
14785- u32 DestPathLen;
14786- u32 DestPathOffset;
14787+struct nwc_license_conn {
14788+ u32 ConnHandle;
14789+};
14790
14791-} NwcMapDrive, *PNwcMapDrive;
14792-
14793-//++=======================================================================
14794-// API Name: NwcUnmapDrive
14795-//
14796-// Arguments In: LinkPathLen - Length of local/link path string,
14797-// including nul terminator.
14798-//
14799-// LinkPath - Local/link path in structure
14800-// to be unmapped
14801-//
14802-// Arguments Out: NONE
14803-//
14804-// Returns: STATUS_SUCCESS
14805-// NWE_ACCESS_VIOLATION
14806-// NWE_PARAM_INVALID
14807-//
14808-// Abstract: This API deletes a network drive mapping.
14809-//
14810-// Notes:
14811-//
14812-// Environment: PASSIVE_LEVEL, LINUX
14813-//
14814-//=======================================================================--
14815-
14816-typedef struct tagNwcUnmapDrive {
14817- u32 LinkPathLen;
14818- unsigned char LinkPath[1];
14819-
14820-} NwcUnmapDrive, *PNwcUnmapDrive;
14821
14822 //++=======================================================================
14823 // API Name: NWCGetMappedDrives
14824@@ -1136,26 +686,11 @@ typedef struct tagNwcUnmapDrive {
14825 //
14826 //=======================================================================--
14827
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;
14836-
14837-typedef struct tagNwcMapDriveBuff {
14838- u32 MapCount; // Number of mapped drives
14839- NwcMapDriveElem MapDriveElem[1]; // MapDriveElem[MapCount]
14840-
14841-} NwcMapDriveBuff, *PNwcMapDriveBuff;
14842-
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
14848
14849-} NwcGetMappedDrives, *PNwcGetMappedDrives;
14850+};
14851
14852 //++=======================================================================
14853 // API Name: NwcGetMountPath
14854@@ -1178,39 +713,11 @@ typedef struct tagNwcGetMappedDrives {
14855 //
14856 //=======================================================================--
14857
14858-typedef struct tagNwcGetMountPath {
14859+struct nwc_get_mount_path {
14860 u32 MountPathLen;
14861 unsigned char *pMountPath;
14862
14863-} NwcGetMountPath, *PNwcGetMountPath;
14864-
14865-//++=======================================================================
14866-// API Name: NwcMonitorConn
14867-//
14868-// Arguments In: ConnHandle - The handle associated with the connection
14869-// that is to be marked as the monitored connection.
14870-//
14871-// Arguments Out: NONE
14872-//
14873-// Returns: STATUS_SUCCESS
14874-// NWE_ACCESS_VIOLATION
14875-// NWE_RESOURCE_LOCK
14876-// NWE_CONN_INVALID
14877-//
14878-//
14879-// Abstract: This call marks the connection associated with the
14880-// connection handle as monitored.
14881-//
14882-// Notes:
14883-//
14884-// Environment: PASSIVE_LEVEL, LINUX
14885-//
14886-//=======================================================================--
14887-
14888-typedef struct tagNwcMonitorConn {
14889- NW_CONN_HANDLE ConnHandle;
14890-
14891-} NwcMonitorConn, *PNwcMonitorConn;
14892+};
14893
14894 //++=======================================================================
14895 // API Name: NwcOpenConnByAddr
14896@@ -1244,13 +751,13 @@ typedef struct tagNwcMonitorConn {
14897 //
14898 //=======================================================================--
14899
14900-typedef struct tagNwcOpenConnByAddr {
14901+struct nwc_open_conn_by_addr {
14902 char *pServiceType;
14903 u32 uConnFlags;
14904- PNwcTranAddr pTranAddr;
14905- NW_CONN_HANDLE ConnHandle;
14906+ struct nwc_tran_addr *pTranAddr;
14907+ u32 ConnHandle;
14908
14909-} NwcOpenConnByAddr, *PNwcOpenConnByAddr;
14910+};
14911
14912 //++=======================================================================
14913 // API Name: NwcOpenConnByName
14914@@ -1304,15 +811,15 @@ typedef struct tagNwcOpenConnByAddr {
14915 //
14916 //=======================================================================--
14917
14918-typedef struct tagNwcOpenConnByName {
14919- NW_CONN_HANDLE ConnHandle;
14920- PNwcConnString pName;
14921+struct nwc_open_conn_by_name {
14922+ u32 ConnHandle;
14923+ struct nwc_conn_string *pName;
14924 char *pServiceType;
14925 u32 uConnFlags;
14926 u32 uTranType;
14927- NW_CONN_HANDLE RetConnHandle;
14928+ u32 RetConnHandle;
14929
14930-} NwcOpenConnByName, *PNwcOpenConnByName;
14931+};
14932
14933 //++=======================================================================
14934 // API Name: NwcOpenConnByReference
14935@@ -1346,12 +853,12 @@ typedef struct tagNwcOpenConnByName {
14936 //
14937 //=======================================================================--
14938
14939-typedef struct tagNwcOpenConnByReference {
14940+struct nwc_open_conn_by_ref {
14941 u32 uConnReference;
14942 u32 uConnFlags;
14943- NW_CONN_HANDLE ConnHandle;
14944+ u32 ConnHandle;
14945
14946-} NwcOpenConnByReference, *PNwcOpenConnByReference;
14947+};
14948
14949 //++=======================================================================
14950 // API Name: NwcRawRequest
14951@@ -1390,55 +897,16 @@ typedef struct tagNwcOpenConnByReference
14952 //
14953 //=======================================================================--
14954
14955-typedef struct tagNwcRequest {
14956- NW_CONN_HANDLE ConnHandle;
14957+struct nwc_request {
14958+ u32 ConnHandle;
14959 u32 uFunction;
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;
14967
14968-} NwcRequest, *PNwcRequest;
14969-
14970-//++=======================================================================
14971-// API Name: NwcRawRequestAll
14972-//
14973-// Arguments In: uFunction - The NCP function that is being called.
14974-//
14975-// uNumRequestFrags - The number of fragments that the
14976-// request packet has been broken into.
14977-//
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.
14981-//
14982-// Arguments Out: NONE
14983-//
14984-// Returns: STATUS_SUCCESS
14985-// NWE_ACCESS_VIOLATION
14986-// NWE_CONN_INVALID
14987-//
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.
14995-//
14996-// Notes:
14997-//
14998-// Environment: PASSIVE_LEVEL, LINUX
14999-//
15000-//=======================================================================--
15001-
15002-typedef struct tagNwcRequestAll {
15003- u32 uFunction;
15004- u32 uNumRequestFrags;
15005- PNwcFrag pRequestFrags;
15006-
15007-} NwcRequestAll, *PNwcRequestAll;
15008+};
15009
15010 //++=======================================================================
15011 // API Name: NwcScanConnInfo
15012@@ -1544,7 +1012,7 @@ typedef struct tagNwcRequestAll {
15013 //
15014 //=======================================================================--
15015
15016-typedef struct tagNwcScanConnInfo {
15017+struct nwc_scan_conn_info {
15018 u32 uScanIndex;
15019 u32 uScanInfoLevel;
15020 u32 uScanInfoLen;
15021@@ -1555,7 +1023,7 @@ typedef struct tagNwcScanConnInfo {
15022 u32 uConnectionReference;
15023 void *pReturnConnInfo;
15024
15025-} NwcScanConnInfo, *PNwcScanConnInfo;
15026+};
15027
15028 //++=======================================================================
15029 // API Name: NwcSetConnInfo
15030@@ -1589,13 +1057,13 @@ typedef struct tagNwcScanConnInfo {
15031 //
15032 //=======================================================================--
15033
15034-typedef struct tagNwcSetConnInfo {
15035- NW_CONN_HANDLE ConnHandle;
15036+struct nwc_set_conn_info {
15037+ u32 ConnHandle;
15038 u32 uInfoLevel;
15039 u32 uInfoLength;
15040 void *pConnInfo;
15041
15042-} NwcSetConnInfo, *PNwcSetConnInfo;
15043+};
15044
15045 //++=======================================================================
15046 // API Name: NwcSetDefaultNameContext
15047@@ -1626,14 +1094,14 @@ typedef struct tagNwcSetConnInfo {
15048 //
15049 //=======================================================================--
15050
15051-typedef struct tagNwcSetDefaultNameContext {
15052+struct nwc_set_def_name_ctx {
15053 u32 uTreeLength;
15054 unsigned char *pDsTreeName;
15055 u32 uNameLength;
15056 // unsined short *pNameContext;
15057 unsigned char *pNameContext;
15058
15059-} NwcSetDefaultNameContext, *PNwcSetDefaultNameContext;
15060+};
15061
15062 //++=======================================================================
15063 // API Name: NwcSetPreferredDsTree
15064@@ -1658,41 +1126,11 @@ typedef struct tagNwcSetDefaultNameConte
15065 //
15066 //=======================================================================--
15067
15068-typedef struct tagNwcSetPreferredDsTree {
15069+struct nwc_set_pref_ds_tree {
15070 u32 uTreeLength;
15071 unsigned char *pDsTreeName;
15072
15073-} NwcSetPreferredDsTree, *PNwcSetPreferredDsTree;
15074-
15075-//++=======================================================================
15076-// API Name: NwcSetPreferredServer
15077-//
15078-// Arguments In: uServerNameLength - The length in bytes of the
15079-// preferred server string.
15080-//
15081-// pServerName - a pointer to an ASCIIZ string of the
15082-// preferred bindery server.
15083-//
15084-// Arguments Out: NONE
15085-//
15086-// Returns: STATUS_SUCCESS
15087-// NWE_ACCESS_VIOLATION
15088-// NWE_INSUFFICIENT_RESOURCES
15089-// NWE_RESOURCE_LOCK
15090-//
15091-// Abstract: This API sets the preferred server name.
15092-//
15093-// Notes:
15094-//
15095-// Environment: PASSIVE_LEVEL, LINUX
15096-//
15097-//=======================================================================--
15098-
15099-typedef struct tagNwcSetPreferredServer {
15100- u32 uServerNameLength;
15101- char *pServerName;
15102-
15103-} NwcSetPreferredServer, *PNwcSetPreferredServer;
15104+};
15105
15106 //++=======================================================================
15107 // API Name: NwcSetPrimaryConnection
15108@@ -1716,69 +1154,11 @@ typedef struct tagNwcSetPreferredServer
15109 //
15110 //=======================================================================--
15111
15112-typedef struct tagNwcSetPrimaryConnection {
15113- NW_CONN_HANDLE ConnHandle;
15114-
15115-} NwcSetPrimaryConnection, *PNwcSetPrimaryConnection;
15116-
15117-//++=======================================================================
15118-// API Name: NwcSysCloseConn
15119-//
15120-// Arguments In: ConnHandle - The handle to a connection that is
15121-// to be destroyed.
15122-//
15123-// Arguments Out: NONE
15124-//
15125-// Returns: STATUS_SUCCESS
15126-// NWE_ACCESS_VIOLATION
15127-// NWE_CONN_INVALID
15128-//
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.
15135-//
15136-// Notes:
15137-//
15138-// Environment: PASSIVE_LEVEL, LINUX
15139-//
15140-//=======================================================================--
15141-
15142-typedef struct tagNwcSysCloseConn {
15143- NW_CONN_HANDLE ConnHandle;
15144-
15145-} NwcSysCloseConn, *PNwcSysCloseConn;
15146-
15147-//++=======================================================================
15148-// API Name: NwcUnlicenseConn
15149-//
15150-// Arguments In: ConnHandle - Open connection handle that will be
15151-// accessing the connection in an unlicensed manner.
15152-//
15153-// Arguments Out: NONE
15154-//
15155-// Returns: STATUS_SUCCESS
15156-// NWE_ACCESS_VIOLATION
15157-// NWE_CONN_INVALID
15158-// NWE_HANDLE_ALREADY_UNLICENSED
15159-//
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.
15164-//
15165-// Notes:
15166-//
15167-// Environment: PASSIVE_LEVEL, LINUX
15168-//
15169-//=======================================================================--
15170+struct nwc_set_primary_conn {
15171+ u32 ConnHandle;
15172
15173-typedef struct tagNwcUnlicenseConn {
15174- NW_CONN_HANDLE ConnHandle;
15175+};
15176
15177-} NwcUnlicenseConn, *PNwcUnlicenseConn;
15178
15179 //++=======================================================================
15180 // API Name: NwcQueryFeature
15181@@ -1801,10 +1181,10 @@ typedef struct tagNwcUnlicenseConn {
15182 //
15183 //=======================================================================--
15184
15185-typedef struct tagNwcQueryFeature {
15186+struct nwc_query_feature {
15187 u32 Feature;
15188
15189-} NwcQueryFeature, *PNwcQueryFeature;
15190+};
15191
15192 //++=======================================================================
15193 // API Name: NWCChangePassword
15194@@ -1824,16 +1204,16 @@ typedef struct tagNwcQueryFeature {
15195 //
15196 //=======================================================================--
15197
15198-typedef struct tagNwcChangeKey {
15199- PNwcString pDomainName;
15200+struct nwc_change_key {
15201+ struct nwc_string *pDomainName;
15202 u32 AuthType;
15203- PNwcString pObjectName;
15204+ struct nwc_string *pObjectName;
15205 u32 NameType;
15206 u16 ObjectType;
15207- PNwcString pVerifyPassword;
15208- PNwcString pNewPassword;
15209+ struct nwc_string *pVerifyPassword;
15210+ struct nwc_string *pNewPassword;
15211
15212-} NwcChangeKey, *PNwcChangeKey;
15213+};
15214
15215 //++=======================================================================
15216 // API Name: NWCEnumerateIdentities `
15217@@ -1853,17 +1233,17 @@ typedef struct tagNwcChangeKey {
15218 //
15219 //=======================================================================--
15220
15221-typedef struct tagNwcEnumerateIdentities {
15222+struct nwc_enum_ids {
15223 u32 Iterator;
15224- PNwcString pDomainName;
15225+ struct nwc_string *pDomainName;
15226 u32 AuthType;
15227- PNwcString pObjectName;
15228+ struct nwc_string *pObjectName;
15229 u32 NameType;
15230 u16 ObjectType;
15231 u32 IdentityFlags;
15232- AUTHEN_ID AuthenticationId;
15233+ u32 AuthenticationId;
15234
15235-} NwcEnumerateIdentities, *PNwcEnumerateIdentities;
15236+};
15237
15238 //++=======================================================================
15239 // API Name: NWCGetIdentityInfo
15240@@ -1883,16 +1263,16 @@ typedef struct tagNwcEnumerateIdentities
15241 //
15242 //=======================================================================--
15243
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;
15250 u32 AuthType;
15251- PNwcString pObjectName;
15252+ struct nwc_string *pObjectName;
15253 u32 NameType;
15254 u16 ObjectType;
15255 u32 IdentityFlags;
15256
15257-} NwcGetIdentityInfo, *PNwcGetIdentityInfo;
15258+};
15259
15260 //++=======================================================================
15261 // API Name: NWCLoginIdentity
15262@@ -1912,41 +1292,18 @@ typedef struct tagNwcGetIdentityInfo {
15263 //
15264 //=======================================================================--
15265
15266-typedef struct tagNwcLoginIdentity {
15267- PNwcString pDomainName;
15268+struct nwc_login_id {
15269+ struct nwc_string *pDomainName;
15270 u32 AuthType;
15271- PNwcString pObjectName;
15272+ struct nwc_string *pObjectName;
15273 u32 NameType;
15274 u16 ObjectType;
15275 u32 IdentityFlags;
15276- PNwcString pPassword;
15277- AUTHEN_ID AuthenticationId;
15278-
15279-} NwcLoginIdentity, *PNwcLoginIdentity;
15280-
15281-//++=======================================================================
15282-// API Name: NWCLogoutIdentity
15283-////
15284-
15285-// Arguments In:
15286-//
15287-// Arguments Out:
15288-//
15289-// Returns: STATUS_SUCCESS
15290-// NWE_ACCESS_VIOLATION
15291-//
15292-// Abstract:
15293-//
15294-// Notes:
15295-//
15296-// Environment: PASSIVE_LEVEL, LINUX
15297-//
15298-//=======================================================================--
15299+ struct nwc_string *pPassword;
15300+ u32 AuthenticationId;
15301
15302-typedef struct tagNwcLogoutIdentity {
15303- AUTHEN_ID AuthenticationId;
15304+};
15305
15306-} NwcLogoutIdentity, *PNwcLogoutIdentity;
15307
15308 //++=======================================================================
15309 // API Name: NWCSetPassword
15310@@ -1966,14 +1323,14 @@ typedef struct tagNwcLogoutIdentity {
15311 //
15312 //=======================================================================--
15313
15314-typedef struct tagNwcSetKey {
15315- NW_CONN_HANDLE ConnHandle;
15316- AUTHEN_ID AuthenticationId;
15317- PNwcString pObjectName;
15318+struct nwc_set_key {
15319+ u32 ConnHandle;
15320+ u32 AuthenticationId;
15321+ struct nwc_string *pObjectName;
15322 u16 ObjectType;
15323- PNwcString pNewPassword;
15324+ struct nwc_string *pNewPassword;
15325
15326-} NwcSetKey, *PNwcSetKey;
15327+};
15328
15329 //++=======================================================================
15330 // API Name: NWCVerifyPassword
15331@@ -1993,15 +1350,15 @@ typedef struct tagNwcSetKey {
15332 //
15333 //++=======================================================================
15334
15335-typedef struct tagNwcVerifyKey {
15336- PNwcString pDomainName;
15337+struct nwc_verify_key {
15338+ struct nwc_string *pDomainName;
15339 u32 AuthType;
15340- PNwcString pObjectName;
15341+ struct nwc_string *pObjectName;
15342 u32 NameType;
15343 u16 ObjectType;
15344- PNwcString pVerifyPassword;
15345+ struct nwc_string *pVerifyPassword;
15346
15347-} NwcVerifyKey, *PNwcVerifyKey;
15348+};
15349
15350 //++=======================================================================
15351 // API Name: NwcAuthenticateWithId
15352@@ -2026,188 +1383,34 @@ typedef struct tagNwcVerifyKey {
15353 //
15354 //=======================================================================--
15355
15356-typedef struct tagNwcAuthenticateWithId {
15357- NW_CONN_HANDLE ConnHandle;
15358- AUTHEN_ID AuthenticationId;
15359-
15360-} NwcAuthenticateWithId, *PNwcAuthenticateWithId;
15361-
15362-//++=======================================================================
15363-// API Name: NwcUnauthenticate
15364-//
15365-// Arguments In: ConnHandle - The connection to unauthenticate.
15366-//
15367-// Arguments Out: NONE
15368-//
15369-// Returns: STATUS_SUCCESS
15370-// NWE_ACCESS_VIOLATION
15371-// NWE_CONN_INVALID
15372-// NWE_INVALID_OWNER
15373-// NWE_RESOURCE_LOCK
15374-//
15375-// Abstract: This API removes the authentication for the specified
15376-// connection.
15377-//
15378-// Notes:
15379-//
15380-// Environment: PASSIVE_LEVEL, LINUX
15381-//
15382-//=======================================================================--
15383-
15384-typedef struct tagNwcUnauthenticate {
15385- NW_CONN_HANDLE ConnHandle;
15386- AUTHEN_ID AuthenticationId;
15387-
15388-} NwcUnauthenticate, *PNwcUnauthenticate;
15389-
15390-//++=======================================================================
15391-// API Name: NwcGetCfgNameServiceProviders
15392-//
15393-// Arguments In:
15394-//
15395-// Arguments Out:
15396-//
15397-// Returns: STATUS_SUCCESS
15398-// NWE_ACCESS_VIOLATION
15399-//
15400-// Abstract:
15401-//
15402-// Notes:
15403-//
15404-// Environment: PASSIVE_LEVEL, LINUX
15405-//
15406-//=======================================================================--
15407-
15408-typedef struct {
15409- u32 providerCount;
15410- u32 providers[MAX_NAME_SERVICE_PROVIDERS];
15411-
15412-} NwcGetCfgNameServiceProviders, *PNwcGetCfgNameServiceProviders;
15413-
15414-//++=======================================================================
15415-// API Name: NwcNdsResolveNameToId
15416-//
15417-// Arguments In: connHandle
15418-// Specifies connection to use to resolve name with.
15419-//
15420-// pName
15421-// Points to the name of the NDS entry to resolve.
15422-//
15423-// uReqTranType
15424-// Specifies the preferred or required transport to
15425-// be used.
15426-//
15427-// pResolveInfo
15428-// Points to the NwcNdsResolveInfo structure
15429-// containing information on how the entry is to be
15430-// resolved.
15431-//
15432-// Arguments Out: pResolveInfo
15433-// Points to the NwcNdsResolveInfo structure
15434-// containing return information on the resolved
15435-// entry.
15436-//
15437-// pluEntryId
15438-// Points to the resolved name's entry ID.
15439-//
15440-// pReferral
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.
15444-//
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,
15451-// Nds error code
15452-//
15453-// Abstract: This API resolves a NDS entry name.
15454-//
15455-// Notes:
15456-//
15457-// Environment: PASSIVE_LEVEL, LINUX
15458-//
15459-//=======================================================================--
15460-
15461-typedef struct tagNwcNdsResolveNameToId {
15462- NW_CONN_HANDLE connHandle;
15463- PNwcString pName;
15464- u32 uReqTranType;
15465- PNwcResolveInfo pResolveInfo;
15466- u32 entryId;
15467- PNwcReferral pReferral;
15468-
15469-} NwcNdsResolveNameToId, *PNwcNdsResolveNameToId;
15470-
15471-//++=======================================================================
15472-// API Name: NwcOrderedRequest
15473-//
15474-// Arguments In: uFunction - The NCP function that is being called.
15475-//
15476-// uNumRequestFrags - The number of fragments that the
15477-// request packet has been broken into.
15478-//
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.
15482-//
15483-// uInverseReqCode - The NCP function that will be called
15484-// if the request fails.
15485-//
15486-// uNumInverseFrags - The number of fragments the inverse
15487-// request packet has been broken into.
15488-//
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.
15492-//
15493-// Returns: STATUS_SUCCESS
15494-// NWE_ACCESS_VIOLATION
15495-// NWE_CONN_INVALID
15496-//
15497-// Abstract: API for sending raw NCP packets directly to a server.
15498-//
15499-// Notes:
15500-//
15501-// Environment: PASSIVE_LEVEL, LINUX
15502-//
15503-//=======================================================================--
15504+struct nwc_auth_with_id {
15505+ u32 ConnHandle;
15506+ u32 AuthenticationId;
15507
15508-typedef struct tagNwcOrderedRequest {
15509- u32 uReqCode;
15510- u32 uNumRequestFrags;
15511- PNwcFrag pRequestFrags;
15512- u32 uInverseReqCode;
15513- u32 uNumInverseFrags;
15514- PNwcFrag pInverseFrags;
15515+};
15516
15517-} NwcOrderedRequest, *PNwcOrderedRequest;
15518
15519-#if 1 //sgled
15520-typedef struct tagNwcUnmapDriveEx {
15521+struct nwc_unmap_drive_ex {
15522 // unsigned long connHdl;
15523 unsigned int linkLen;
15524 char linkData[1];
15525
15526-} NwcUnmapDriveEx, *PNwcUnmapDriveEx;
15527+};
15528
15529-typedef struct tagNwcMapDriveEx {
15530- NW_CONN_HANDLE ConnHandle;
15531+struct nwc_map_drive_ex {
15532+ u32 ConnHandle;
15533 unsigned int localUid;
15534 unsigned int linkOffsetLength;
15535 unsigned int linkOffset;
15536 unsigned int dirPathOffsetLength;
15537 unsigned int dirPathOffset;
15538-} NwcMapDriveEx, *PNwcMapDriveEx;
15539+};
15540
15541-typedef struct tagNwcGetBroadcastNotification {
15542+struct nwc_get_bcast_notification {
15543 u32 uMessageFlags;
15544 u32 uConnReference;
15545 u32 messageLen;
15546 char message[1];
15547-} NwcGetBroadcastNotification, *PNwcGetBroadcastNotification;
15548+};
15549
15550-#endif
15551 #endif /* __NWCLNX_H__ */
15552--- a/fs/novfs/proc.c
15553+++ b/fs/novfs/proc.c
15554@@ -20,13 +20,13 @@
15555
15556 #include "vfs.h"
15557
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;
15566
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;
15571
15572 /*===[ Code ]=============================================================*/
15573
15574@@ -39,17 +39,17 @@ static int Novfs_Get_Version(char *page,
15575 buf = page + off;
15576 *start = buf;
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);
15582 }
15583
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)) {
15589 len +=
15590 sprintf(buf + len, "Novfs mount=%s\n",
15591- Novfs_CurrentMount);
15592+ novfs_current_mnt);
15593 }
15594 }
15595 DbgPrint("Novfs_Get_Version:\n%s\n", buf);
15596@@ -58,39 +58,40 @@ static int Novfs_Get_Version(char *page,
15597 return (len);
15598 }
15599
15600-int Init_Procfs_Interface(void)
15601+int novfs_proc_init(void)
15602 {
15603 int retCode = 0;
15604
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;
15611
15612- Novfs_Control = create_proc_entry("Control", 0600, Novfs_Procfs_dir);
15613+ Novfs_Control = create_proc_entry("Control", 0600, novfs_procfs_dir);
15614
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));
15623
15624 /*
15625 * Setup our functions
15626 */
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;
15639
15640- Novfs_Control->proc_fops = &Daemon_proc_fops;
15641+ Novfs_Control->proc_fops = &novfs_daemon_proc_fops;
15642 } else {
15643 remove_proc_entry(MODULE_NAME, NULL);
15644 return (-ENOENT);
15645 }
15646
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)
15653 /*
15654 * Setup our file functions
15655 */
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;
15675 } else {
15676- remove_proc_entry("Control", Novfs_Procfs_dir);
15677+ remove_proc_entry("Control", novfs_procfs_dir);
15678 remove_proc_entry(MODULE_NAME, NULL);
15679 return (-ENOENT);
15680 }
15681
15682 Novfs_Version =
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;
15689 } else {
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);
15695 retCode = -ENOENT;
15696 }
15697@@ -132,17 +133,17 @@ int Init_Procfs_Interface(void)
15698 return (retCode);
15699 }
15700
15701-void Uninit_Procfs_Interface(void)
15702+void novfs_proc_exit(void)
15703 {
15704
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);
15708
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);
15712
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);
15716
15717 DbgPrint("Uninit_Procfs_Interface remove_proc_entry(%s, NULL)\n",
15718 MODULE_NAME);
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>
15728+
15729 #include <linux/profile.h>
15730 #include <linux/notifier.h>
15731-#include <asm/uaccess.h>
15732
15733 #include "vfs.h"
15734
15735@@ -41,10 +42,10 @@ struct local_rtc_time {
15736 int tm_isdst;
15737 };
15738
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;
15747
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)
15752 {
15753 ssize_t retval = nbytes;
15754- unsigned char *lbuf;
15755- unsigned char *p;
15756+ u_char *lbuf, *p;
15757 int i;
15758+ u_long cpylen;
15759
15760 lbuf = kmalloc(nbytes + 1, GFP_KERNEL);
15761 if (lbuf) {
15762- if (copy_from_user(lbuf, buf, nbytes))
15763- return -EFAULT;
15764+ cpylen = copy_from_user(lbuf, buf, nbytes);
15765
15766 lbuf[nbytes] = 0;
15767 DbgPrint("User_proc_write_DbgBuffer: %s\n", lbuf);
15768
15769- for (i = 0; lbuf[i] && lbuf[i] != '\n'; i++)
15770- ;
15771+ for (i = 0; lbuf[i] && lbuf[i] != '\n'; i++) ;
15772
15773- if ('\n' == lbuf[i])
15774+ if ('\n' == lbuf[i]) {
15775 lbuf[i] = '\0';
15776+ }
15777
15778 if (!strcmp("on", lbuf)) {
15779 DbgPrintBufferOffset = DbgPrintBufferReadOffset = 0;
15780@@ -99,15 +99,15 @@ static ssize_t User_proc_write_DbgBuffer
15781 DbgSyslogOn = 0;
15782 }
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)) {
15792- PageCache = 1;
15793+ novfs_page_cache = 1;
15794 } else if (!strcmp("off", p)) {
15795- PageCache = 0;
15796+ novfs_page_cache = 0;
15797 }
15798 } else if (!strcmp("profile", lbuf)) {
15799 if (!strcmp("on", p)) {
15800@@ -123,7 +123,7 @@ static ssize_t User_proc_write_DbgBuffer
15801 return (retval);
15802 }
15803
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)
15806 {
15807 ssize_t retval = 0;
15808 size_t count;
15809@@ -273,7 +273,7 @@ static void doline(unsigned char *b, uns
15810 }
15811 }
15812
15813-void mydump(int size, void *dumpptr)
15814+void novfs_dump(int size, void *dumpptr)
15815 {
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] = {
15819 /*
15820 * This only works for the Gregorian calendar - i.e. after 1752 (in the UK)
15821 */
15822-static void Novfs_GregorianDay(struct local_rtc_time *tm)
15823+static void GregorianDay(struct local_rtc_time *tm)
15824 {
15825 int leapsToDate;
15826 int lastYear;
15827@@ -384,14 +384,17 @@ static void private_to_tm(int tim, struc
15828 /*
15829 * Determine the day of week
15830 */
15831- Novfs_GregorianDay(tm);
15832+ GregorianDay(tm);
15833 }
15834
15835 char *ctime_r(time_t * clock, char *buf)
15836 {
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" };
15845
15846 private_to_tm(*clock, &tm);
15847
15848@@ -401,7 +404,7 @@ char *ctime_r(time_t * clock, char *buf)
15849 return (buf);
15850 }
15851
15852-static void profile_dump_dt(struct dentry *parent, void *pf)
15853+static void dump(struct dentry *parent, void *pf)
15854 {
15855 void (*pfunc) (char *Fmt, ...) = pf;
15856 struct l {
15857@@ -413,9 +416,11 @@ static void profile_dump_dt(struct dentr
15858 char *buf, *path, *sd;
15859 char inode_number[16];
15860
15861- buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
15862- if (!buf)
15863+ buf = (char *)kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
15864+
15865+ if (NULL == buf) {
15866 return;
15867+ }
15868
15869 if (parent) {
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,
15875- D_CHILD);
15876+ d_u.d_child);
15877 p = p->next;
15878
15879- if (d->d_subdirs.next != &d->d_subdirs) {
15880- n = kmalloc(sizeof(*n), GFP_KERNEL);
15881+ if (d->d_subdirs.next !=
15882+ &d->d_subdirs) {
15883+ n = kmalloc(sizeof
15884+ (*n),
15885+ GFP_KERNEL);
15886 if (n) {
15887- n->next = l->next;
15888+ n->next =
15889+ l->next;
15890 l->next = n;
15891 n->dentry = d;
15892 }
15893 } else {
15894- path = Scope_dget_path(d, buf, PATH_LENGTH_BUFFER, 1);
15895+ path = novfs_scope_dget_path(d, buf, PATH_LENGTH_BUFFER, 1);
15896 if (path) {
15897- pfunc("1-0x%p %s\n"
15898+ pfunc
15899+ ("1-0x%p %s\n"
15900 " d_name: %.*s\n"
15901 " d_parent: 0x%p\n"
15902 " d_count: %d\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",
15906 d, path,
15907- d->d_name.len,
15908- d->d_name.name,
15909- d->d_parent,
15910- atomic_read(&d->d_count),
15911+ d->d_name.
15912+ len,
15913+ d->d_name.
15914+ name,
15915+ d->
15916+ d_parent,
15917+ atomic_read
15918+ (&d->
15919+ d_count),
15920 d->d_flags,
15921- d->d_subdirs.
15922+ d->
15923+ d_subdirs.
15924 next,
15925- d->d_inode);
15926+ d->
15927+ d_inode);
15928 }
15929 }
15930 }
15931@@ -469,11 +486,16 @@ static void profile_dump_dt(struct dentr
15932 l = start;
15933 while (l) {
15934 d = l->dentry;
15935- path = Scope_dget_path(d, buf, PATH_LENGTH_BUFFER, 1);
15936+ path =
15937+ novfs_scope_dget_path(d, buf,
15938+ PATH_LENGTH_BUFFER,
15939+ 1);
15940 if (path) {
15941 sd = " (None)";
15942- if (&d->d_subdirs != d->d_subdirs.next)
15943+ if (&d->d_subdirs !=
15944+ d->d_subdirs.next) {
15945 sd = "";
15946+ }
15947 inode_number[0] = '\0';
15948 if (d->d_inode) {
15949 sprintf(inode_number,
15950@@ -506,7 +528,7 @@ static void profile_dump_dt(struct dentr
15951
15952 }
15953
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)
15956 {
15957 ssize_t retval = 0;
15958 size_t count;
15959@@ -530,7 +552,8 @@ static ssize_t profile_common_read(char
15960
15961 }
15962
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,
15965+ loff_t * off)
15966 {
15967 ssize_t retval = 0;
15968 unsigned long offset = *off;
15969@@ -542,10 +565,11 @@ static ssize_t profile_inode_read(struct
15970 DbgPrintOn = 0;
15971
15972 DbgPrintBufferOffset = DbgPrintBufferReadOffset = 0;
15973- Novfs_dump_inode(LocalPrint);
15974+ novfs_dump_inode(LocalPrint);
15975 }
15976
15977- retval = profile_common_read(buf, len, off);
15978+
15979+ retval = common_read(buf, len, off);
15980
15981 if (0 == retval) {
15982 DbgPrintOn = save_DbgPrintOn;
15983@@ -558,7 +582,8 @@ static ssize_t profile_inode_read(struct
15984
15985 }
15986
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,
15989+ loff_t * off)
15990 {
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;
15995 DbgPrintOn = 0;
15996 DbgPrintBufferOffset = DbgPrintBufferReadOffset = 0;
15997- profile_dump_dt(Novfs_root, LocalPrint);
15998+ dump(novfs_root, LocalPrint);
15999 }
16000
16001- retval = profile_common_read(buf, len, off);
16002+ retval = common_read(buf, len, off);
16003
16004 if (0 == retval) {
16005 DbgPrintBufferOffset = DbgPrintBufferReadOffset = 0;
16006@@ -585,7 +610,7 @@ static ssize_t profile_dentry_read(struc
16007
16008 }
16009
16010-uint64_t get_nanosecond_time(void)
16011+uint64_t get_nanosecond_time()
16012 {
16013 struct timespec ts;
16014 uint64_t retVal;
16015@@ -599,15 +624,12 @@ uint64_t get_nanosecond_time(void)
16016 return (retVal);
16017 }
16018
16019-int init_profile(void)
16020+void novfs_profile_init()
16021 {
16022- int retCode = 0;
16023-
16024- if (Novfs_Procfs_dir) {
16025- dbg_dir = Novfs_Procfs_dir;
16026- } else {
16027+ if (novfs_procfs_dir)
16028+ dbg_dir = novfs_procfs_dir;
16029+ else
16030 dbg_dir = proc_mkdir(MODULE_NAME, NULL);
16031- }
16032
16033 if (dbg_dir) {
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;
16046 } else {
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;
16056 }
16057
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;
16065 }
16066+
16067 } else {
16068 vfree(DbgPrintBuffer);
16069 DbgPrintBuffer = NULL;
16070 }
16071 }
16072- return (retCode);
16073 }
16074
16075-void uninit_profile(void)
16076+void novfs_profile_exit(void)
16077 {
16078- if (dbg_file) {
16079- DbgPrint("Calling remove_proc_entry(Debug, NULL)\n");
16080- remove_proc_entry("Debug", dbg_dir);
16081- }
16082- if (inode_file) {
16083- DbgPrint("Calling remove_proc_entry(inode, NULL)\n");
16084- remove_proc_entry("inode", dbg_dir);
16085- }
16086- if (dentry_file) {
16087- DbgPrint("Calling remove_proc_entry(dentry, NULL)\n");
16088- remove_proc_entry("dentry", dbg_dir);
16089- }
16090- if (dbg_dir && (dbg_dir != Novfs_Procfs_dir)) {
16091+ if (dbg_file)
16092+ DbgPrint("Calling remove_proc_entry(Debug, NULL)\n"),
16093+ remove_proc_entry("Debug", dbg_dir);
16094+ if (inode_file)
16095+ DbgPrint("Calling remove_proc_entry(inode, NULL)\n"),
16096+ remove_proc_entry("inode", dbg_dir);
16097+ if (dentry_file)
16098+ DbgPrint("Calling remove_proc_entry(dentry, NULL)\n"),
16099+ remove_proc_entry("dentry", dbg_dir);
16100+
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);
16104 }
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
16110
16111-struct scope_list {
16112- struct list_head entry;
16113- struct schandle ScopeId;
16114- struct schandle SessionId;
16115- pid_t ScopePid;
16116- struct task_struct *ScopeTask;
16117- unsigned int ScopeHash;
16118- uid_t ScopeUid;
16119- u64 ScopeUSize;
16120- u64 ScopeUFree;
16121- u64 ScopeUTEnties;
16122- u64 ScopeUAEnties;
16123- int ScopeUserNameLength;
16124- unsigned char ScopeUserName[MAX_USERNAME_LENGTH];
16125-};
16126
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;
16134
16135-static struct scope_list *Scope_Search4Scope(struct schandle *Id, bool Session,
16136- bool Locked)
16137+static struct novfs_scope_list *Scope_Search4Scope(struct novfs_schandle Id,
16138+ int Session, int Locked)
16139 {
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;
16146 int offset;
16147
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);
16152
16153 if (Session)
16154- offset = offsetof(struct scope_list, SessionId);
16155+ offset = offsetof(struct novfs_scope_list, SessionId);
16156 else
16157- offset = offsetof(struct scope_list, ScopeId);
16158+ offset = offsetof(struct novfs_scope_list, ScopeId);
16159
16160- if (!Locked)
16161+ if (!Locked) {
16162 down(&Scope_Lock);
16163+ }
16164
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);
16170
16171- cur_scope = (session_t *) ((char *)scope + offset);
16172+ cur_scope = *(struct novfs_schandle *) ((char *)scope + offset);
16173 if (SC_EQUAL(Id, cur_scope)) {
16174 rscope = scope;
16175 break;
16176@@ -90,19 +75,19 @@ static struct scope_list *Scope_Search4S
16177 sl = sl->next;
16178 }
16179
16180- if (!Locked)
16181+ if (!Locked) {
16182 up(&Scope_Lock);
16183+ }
16184
16185 DbgPrint("Scope_Search4Scope: return 0x%p\n", rscope);
16186- return rscope;
16187+ return (rscope);
16188 }
16189
16190-static struct scope_list *Scope_Find_Scope(bool Create)
16191+static struct novfs_scope_list *Scope_Find_Scope(int Create)
16192 {
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;
16199 int addscope = 0;
16200
16201 task = current;
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);
16205
16206- /* scopeId = task->euid; */
16207+ //scopeId = task->euid;
16208 UID_TO_SCHANDLE(scopeId, task->euid);
16209
16210- scope = Scope_Search4Scope(&scopeId, 0, 0);
16211- if (scope || (!Create))
16212- return scope;
16213+ scope = Scope_Search4Scope(scopeId, 0, 0);
16214
16215- scope = kmalloc(sizeof(*pscope), GFP_KERNEL);
16216- if (!scope)
16217- return NULL;
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';
16225-
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);
16234- addscope = 1;
16235- }
16236-
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",
16247- scope,
16248- scope->ScopeId.hTypeId, scope->ScopeId.hId,
16249- scope->SessionId.hTypeId, scope->SessionId.hId,
16250- scope->ScopePid,
16251- scope->ScopeTask,
16252- scope->ScopeHash,
16253- scope->ScopeUid,
16254- scope->ScopeUserNameLength,
16255- scope->ScopeUserName);
16256+ if (!scope && Create) {
16257+ scope = kmalloc(sizeof(*pscope), GFP_KERNEL);
16258+ if (scope) {
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';
16266+
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,
16270+ task->fsuid);
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);
16279+ addscope = 1;
16280+ }
16281
16282- if (SC_PRESENT(scope->SessionId)) {
16283- down(&Scope_Lock);
16284- pscope = Scope_Search4Scope(&scopeId, 0, 1);
16285- if (!pscope)
16286- list_add(&scope->entry, &Scope_List);
16287- up(&Scope_Lock);
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",
16298+ scope,
16299+ scope->ScopeId.hTypeId, scope->ScopeId.hId,
16300+ scope->SessionId.hTypeId, scope->SessionId.hId,
16301+ scope->ScopePid,
16302+ scope->ScopeTask,
16303+ scope->ScopeHash,
16304+ scope->ScopeUid,
16305+ scope->ScopeUserNameLength,
16306+ scope->ScopeUserName);
16307+
16308+ if (SC_PRESENT(scope->SessionId)) {
16309+ down(&Scope_Lock);
16310+ pscope =
16311+ Scope_Search4Scope(scopeId, 0, 1);
16312+
16313+ if (!pscope) {
16314+ list_add(&scope->ScopeList,
16315+ &Scope_List);
16316+ }
16317+ up(&Scope_Lock);
16318
16319- if (pscope) {
16320- printk(KERN_ERR "Scope_Find_Scope scope not added "
16321- "because it was already there...\n");
16322- Daemon_DestroySessionId(&scope->SessionId);
16323- kfree(scope);
16324- scope = pscope;
16325- addscope = 0;
16326+ if (pscope) {
16327+ printk
16328+ ("<6>Scope_Find_Scope scope not added because it was already there...\n");
16329+ novfs_daemon_destroy_sessionId(scope->
16330+ SessionId);
16331+ kfree(scope);
16332+ scope = pscope;
16333+ addscope = 0;
16334+ }
16335+ } else {
16336+ kfree(scope);
16337+ scope = NULL;
16338+ }
16339 }
16340- } else {
16341- kfree(scope);
16342- scope = NULL;
16343- }
16344
16345- if (addscope)
16346- Novfs_Add_to_Root(scope->ScopeUserName);
16347+ if (addscope) {
16348+ novfs_add_to_root(scope->ScopeUserName);
16349+ }
16350+ }
16351
16352- return scope;
16353+ return (scope);
16354 }
16355
16356-static int Scope_Validate_Scope(struct scope_list *Scope)
16357+static int Scope_Validate_Scope(struct novfs_scope_list *Scope)
16358 {
16359- struct scope_list *s;
16360+ struct novfs_scope_list *s;
16361 struct list_head *sl;
16362 int retVal = 0;
16363
16364@@ -197,7 +192,7 @@ static int Scope_Validate_Scope(struct s
16365
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);
16370
16371 if (s == Scope) {
16372 retVal = 1;
16373@@ -209,28 +204,24 @@ static int Scope_Validate_Scope(struct s
16374
16375 up(&Scope_Lock);
16376
16377- return retVal;
16378+ return (retVal);
16379 }
16380
16381-/* FIXME void stuff */
16382-uid_t Scope_Get_Uid(void *foo)
16383+uid_t novfs_scope_get_uid(struct novfs_scope_list *scope)
16384 {
16385- struct scope_list *scope = foo;
16386 uid_t uid = 0;
16387-
16388 if (!scope)
16389 scope = Scope_Find_Scope(1);
16390
16391 if (scope && Scope_Validate_Scope(scope))
16392 uid = scope->ScopeUid;
16393-
16394 return uid;
16395 }
16396
16397-char *Scope_Get_UserName(void)
16398+char *novfs_scope_get_username(void)
16399 {
16400 char *name = NULL;
16401- struct scope_list *Scope;
16402+ struct novfs_scope_list *Scope;
16403
16404 Scope = Scope_Find_Scope(1);
16405
16406@@ -240,12 +231,10 @@ char *Scope_Get_UserName(void)
16407 return name;
16408 }
16409
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
16413+ *Scope)
16414 {
16415- session_t sessionId;
16416- struct scope_list *Scope = foo;
16417-
16418+ struct novfs_schandle sessionId;
16419 DbgPrint("Scope_Get_SessionId: 0x%p\n", Scope);
16420 SC_INITIALIZE(sessionId);
16421 if (!Scope)
16422@@ -253,43 +242,43 @@ session_t Scope_Get_SessionId(void *foo)
16423
16424 if (Scope && Scope_Validate_Scope(Scope))
16425 sessionId = Scope->SessionId;
16426-
16427 DbgPrint("Scope_Get_SessionId: return 0x%p:%p\n", sessionId.hTypeId,
16428 sessionId.hId);
16429- return sessionId;
16430+ return (sessionId);
16431 }
16432
16433-struct scope_list *Scope_Get_ScopefromName(struct qstr *name)
16434+struct novfs_scope_list *novfs_get_scope_from_name(struct qstr * Name)
16435 {
16436- struct scope_list *scope;
16437- struct scope_list *rscope = NULL;
16438+ struct novfs_scope_list *scope, *rscope = NULL;
16439 struct list_head *sl;
16440
16441- DbgPrint("Scope_Get_ScopefromName: %.*s\n", name->len, name->name);
16442+ DbgPrint("Scope_Get_ScopefromName: %.*s\n", Name->len, Name->name);
16443
16444 down(&Scope_Lock);
16445
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);
16450
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)))
16455+ {
16456 rscope = scope;
16457 break;
16458 }
16459+
16460 sl = sl->next;
16461 }
16462
16463 up(&Scope_Lock);
16464
16465- return rscope;
16466+ return (rscope);
16467 }
16468
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)
16473 {
16474- struct scope_list *scope;
16475+ struct novfs_scope_list *scope;
16476 int retVal = 0;
16477
16478 scope = Scope_Find_Scope(1);
16479@@ -305,24 +294,24 @@ int Scope_Set_UserSpace(u64 *TotalSize,
16480 scope->ScopeUAEnties = *FreeEnties;
16481 }
16482
16483- return retVal;
16484+ return (retVal);
16485 }
16486
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)
16491 {
16492- struct scope_list *scope;
16493+ struct novfs_scope_list *scope;
16494 int retVal = 0;
16495
16496- u64 td, fd, te, fe;
16497+ uint64_t td, fd, te, fe;
16498
16499 scope = Scope_Find_Scope(1);
16500
16501 td = fd = te = fe = 0;
16502 if (scope) {
16503
16504- retVal = Daemon_Get_UserSpace(&scope->SessionId,
16505- &td, &fd, &te, &fe);
16506+ retVal =
16507+ novfs_daemon_get_userspace(scope->SessionId, &td, &fd, &te, &fe);
16508
16509 scope->ScopeUSize = td;
16510 scope->ScopeUFree = fd;
16511@@ -339,18 +328,18 @@ int Scope_Get_UserSpace(u64 *TotalSize,
16512 if (FreeEnties)
16513 *FreeEnties = fe;
16514
16515- return retVal;
16516+ return (retVal);
16517 }
16518
16519-struct scope_list *Scope_Get_ScopefromPath(struct dentry *dentry)
16520+struct novfs_scope_list *novfs_get_scope(struct dentry * Dentry)
16521 {
16522- struct scope_list *scope = NULL;
16523+ struct novfs_scope_list *scope = NULL;
16524 char *buf, *path, *cp;
16525 struct qstr name;
16526
16527- buf = kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
16528+ buf = (char *)kmalloc(PATH_LENGTH_BUFFER, GFP_KERNEL);
16529 if (buf) {
16530- path = Scope_dget_path(dentry, buf, PATH_LENGTH_BUFFER, 0);
16531+ path = novfs_scope_dget_path(Dentry, buf, PATH_LENGTH_BUFFER, 0);
16532 if (path) {
16533 DbgPrint("Scope_Get_ScopefromPath: %s\n", path);
16534
16535@@ -366,29 +355,30 @@ struct scope_list *Scope_Get_ScopefromPa
16536 name.hash = 0;
16537 name.len = (int)(cp - path);
16538 name.name = path;
16539- scope = Scope_Get_ScopefromName(&name);
16540+ scope = novfs_get_scope_from_name(&name);
16541 }
16542 }
16543 kfree(buf);
16544 }
16545
16546- return scope;
16547+ return (scope);
16548 }
16549
16550-static char *add_to_list(char *name, char *list, char *endoflist)
16551+static char *add_to_list(char *Name, char *List, char *EndOfList)
16552 {
16553- while (*name && (list < endoflist))
16554- *list++ = *name++;
16555-
16556- if (list < endoflist)
16557- *list++ = '\0';
16558+ while (*Name && (List < EndOfList)) {
16559+ *List++ = *Name++;
16560+ }
16561
16562- return list;
16563+ if (List < EndOfList) {
16564+ *List++ = '\0';
16565+ }
16566+ return (List);
16567 }
16568
16569-char *Scope_Get_ScopeUsers(void)
16570+char *novfs_get_scopeusers(void)
16571 {
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)
16578
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);
16583
16584 DbgPrint("Scope_Get_ScopeUsers found 0x%p %s\n",
16585 scope, scope->ScopeUserName);
16586@@ -429,6 +419,7 @@ char *Scope_Get_ScopeUsers(void)
16587 *cp++ = '\0';
16588 asize = 0;
16589 } else { /* Allocation was to small, up size */
16590+
16591 asize *= 4;
16592 kfree(list);
16593 list = NULL;
16594@@ -437,12 +428,12 @@ char *Scope_Get_ScopeUsers(void)
16595
16596 break;
16597 }
16598- } while (!list); /* list was to small try again */
16599+ } while (!list); /* List was to small try again */
16600
16601- return list;
16602+ return (list);
16603 }
16604
16605-void *Scope_Lookup(void)
16606+void *novfs_scope_lookup(void)
16607 {
16608 return Scope_Find_Scope(1);
16609 }
16610@@ -454,8 +445,7 @@ static void Scope_Timer_Function(unsigne
16611
16612 static int Scope_Cleanup_Thread(void *Args)
16613 {
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;
16619
16620@@ -468,8 +458,9 @@ static int Scope_Cleanup_Thread(void *Ar
16621
16622 while (0 == Scope_Thread_Terminate) {
16623 DbgPrint("Scope_Cleanup_Thread: looping\n");
16624- if (Scope_Thread_Terminate)
16625+ if (Scope_Thread_Terminate) {
16626 break;
16627+ }
16628
16629 /*
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);
16633
16634 while (sl != &Scope_List) {
16635- scope = list_entry(sl, struct scope_list, entry);
16636+ scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16637 sl = sl->next;
16638
16639 rscope = NULL;
16640@@ -495,7 +486,7 @@ static int Scope_Cleanup_Thread(void *Ar
16641 rcu_read_unlock();
16642
16643 if (!rscope) {
16644- list_move(&scope->entry, &cleanup);
16645+ list_move(&scope->ScopeList, &cleanup);
16646 DbgPrint("Scope_Cleanup_Thread: Scope=0x%p\n",
16647 rscope);
16648 }
16649@@ -505,7 +496,7 @@ static int Scope_Cleanup_Thread(void *Ar
16650
16651 sl = cleanup.next;
16652 while (sl != &cleanup) {
16653- scope = list_entry(sl, struct scope_list, entry);
16654+ scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16655 sl = sl->next;
16656
16657 DbgPrint("Scope_Cleanup_Thread: Removing 0x%p\n"
16658@@ -523,9 +514,9 @@ static int Scope_Cleanup_Thread(void *Ar
16659 scope->ScopeTask,
16660 scope->ScopeHash,
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);
16668 }
16669 kfree(scope);
16670 }
16671@@ -536,21 +527,21 @@ static int Scope_Cleanup_Thread(void *Ar
16672 add_timer(&Scope_Timer);
16673 DbgPrint("Scope_Cleanup_Thread: sleeping\n");
16674
16675- if (down_interruptible(&Scope_Thread_Delay))
16676+ if (down_interruptible(&Scope_Thread_Delay)) {
16677 break;
16678-
16679+ }
16680 del_timer(&Scope_Timer);
16681 }
16682 Scope_Thread_Terminate = 0;
16683
16684 printk(KERN_INFO "Scope_Cleanup_Thread: Exit\n");
16685 DbgPrint("Scope_Cleanup_Thread: Exit\n");
16686- return 0;
16687+ return (0);
16688 }
16689
16690-void Scope_Cleanup(void)
16691+void novfs_scope_cleanup(void)
16692 {
16693- struct scope_list *scope;
16694+ struct novfs_scope_list *scope;
16695 struct list_head *sl;
16696
16697 DbgPrint("Scope_Cleanup:\n");
16698@@ -563,10 +554,10 @@ void Scope_Cleanup(void)
16699 sl = Scope_List.next;
16700
16701 while (sl != &Scope_List) {
16702- scope = list_entry(sl, struct scope_list, entry);
16703+ scope = list_entry(sl, struct novfs_scope_list, ScopeList);
16704 sl = sl->next;
16705
16706- list_del(&scope->entry);
16707+ list_del(&scope->ScopeList);
16708
16709 DbgPrint("Scope_Cleanup: Removing 0x%p\n"
16710 " ScopeId: 0x%p:%p\n"
16711@@ -583,9 +574,9 @@ void Scope_Cleanup(void)
16712 scope->ScopeTask,
16713 scope->ScopeHash,
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);
16721 }
16722 kfree(scope);
16723 }
16724@@ -595,19 +586,13 @@ void Scope_Cleanup(void)
16725 }
16726
16727 /*
16728- * Arguments: struct dentry *dentry - starting entry
16729- * char *Buf - pointer to memory buffer
16730- * unsigned int Buflen - size of memory buffer
16731- *
16732- * Returns: pointer to path.
16733- *
16734- * Abstract: Walks the dentry chain building a path.
16735+ * Walks the dentry chain building a path.
16736 */
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,
16739 int Flags)
16740 {
16741 char *retval = &Buf[Buflen];
16742- struct dentry *p = dentry;
16743+ struct dentry *p = Dentry;
16744 int len;
16745
16746 *(--retval) = '\0';
16747@@ -627,8 +612,9 @@ char *Scope_dget_path(struct dentry *den
16748 }
16749 } while (!IS_ROOT(p));
16750
16751- if (IS_ROOT(dentry))
16752+ if (IS_ROOT(Dentry)) {
16753 retval++;
16754+ }
16755
16756 if (Flags) {
16757 len = strlen(p->d_sb->s_type->name);
16758@@ -641,19 +627,18 @@ char *Scope_dget_path(struct dentry *den
16759 }
16760 }
16761
16762- return retval;
16763+ return (retval);
16764 }
16765
16766-void Scope_Init(void)
16767+void novfs_scope_init(void)
16768 {
16769 INIT_LIST_HEAD(&Scope_List);
16770 init_MUTEX(&Scope_Lock);
16771 init_MUTEX_LOCKED(&Scope_Thread_Delay);
16772-
16773 kthread_run(Scope_Cleanup_Thread, NULL, "novfs_ST");
16774 }
16775
16776-void Scope_Uninit(void)
16777+void novfs_scope_exit(void)
16778 {
16779 unsigned long expires = jiffies + HZ * SHUTDOWN_INTERVAL;
16780
16781@@ -666,7 +651,6 @@ void Scope_Uninit(void)
16782 mb();
16783 while (Scope_Thread_Terminate && (jiffies < expires))
16784 yield();
16785-
16786 /* down(&Scope_Thread_Delay); */
16787 printk(KERN_INFO "Scope_Uninit: Exit\n");
16788
16789--- a/fs/novfs/vfs.h
16790+++ b/fs/novfs/vfs.h
16791@@ -20,37 +20,31 @@
16792
16793 #include <linux/version.h>
16794 #include <linux/namei.h>
16795-#include <linux/string.h>
16796
16797 #include "nwcapi.h"
16798
16799-typedef void *HANDLE;
16800
16801-struct schandle {
16802- void *hTypeId;
16803- void *hId;
16804-};
16805-
16806-static inline void copy_schandle(struct schandle *dest, struct schandle *source)
16807-{
16808- memcpy(dest, source, sizeof(struct schandle));
16809-}
16810-#define copy_session_id copy_schandle
16811+#ifndef XTIER_SCHANDLE
16812+struct novfs_schandle {
16813+ void * hTypeId;
16814+ void * hId;
16815
16816-typedef struct schandle session_t;
16817+};
16818
16819 #include "commands.h"
16820
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;}
16825
16826 #define UID_TO_SCHANDLE(hSC, uid) \
16827 { \
16828 hSC.hTypeId = NULL; \
16829- hSC.hId = (HANDLE)(unsigned long)(uid); \
16830+ hSC.hId = (void *)(unsigned long)(uid); \
16831 }
16832
16833+#define XTIER_SCHANDLE
16834+#endif
16835
16836
16837 /*===[ Manifest constants ]===============================================*/
16838@@ -71,16 +65,6 @@ typedef struct schandle session_t;
16839 #define IOC_SESSION 0x4a540003
16840 #define IOC_DEBUGPRINT 0x4a540004
16841
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)
16846-#else
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)
16850-#endif
16851-
16852 /*
16853 * NetWare file attributes
16854 */
16855@@ -96,7 +80,7 @@ typedef struct schandle session_t;
16856 #define NW_ATTRIBUTE_SHAREABLE 0x80
16857
16858 /*
16859- * Define READ/WRITE flag for struct data_list
16860+ * Define READ/WRITE flag for DATA_LIST
16861 */
16862 #define DLREAD 0
16863 #define DLWRITE 1
16864@@ -156,7 +140,8 @@ typedef struct schandle session_t;
16865 DEFINE_TO_STR(NOVFS_VFS_RELEASE) \
16866 "\0"
16867
16868-struct entry_info {
16869+/*===[ Type definitions ]=================================================*/
16870+struct novfs_entry_info {
16871 int type;
16872 umode_t mode;
16873 uid_t uid;
16874@@ -174,17 +159,17 @@ struct novfs_string {
16875 unsigned char *data;
16876 };
16877
16878-struct login {
16879+struct novfs_login {
16880 struct novfs_string Server;
16881 struct novfs_string UserName;
16882 struct novfs_string Password;
16883 };
16884
16885-struct logout {
16886+struct novfs_logout {
16887 struct novfs_string Server;
16888 };
16889
16890-struct dir_cache {
16891+struct novfs_dir_cache {
16892 struct list_head list;
16893 int flags;
16894 u64 jiffies;
16895@@ -199,7 +184,7 @@ struct dir_cache {
16896 char name[1];
16897 };
16898
16899-struct data_list {
16900+struct novfs_data_list {
16901 void *page;
16902 void *offset;
16903 int len;
16904@@ -209,227 +194,256 @@ struct data_list {
16905
16906 extern char *ctime_r(time_t * clock, char *buf);
16907
16908-static inline u32 HandletoUint32(HANDLE h)
16909 /*
16910- *
16911- * Arguments: HANDLE h - handle value
16912- *
16913- * Returns: u32 - u32 value
16914- *
16915- * Abstract: Converts a HANDLE to a u32 type.
16916- *
16917- * Notes:
16918- *
16919- * Environment:
16920- *
16921- *========================================================================*/
16922+ * Converts a HANDLE to a u32 type.
16923+ */
16924+static inline u32 HandletoUint32(void * h)
16925 {
16926 return (u32) ((unsigned long) h);
16927 }
16928
16929-/*++======================================================================*/
16930-static inline HANDLE Uint32toHandle(u32 ui32)
16931 /*
16932- *
16933- * Arguments: u32 ui32
16934- *
16935- * Returns: HANDLE - Handle type.
16936- *
16937- * Abstract: Converts a u32 to a HANDLE type.
16938- *
16939- * Notes:
16940- *
16941- * Environment:
16942- *
16943- *========================================================================*/
16944+ * Converts a u32 to a HANDLE type.
16945+ */
16946+static inline void *Uint32toHandle(u32 ui32)
16947 {
16948- return ((HANDLE) (unsigned long) ui32);
16949+ return ((void *) (unsigned long) ui32);
16950 }
16951
16952 /* Global variables */
16953
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;
16971
16972
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);
16978
16979-extern void mydump(int size, void *dumpptr);
16980+extern void novfs_dump(int size, void *dumpptr);
16981
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);
16986
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);
16991
16992 /*
16993 * daemon.c functions
16994 */
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,
17046+ int origin);
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);
17050
17051
17052 /*
17053 * file.c functions
17054 */
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);
17081
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,
17151 loff_t len);
17152
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);
17170
17171-extern int Novfs_Add_to_Root(char *);
17172+extern int novfs_add_to_root(char *);
17173
17174
17175 /*
17176 * scope.c functions
17177 */
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);
17209
17210 /*
17211 * profile.c functions
17212 */
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);
17220
17221 /*
17222 * nwcapi.c functions
17223 */
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);
17323
17324
17325 #endif /* __NOVFS_H */