X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fncpfs%2Fncplib_kernel.h;h=2441d1ab57dc57abe66ba24126b3b9221b1692bc;hb=refs%2Fheads%2Fvserver;hp=c702f3bc4184efb25a1fa2a029171dfb2fc70d07;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h index c702f3bc4..2441d1ab5 100644 --- a/fs/ncpfs/ncplib_kernel.h +++ b/fs/ncpfs/ncplib_kernel.h @@ -12,7 +12,6 @@ #ifndef _NCPLIB_H #define _NCPLIB_H -#include #include #include @@ -56,7 +55,7 @@ static inline int ncp_read_bounce_size(__u32 size) { return sizeof(struct ncp_reply_header) + 2 + 2 + size + 8; }; int ncp_read_bounce(struct ncp_server *, const char *, __u32, __u16, - char *, int *, void* bounce, __u32 bouncelen); + char __user *, int *, void* bounce, __u32 bouncelen); int ncp_read_kernel(struct ncp_server *, const char *, __u32, __u16, char *, int *); int ncp_write_kernel(struct ncp_server *, const char *, __u32, __u16, @@ -70,24 +69,23 @@ void ncp_extract_file_info(void* src, struct nw_info_struct* target); int ncp_obtain_info(struct ncp_server *server, struct inode *, char *, struct nw_info_struct *target); int ncp_obtain_nfs_info(struct ncp_server *server, struct nw_info_struct *target); -int ncp_lookup_volume(struct ncp_server *, char *, struct nw_info_struct *); +int ncp_get_volume_root(struct ncp_server *server, const char *volname, + __u32 *volume, __le32 *dirent, __le32 *dosdirent); +int ncp_lookup_volume(struct ncp_server *, const char *, struct nw_info_struct *); int ncp_modify_file_or_subdir_dos_info(struct ncp_server *, struct inode *, - __u32, const struct nw_modify_dos_info *info); + __le32, const struct nw_modify_dos_info *info); int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *, struct inode *, - const char* path, __u32, const struct nw_modify_dos_info *info); -int ncp_modify_nfs_info(struct ncp_server *, __u8 volnum, __u32 dirent, + const char* path, __le32, const struct nw_modify_dos_info *info); +int ncp_modify_nfs_info(struct ncp_server *, __u8 volnum, __le32 dirent, __u32 mode, __u32 rdev); int ncp_del_file_or_subdir2(struct ncp_server *, struct dentry*); int ncp_del_file_or_subdir(struct ncp_server *, struct inode *, char *); int ncp_open_create_file_or_subdir(struct ncp_server *, struct inode *, char *, - int, __u32, int, struct ncp_entry_info *); + int, __le32, __le16, struct ncp_entry_info *); int ncp_initialize_search(struct ncp_server *, struct inode *, struct nw_search_sequence *target); -int ncp_search_for_file_or_subdir(struct ncp_server *server, - struct nw_search_sequence *seq, - struct nw_info_struct *target); int ncp_search_for_fileset(struct ncp_server *server, struct nw_search_sequence *seq, int* more, int* cnt, @@ -111,13 +109,13 @@ ncp_ClearPhysicalRecord(struct ncp_server *server, #endif /* CONFIG_NCPFS_IOCTL_LOCKING */ int -ncp_mount_subdir(struct ncp_server *, struct nw_info_struct *, - __u8, __u8, __u32); -int ncp_dirhandle_alloc(struct ncp_server *, __u8 vol, __u32 dirent, __u8 *dirhandle); +ncp_mount_subdir(struct ncp_server *, __u8, __u8, __le32, + __u32* volume, __le32* dirent, __le32* dosdirent); +int ncp_dirhandle_alloc(struct ncp_server *, __u8 vol, __le32 dirent, __u8 *dirhandle); int ncp_dirhandle_free(struct ncp_server *, __u8 dirhandle); int ncp_create_new(struct inode *dir, struct dentry *dentry, - int mode, dev_t rdev, int attributes); + int mode, dev_t rdev, __le32 attributes); static inline int ncp_is_nfs_extras(struct ncp_server* server, unsigned int volnum) { #ifdef CONFIG_NCPFS_NFS_NS @@ -130,8 +128,6 @@ static inline int ncp_is_nfs_extras(struct ncp_server* server, unsigned int voln #ifdef CONFIG_NCPFS_NLS -unsigned char ncp__tolower(struct nls_table *, unsigned char); -unsigned char ncp__toupper(struct nls_table *, unsigned char); int ncp__io2vol(struct ncp_server *, unsigned char *, unsigned int *, const unsigned char *, unsigned int, int); int ncp__vol2io(struct ncp_server *, unsigned char *, unsigned int *, @@ -139,8 +135,10 @@ int ncp__vol2io(struct ncp_server *, unsigned char *, unsigned int *, #define NCP_ESC ':' #define NCP_IO_TABLE(dentry) (NCP_SERVER((dentry)->d_inode)->nls_io) -#define ncp_tolower(t, c) ncp__tolower(t, c) -#define ncp_toupper(t, c) ncp__toupper(t, c) +#define ncp_tolower(t, c) nls_tolower(t, c) +#define ncp_toupper(t, c) nls_toupper(t, c) +#define ncp_strnicmp(t, s1, s2, len) \ + nls_strnicmp(t, s1, s2, len) #define ncp_io2vol(S,m,i,n,k,U) ncp__io2vol(S,m,i,n,k,U) #define ncp_vol2io(S,m,i,n,k,U) ncp__vol2io(S,m,i,n,k,U) @@ -157,11 +155,19 @@ int ncp__vol2io(unsigned char *, unsigned int *, #define ncp_io2vol(S,m,i,n,k,U) ncp__io2vol(m,i,n,k,U) #define ncp_vol2io(S,m,i,n,k,U) ncp__vol2io(m,i,n,k,U) -#endif /* CONFIG_NCPFS_NLS */ -int -ncp_strnicmp(struct nls_table *, - const unsigned char *, const unsigned char *, int); +static inline int ncp_strnicmp(struct nls_table *t, const unsigned char *s1, + const unsigned char *s2, int len) +{ + while (len--) { + if (tolower(*s1++) != tolower(*s2++)) + return 1; + } + + return 0; +} + +#endif /* CONFIG_NCPFS_NLS */ #define NCP_GET_AGE(dentry) (jiffies - (dentry)->d_time) #define NCP_MAX_AGE(server) ((server)->dentry_ttl) @@ -189,7 +195,7 @@ ncp_renew_dentries(struct dentry *parent) spin_lock(&dcache_lock); next = parent->d_subdirs.next; while (next != &parent->d_subdirs) { - dentry = list_entry(next, struct dentry, d_child); + dentry = list_entry(next, struct dentry, d_u.d_child); if (dentry->d_fsdata == NULL) ncp_age_dentry(server, dentry); @@ -211,7 +217,7 @@ ncp_invalidate_dircache_entries(struct dentry *parent) spin_lock(&dcache_lock); next = parent->d_subdirs.next; while (next != &parent->d_subdirs) { - dentry = list_entry(next, struct dentry, d_child); + dentry = list_entry(next, struct dentry, d_u.d_child); dentry->d_fsdata = NULL; ncp_age_dentry(server, dentry); next = next->next;