cifs: track DeletePending flag in cifsInodeInfo
authorJeff Layton <jlayton@redhat.com>
Sat, 18 Oct 2008 01:03:20 +0000 (21:03 -0400)
committerSteve French <sfrench@us.ibm.com>
Mon, 20 Oct 2008 00:33:52 +0000 (00:33 +0000)
cifs: track DeletePending flag in cifsInodeInfo

The QPathInfo call returns a flag that indicates whether DELETE_ON_CLOSE
is set. Track it in the cifsInodeInfo.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/cifssmb.c
fs/cifs/inode.c

index 25ecbd5b040476bf13716ccfbebc5e8032905bd2..c6aad775dd6d723800ebc0a54ae00ed859a98c28 100644 (file)
@@ -309,6 +309,7 @@ cifs_alloc_inode(struct super_block *sb)
        file data or metadata */
        cifs_inode->clientCanCacheRead = false;
        cifs_inode->clientCanCacheAll = false;
+       cifs_inode->delete_pending = false;
        cifs_inode->vfs_inode.i_blkbits = 14;  /* 2**14 = CIFS_MAX_MSGSIZE */
 
        /* Can not set i_flags here - they get immediately overwritten
index 0d22479d99b7c0de7a145b84ee1f246136fde8f8..178f733a368fa36c4dfea96d188f37fa1794df84 100644 (file)
@@ -353,6 +353,7 @@ struct cifsInodeInfo {
        bool clientCanCacheRead:1;      /* read oplock */
        bool clientCanCacheAll:1;       /* read and writebehind oplock */
        bool oplockPending:1;
+       bool delete_pending:1;          /* DELETE_ON_CLOSE is set */
        struct inode vfs_inode;
 };
 
index 6f4ffe15d68df73f79d822498264bb4958434a3c..843a85fb8b9ac8a1189016be9ac59f6b0b8767f4 100644 (file)
@@ -1309,6 +1309,7 @@ OldOpenRetry:
                                cpu_to_le64(le32_to_cpu(pSMBr->EndOfFile));
                        pfile_info->EndOfFile = pfile_info->AllocationSize;
                        pfile_info->NumberOfLinks = cpu_to_le32(1);
+                       pfile_info->DeletePending = 0;
                }
        }
 
@@ -1410,6 +1411,7 @@ openRetry:
                    pfile_info->AllocationSize = pSMBr->AllocationSize;
                    pfile_info->EndOfFile = pSMBr->EndOfFile;
                    pfile_info->NumberOfLinks = cpu_to_le32(1);
+                   pfile_info->DeletePending = 0;
                }
        }
 
index fe4f2ee97b6c3146bd036b5dba982162fc0c7ab7..dea9eeb58b000ad1e8afc8fab4f51d57e806bb02 100644 (file)
@@ -506,6 +506,7 @@ int cifs_get_inode_info(struct inode **pinode,
        inode = *pinode;
        cifsInfo = CIFS_I(inode);
        cifsInfo->cifsAttrs = attr;
+       cifsInfo->delete_pending = pfindData->DeletePending ? true : false;
        cFYI(1, ("Old time %ld", cifsInfo->time));
        cifsInfo->time = jiffies;
        cFYI(1, ("New time %ld", cifsInfo->time));