Commit 9a8165fc authored by Jeff Layton's avatar Jeff Layton Committed by Steve French

cifs: track DeletePending flag in cifsInodeInfo

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: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent dd1db2de
...@@ -309,6 +309,7 @@ cifs_alloc_inode(struct super_block *sb) ...@@ -309,6 +309,7 @@ cifs_alloc_inode(struct super_block *sb)
file data or metadata */ file data or metadata */
cifs_inode->clientCanCacheRead = false; cifs_inode->clientCanCacheRead = false;
cifs_inode->clientCanCacheAll = false; cifs_inode->clientCanCacheAll = false;
cifs_inode->delete_pending = false;
cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */
/* Can not set i_flags here - they get immediately overwritten /* Can not set i_flags here - they get immediately overwritten
......
...@@ -353,6 +353,7 @@ struct cifsInodeInfo { ...@@ -353,6 +353,7 @@ struct cifsInodeInfo {
bool clientCanCacheRead:1; /* read oplock */ bool clientCanCacheRead:1; /* read oplock */
bool clientCanCacheAll:1; /* read and writebehind oplock */ bool clientCanCacheAll:1; /* read and writebehind oplock */
bool oplockPending:1; bool oplockPending:1;
bool delete_pending:1; /* DELETE_ON_CLOSE is set */
struct inode vfs_inode; struct inode vfs_inode;
}; };
......
...@@ -1309,6 +1309,7 @@ OldOpenRetry: ...@@ -1309,6 +1309,7 @@ OldOpenRetry:
cpu_to_le64(le32_to_cpu(pSMBr->EndOfFile)); cpu_to_le64(le32_to_cpu(pSMBr->EndOfFile));
pfile_info->EndOfFile = pfile_info->AllocationSize; pfile_info->EndOfFile = pfile_info->AllocationSize;
pfile_info->NumberOfLinks = cpu_to_le32(1); pfile_info->NumberOfLinks = cpu_to_le32(1);
pfile_info->DeletePending = 0;
} }
} }
...@@ -1410,6 +1411,7 @@ openRetry: ...@@ -1410,6 +1411,7 @@ openRetry:
pfile_info->AllocationSize = pSMBr->AllocationSize; pfile_info->AllocationSize = pSMBr->AllocationSize;
pfile_info->EndOfFile = pSMBr->EndOfFile; pfile_info->EndOfFile = pSMBr->EndOfFile;
pfile_info->NumberOfLinks = cpu_to_le32(1); pfile_info->NumberOfLinks = cpu_to_le32(1);
pfile_info->DeletePending = 0;
} }
} }
......
...@@ -506,6 +506,7 @@ int cifs_get_inode_info(struct inode **pinode, ...@@ -506,6 +506,7 @@ int cifs_get_inode_info(struct inode **pinode,
inode = *pinode; inode = *pinode;
cifsInfo = CIFS_I(inode); cifsInfo = CIFS_I(inode);
cifsInfo->cifsAttrs = attr; cifsInfo->cifsAttrs = attr;
cifsInfo->delete_pending = pfindData->DeletePending ? true : false;
cFYI(1, ("Old time %ld", cifsInfo->time)); cFYI(1, ("Old time %ld", cifsInfo->time));
cifsInfo->time = jiffies; cifsInfo->time = jiffies;
cFYI(1, ("New time %ld", cifsInfo->time)); cFYI(1, ("New time %ld", cifsInfo->time));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment