[CIFS] Migrate from prefixpath logic
[deliverable/linux.git] / fs / cifs / dir.c
index 9ea65cf367146905cc0dababe262397752a15894..aa0669a82922bc1e5e9b193deacdc65d270c047f 100644 (file)
@@ -50,7 +50,6 @@ build_path_from_dentry(struct dentry *direntry)
 {
        struct dentry *temp;
        int namelen;
-       int pplen;
        int dfsplen;
        char *full_path;
        char dirsep;
@@ -63,13 +62,12 @@ build_path_from_dentry(struct dentry *direntry)
                when the server crashed */
 
        dirsep = CIFS_DIR_SEP(cifs_sb);
-       pplen = cifs_sb->prepathlen;
        if (tcon->Flags & SMB_SHARE_IS_IN_DFS)
                dfsplen = strnlen(tcon->treeName, MAX_TREE_SIZE + 1);
        else
                dfsplen = 0;
 cifs_bp_rename_retry:
-       namelen = pplen + dfsplen;
+       namelen = dfsplen;
        for (temp = direntry; !IS_ROOT(temp);) {
                namelen += (1 + temp->d_name.len);
                temp = temp->d_parent;
@@ -100,7 +98,7 @@ cifs_bp_rename_retry:
                        return NULL;
                }
        }
-       if (namelen != pplen + dfsplen) {
+       if (namelen != dfsplen) {
                cERROR(1, "did not end path lookup where expected namelen is %d",
                        namelen);
                /* presumably this is only possible if racing with a rename
@@ -126,7 +124,6 @@ cifs_bp_rename_retry:
                        }
                }
        }
-       strncpy(full_path + dfsplen, CIFS_SB(direntry->d_sb)->prepath, pplen);
        return full_path;
 }
 
@@ -357,6 +354,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
        struct cifs_sb_info *cifs_sb;
        struct tcon_link *tlink;
        struct cifsTconInfo *pTcon;
+       struct cifs_io_parms io_parms;
        char *full_path = NULL;
        struct inode *newinode = NULL;
        int oplock = 0;
@@ -439,16 +437,19 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
         * timestamps in, but we can reuse it safely */
 
        pdev = (struct win_dev *)buf;
+       io_parms.netfid = fileHandle;
+       io_parms.pid = current->tgid;
+       io_parms.tcon = pTcon;
+       io_parms.offset = 0;
+       io_parms.length = sizeof(struct win_dev);
        if (S_ISCHR(mode)) {
                memcpy(pdev->type, "IntxCHR", 8);
                pdev->major =
                      cpu_to_le64(MAJOR(device_number));
                pdev->minor =
                      cpu_to_le64(MINOR(device_number));
-               rc = CIFSSMBWrite(xid, pTcon,
-                       fileHandle,
-                       sizeof(struct win_dev),
-                       0, &bytes_written, (char *)pdev,
+               rc = CIFSSMBWrite(xid, &io_parms,
+                       &bytes_written, (char *)pdev,
                        NULL, 0);
        } else if (S_ISBLK(mode)) {
                memcpy(pdev->type, "IntxBLK", 8);
@@ -456,10 +457,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
                      cpu_to_le64(MAJOR(device_number));
                pdev->minor =
                      cpu_to_le64(MINOR(device_number));
-               rc = CIFSSMBWrite(xid, pTcon,
-                       fileHandle,
-                       sizeof(struct win_dev),
-                       0, &bytes_written, (char *)pdev,
+               rc = CIFSSMBWrite(xid, &io_parms,
+                       &bytes_written, (char *)pdev,
                        NULL, 0);
        } /* else if (S_ISFIFO) */
        CIFSSMBClose(xid, pTcon, fileHandle);
This page took 0.060972 seconds and 5 git commands to generate.