aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-09-23 11:48:35 -0400
committerSteve French <sfrench@us.ibm.com>2008-09-23 13:39:28 -0400
commit6d22f09896c0d62c003ffa25fff25323e3ed608b (patch)
treeae324f22f3e2f4a4b5e5b7bf5f4f6d84e4f95ee0 /fs/cifs/inode.c
parent7c9c3760b3a5ae87ee4d661703b6d5de3999fe46 (diff)
cifs: add function to set file disposition
cifs: add function to set file disposition The proper way to set the delete on close bit on an already existing file is to use SET_FILE_INFO with an infolevel of SMB_FILE_DISPOSITION_INFO. Add a function to do that and have the silly-rename code use it. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 660aac81160a..954b670f1687 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -778,8 +778,7 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid)
778 FILE_BASIC_INFO *info_buf; 778 FILE_BASIC_INFO *info_buf;
779 779
780 rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, 780 rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
781 DELETE|FILE_WRITE_ATTRIBUTES, 781 DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR,
782 CREATE_NOT_DIR|CREATE_DELETE_ON_CLOSE,
783 &netfid, &oplock, NULL, cifs_sb->local_nls, 782 &netfid, &oplock, NULL, cifs_sb->local_nls,
784 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 783 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
785 if (rc != 0) 784 if (rc != 0)
@@ -807,6 +806,12 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid)
807 rc = CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, 806 rc = CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls,
808 cifs_sb->mnt_cifs_flags & 807 cifs_sb->mnt_cifs_flags &
809 CIFS_MOUNT_MAP_SPECIAL_CHR); 808 CIFS_MOUNT_MAP_SPECIAL_CHR);
809 if (rc != 0)
810 goto out_close;
811
812 /* set DELETE_ON_CLOSE */
813 rc = CIFSSMBSetFileDisposition(xid, tcon, true, netfid, current->tgid);
814
810out_close: 815out_close:
811 CIFSSMBClose(xid, tcon, netfid); 816 CIFSSMBClose(xid, tcon, netfid);
812out: 817out: