]> git.openpandora.org Git - pandora-kernel.git/commitdiff
[CIFS] reopen file via newer posix open protocol operation if available
authorSteve French <sfrench@us.ibm.com>
Mon, 23 Feb 2009 20:43:11 +0000 (20:43 +0000)
committerSteve French <sfrench@us.ibm.com>
Thu, 12 Mar 2009 01:36:20 +0000 (01:36 +0000)
If the network connection crashes, and we have to reopen files, preferentially
use the newer cifs posix open protocol operation if the server supports it.

Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsproto.h
fs/cifs/dir.c
fs/cifs/file.c

index 596fc8689371bc8159b07818f1ecb71444f36486..a069e7bfd2d09fc57d71f37be192befd444f2f3a 100644 (file)
@@ -92,6 +92,9 @@ extern u64 cifs_UnixTimeToNT(struct timespec);
 extern __le64 cnvrtDosCifsTm(__u16 date, __u16 time);
 extern struct timespec cnvrtDosUnixTm(__u16 date, __u16 time);
 
+extern int cifs_posix_open(char *full_path, struct inode **pinode,
+                          struct super_block *sb, int mode, int oflags,
+                          int *poplock, __u16 *pnetfid, int xid);
 extern void posix_fill_in_inode(struct inode *tmp_inode,
                                FILE_UNIX_BASIC_INFO *pData, int isNewInode);
 extern struct inode *cifs_new_inode(struct super_block *sb, __u64 *inum);
index 89fb728326523f6f3367a7343e057350341f423a..f9b6f68be976e062894da51dade4f78cedbdc8f1 100644 (file)
@@ -129,7 +129,7 @@ cifs_bp_rename_retry:
        return full_path;
 }
 
-static int cifs_posix_open(char *full_path, struct inode **pinode,
+int cifs_posix_open(char *full_path, struct inode **pinode,
                    struct super_block *sb, int mode, int oflags,
                    int *poplock, __u16 *pnetfid, int xid)
 {
@@ -187,7 +187,9 @@ static int cifs_posix_open(char *full_path, struct inode **pinode,
        if (!pinode)
                goto posix_open_ret; /* caller does not need info */
 
-       *pinode = cifs_new_inode(sb, &presp_data->UniqueId);
+       if (*pinode == NULL)
+               *pinode = cifs_new_inode(sb, &presp_data->UniqueId);
+       /* else an inode was passed in. Update its info, don't create one */
 
        /* We do not need to close the file if new_inode fails since
           the caller will retry qpathinfo as long as inode is null */
diff --cc fs/cifs/file.c
Simple merge