]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ncpfs (7/7): misc fixes and cleanups
authorAlexander Viro <viro@www.linux.org.uk>
Wed, 6 Oct 2004 00:54:02 +0000 (17:54 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 00:54:02 +0000 (17:54 -0700)
* remaining endiannes cleanups
* don't mess with setting finfo.i.dataStreamSize when creating the root
  directory inode; that field is ignored when populating in-core directory
  inodes.
* missing cpu_to_le16() in ncp_search_for_fileset() (for big-endian clients
  server sees 0xff7f instead of intended 0x7fff).

Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ncpfs/dir.c
fs/ncpfs/inode.c
fs/ncpfs/ncplib_kernel.c

index 35b8af400dbbccb20842a276ab3e1d0c963bd733..2dc2d8693968e7d223e96cfc8c4aa4aac27d20d6 100644 (file)
@@ -980,7 +980,8 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 
        error = -EACCES;
        if (ncp_open_create_file_or_subdir(server, dir, __name,
-                                          OC_MODE_CREATE, aDIR, 0xffff,
+                                          OC_MODE_CREATE, aDIR,
+                                          cpu_to_le16(0xffff),
                                           &finfo) == 0)
        {
                if (ncp_is_nfs_extras(server, finfo.volume)) {
index 0641f406a84cd29e296232639b70bab294a7c986..44795d2f4b30856790ce214d2c10386c1122cf6b 100644 (file)
@@ -460,7 +460,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
                        break;
                default:
                        error = -ECHRNG;
-                       if (*(__u32*)raw_data == cpu_to_be32(0x76657273)) {
+                       if (memcmp(raw_data, "vers", 4) == 0) {
                                error = ncp_parse_options(&data, raw_data);
                        }
                        if (error)
@@ -623,7 +623,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
 
        memset(&finfo, 0, sizeof(finfo));
        finfo.i.attributes      = aDIR;
-       finfo.i.dataStreamSize  = NCP_BLOCK_SIZE;
+       finfo.i.dataStreamSize  = 0;    /* ignored */
        finfo.i.dirEntNum       = 0;
        finfo.i.DosDirNum       = 0;
 #ifdef CONFIG_NCPFS_SMALLDOS
index c83da29e2b9ca509e415daff20fc295590f4dbc9..51969f278a6b255088d9dc7fd986c84d056aa5a3 100644 (file)
@@ -902,7 +902,7 @@ int ncp_search_for_fileset(struct ncp_server *server,
        ncp_add_byte(server, 0);                /* datastream */
        ncp_add_word(server, cpu_to_le16(0x8006));
        ncp_add_dword(server, RIM_ALL);
-       ncp_add_word(server, 32767);            /* max returned items */
+       ncp_add_word(server, cpu_to_le16(32767));       /* max returned items */
        ncp_add_mem(server, seq, 9);
 #ifdef CONFIG_NCPFS_NFS_NS
        if (server->name_space[seq->volNumber] == NW_NS_NFS) {