aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb1ops.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-18 19:20:26 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:26 -0400
commitfb1214e48f735cdb68446adb77ec37aa3de60697 (patch)
tree158dbfbedaf396f013e70f5288fdc906e990391c /fs/cifs/smb1ops.c
parent4b4de76e35518fc0c636f628abca8c1b19ad6689 (diff)
CIFS: Move open code to ops struct
Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb1ops.c')
-rw-r--r--fs/cifs/smb1ops.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index b170da0a882d..907b30865000 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -607,6 +607,33 @@ cifs_mkdir_setinfo(struct inode *inode, const char *full_path,
607 cifsInode->cifsAttrs = dosattrs; 607 cifsInode->cifsAttrs = dosattrs;
608} 608}
609 609
610static int
611cifs_open_file(const unsigned int xid, struct cifs_tcon *tcon, const char *path,
612 int disposition, int desired_access, int create_options,
613 struct cifs_fid *fid, __u32 *oplock, FILE_ALL_INFO *buf,
614 struct cifs_sb_info *cifs_sb)
615{
616 if (!(tcon->ses->capabilities & CAP_NT_SMBS))
617 return SMBLegacyOpen(xid, tcon, path, disposition,
618 desired_access, CREATE_NOT_DIR,
619 &fid->netfid, oplock, buf,
620 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags
621 & CIFS_MOUNT_MAP_SPECIAL_CHR);
622 return CIFSSMBOpen(xid, tcon, path, disposition, desired_access,
623 create_options, &fid->netfid, oplock, buf,
624 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
625 CIFS_MOUNT_MAP_SPECIAL_CHR);
626}
627
628static void
629cifs_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock)
630{
631 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode);
632 cfile->fid.netfid = fid->netfid;
633 cifs_set_oplock_level(cinode, oplock);
634 cinode->can_cache_brlcks = cinode->clientCanCacheAll;
635}
636
610struct smb_version_operations smb1_operations = { 637struct smb_version_operations smb1_operations = {
611 .send_cancel = send_nt_cancel, 638 .send_cancel = send_nt_cancel,
612 .compare_fids = cifs_compare_fids, 639 .compare_fids = cifs_compare_fids,
@@ -646,6 +673,8 @@ struct smb_version_operations smb1_operations = {
646 .rmdir = CIFSSMBRmDir, 673 .rmdir = CIFSSMBRmDir,
647 .unlink = CIFSSMBDelFile, 674 .unlink = CIFSSMBDelFile,
648 .rename_pending_delete = cifs_rename_pending_delete, 675 .rename_pending_delete = cifs_rename_pending_delete,
676 .open = cifs_open_file,
677 .set_fid = cifs_set_fid,
649}; 678};
650 679
651struct smb_version_values smb1_values = { 680struct smb_version_values smb1_values = {