Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3870253e
Commit
3870253e
authored
Jul 08, 2007
by
Steve French
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CIFS] more whitespace fixes
Signed-off-by:
Steve French
<
sfrench@us.ibm.com
>
parent
790fe579
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
137 deletions
+141
-137
fs/cifs/netmisc.c
fs/cifs/netmisc.c
+42
-40
fs/cifs/readdir.c
fs/cifs/readdir.c
+82
-81
fs/cifs/sess.c
fs/cifs/sess.c
+5
-4
fs/cifs/smbdes.c
fs/cifs/smbdes.c
+12
-12
No files found.
fs/cifs/netmisc.c
View file @
3870253e
...
...
@@ -7,7 +7,6 @@
* Error mapping routines from Samba libsmb/errormap.c
* Copyright (C) Andrew Tridgell 2001
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
...
...
@@ -67,22 +66,22 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
{
ERRbadshare
,
-
ETXTBSY
},
{
ERRlock
,
-
EACCES
},
{
ERRunsup
,
-
EINVAL
},
{
ERRnosuchshare
,
-
ENXIO
},
{
ERRnosuchshare
,
-
ENXIO
},
{
ERRfilexists
,
-
EEXIST
},
{
ERRinvparm
,
-
EINVAL
},
{
ERRdiskfull
,
-
ENOSPC
},
{
ERRinvname
,
-
ENOENT
},
{
ERRinvlevel
,
-
EOPNOTSUPP
},
{
ERRinvlevel
,
-
EOPNOTSUPP
},
{
ERRdirnotempty
,
-
ENOTEMPTY
},
{
ERRnotlocked
,
-
ENOLCK
},
{
ERRcancelviolation
,
-
ENOLCK
},
{
ERRalreadyexists
,
-
EEXIST
},
{
ERRmoredata
,
-
EOVERFLOW
},
{
ERReasnotsupported
,
-
EOPNOTSUPP
},
{
ERReasnotsupported
,
-
EOPNOTSUPP
},
{
ErrQuota
,
-
EDQUOT
},
{
ErrNotALink
,
-
ENOLINK
},
{
ERRnetlogonNotStarted
,
-
ENOPROTOOPT
},
{
ErrTooManyLinks
,
-
EMLINK
},
{
ERRnetlogonNotStarted
,
-
ENOPROTOOPT
},
{
ErrTooManyLinks
,
-
EMLINK
},
{
0
,
0
}
};
...
...
@@ -133,13 +132,13 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = {
/* returns 0 if invalid address */
int
cifs_inet_pton
(
int
address_family
,
char
*
cp
,
void
*
dst
)
cifs_inet_pton
(
int
address_family
,
char
*
cp
,
void
*
dst
)
{
int
ret
=
0
;
/* calculate length by finding first slash or NULL */
/* BB Should we convert '/' slash to '\' here since it seems already
done
before this */
/* BB Should we convert '/' slash to '\' here since it seems already
* done
before this */
if
(
address_family
==
AF_INET
)
{
ret
=
in4_pton
(
cp
,
-
1
/* len */
,
dst
,
'\\'
,
NULL
);
}
else
if
(
address_family
==
AF_INET6
)
{
...
...
@@ -332,8 +331,8 @@ static const struct {
ERRHRD
,
ERRgeneral
,
NT_STATUS_FILE_INVALID
},
{
ERRHRD
,
ERRgeneral
,
NT_STATUS_ALLOTTED_SPACE_EXCEEDED
},
/* { This NT error code was 'sqashed'
from NT_STATUS_INSUFFICIENT_RESOURCES to
NT_STATUS_INSUFF_SERVER_RESOURCES
during the session setup } */
from NT_STATUS_INSUFFICIENT_RESOURCES to
NT_STATUS_INSUFF_SERVER_RESOURCES
during the session setup } */
{
ERRDOS
,
ERRnomem
,
NT_STATUS_INSUFFICIENT_RESOURCES
},
{
ERRDOS
,
ERRbadpath
,
NT_STATUS_DFS_EXIT_PATH_FOUND
},
{
...
...
@@ -577,8 +576,8 @@ static const struct {
ERRDOS
,
19
,
NT_STATUS_TOO_LATE
},
{
ERRDOS
,
ERRnoaccess
,
NT_STATUS_NO_TRUST_LSA_SECRET
},
/* { This NT error code was 'sqashed'
from NT_STATUS_NO_TRUST_SAM_ACCOUNT to
NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE
during the session setup } */
from NT_STATUS_NO_TRUST_SAM_ACCOUNT to
NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE
during the session setup } */
{
ERRDOS
,
ERRnoaccess
,
NT_STATUS_NO_TRUST_SAM_ACCOUNT
},
{
ERRDOS
,
ERRnoaccess
,
NT_STATUS_TRUSTED_DOMAIN_FAILURE
},
{
...
...
@@ -728,7 +727,7 @@ cifs_print_status(__u32 status_code)
if
(((
nt_errs
[
idx
].
nt_errcode
)
&
0xFFFFFF
)
==
(
status_code
&
0xFFFFFF
))
{
printk
(
KERN_NOTICE
"Status code returned 0x%08x %s
\n
"
,
status_code
,
nt_errs
[
idx
].
nt_errstr
);
status_code
,
nt_errs
[
idx
].
nt_errstr
);
}
idx
++
;
}
...
...
@@ -771,7 +770,8 @@ map_smb_to_linux_error(struct smb_hdr *smb)
return
0
;
if
(
smb
->
Flags2
&
SMBFLG2_ERR_STATUS
)
{
/* translate the newer STATUS codes to old style errors and then to POSIX errors */
/* translate the newer STATUS codes to old style SMB errors
* and then to POSIX errors */
__u32
err
=
le32_to_cpu
(
smb
->
Status
.
CifsError
);
if
(
cifsFYI
&
CIFS_RC
)
cifs_print_status
(
err
);
...
...
@@ -784,7 +784,7 @@ map_smb_to_linux_error(struct smb_hdr *smb)
/* old style errors */
/* DOS class smb error codes - map DOS */
if
(
smberrclass
==
ERRDOS
)
{
/* one
byte field no need to byte reverse */
if
(
smberrclass
==
ERRDOS
)
{
/* 1
byte field no need to byte reverse */
for
(
i
=
0
;
i
<
sizeof
(
mapping_table_ERRDOS
)
/
...
...
@@ -795,7 +795,7 @@ map_smb_to_linux_error(struct smb_hdr *smb)
rc
=
mapping_table_ERRDOS
[
i
].
posix_code
;
break
;
}
/* else try
the next error mapping one to see if it will
match */
/* else try
next error mapping one to see if
match */
}
}
else
if
(
smberrclass
==
ERRSRV
)
{
/* server class of error codes */
for
(
i
=
0
;
...
...
@@ -808,14 +808,16 @@ map_smb_to_linux_error(struct smb_hdr *smb)
rc
=
mapping_table_ERRSRV
[
i
].
posix_code
;
break
;
}
/* else try
the next error mapping one to see if it will
match */
/* else try
next error mapping to see if
match */
}
}
/* else ERRHRD class errors or junk - return EIO */
cFYI
(
1
,
(
" !!Mapping smb error code %d to POSIX err %d !!"
,
smberrcode
,
rc
));
cFYI
(
1
,
(
" !!Mapping smb error code %d to POSIX err %d !!"
,
smberrcode
,
rc
));
/* generic corrective action e.g. reconnect SMB session on ERRbaduid could be added */
/* generic corrective action e.g. reconnect SMB session on
* ERRbaduid could be added */
return
rc
;
}
...
...
@@ -885,20 +887,20 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
SMB_TIME
*
st
=
(
SMB_TIME
*
)
&
time
;
SMB_DATE
*
sd
=
(
SMB_DATE
*
)
&
date
;
cFYI
(
1
,
(
"date %d time %d"
,
date
,
time
));
cFYI
(
1
,
(
"date %d time %d"
,
date
,
time
));
sec
=
2
*
st
->
TwoSeconds
;
min
=
st
->
Minutes
;
if
((
sec
>
59
)
||
(
min
>
59
))
cERROR
(
1
,(
"illegal time min %d sec %d"
,
min
,
sec
));
cERROR
(
1
,
(
"illegal time min %d sec %d"
,
min
,
sec
));
sec
+=
(
min
*
60
);
sec
+=
60
*
60
*
st
->
Hours
;
if
(
st
->
Hours
>
24
)
cERROR
(
1
,
(
"illegal hours %d"
,
st
->
Hours
));
cERROR
(
1
,
(
"illegal hours %d"
,
st
->
Hours
));
days
=
sd
->
Day
;
month
=
sd
->
Month
;
if
((
days
>
31
)
||
(
month
>
12
))
cERROR
(
1
,(
"illegal date, month %d day: %d"
,
month
,
days
));
cERROR
(
1
,
(
"illegal date, month %d day: %d"
,
month
,
days
));
month
-=
1
;
days
+=
total_days_of_prev_months
[
month
];
days
+=
3652
;
/* account for difference in days between 1980 and 1970 */
...
...
fs/cifs/readdir.c
View file @
3870253e
...
...
@@ -431,14 +431,14 @@ static void unix_fill_in_inode(struct inode *tmp_inode,
static
int
initiate_cifs_search
(
const
int
xid
,
struct
file
*
file
)
{
int
rc
=
0
;
char
*
full_path
;
struct
cifsFileInfo
*
cifsFile
;
char
*
full_path
;
struct
cifsFileInfo
*
cifsFile
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifsTconInfo
*
pTcon
;
if
(
file
->
private_data
==
NULL
)
{
file
->
private_data
=
kzalloc
(
sizeof
(
struct
cifsFileInfo
),
GFP_KERNEL
);
kzalloc
(
sizeof
(
struct
cifsFileInfo
),
GFP_KERNEL
);
}
if
(
file
->
private_data
==
NULL
)
...
...
@@ -476,7 +476,7 @@ static int initiate_cifs_search(const int xid, struct file *file)
cifsFile
->
srch_inf
.
info_level
=
SMB_FIND_FILE_DIRECTORY_INFO
;
}
rc
=
CIFSFindFirst
(
xid
,
pTcon
,
full_path
,
cifs_sb
->
local_nls
,
rc
=
CIFSFindFirst
(
xid
,
pTcon
,
full_path
,
cifs_sb
->
local_nls
,
&
cifsFile
->
netfid
,
&
cifsFile
->
srch_inf
,
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_MAP_SPECIAL_CHR
,
CIFS_DIR_SEP
(
cifs_sb
));
...
...
@@ -497,7 +497,7 @@ static int cifs_unicode_bytelen(char *str)
int
len
;
__le16
*
ustr
=
(
__le16
*
)
str
;
for
(
len
=
0
;
len
<=
PATH_MAX
;
len
++
)
{
for
(
len
=
0
;
len
<=
PATH_MAX
;
len
++
)
{
if
(
ustr
[
len
]
==
0
)
return
len
<<
1
;
}
...
...
@@ -507,7 +507,7 @@ static int cifs_unicode_bytelen(char *str)
static
char
*
nxt_dir_entry
(
char
*
old_entry
,
char
*
end_of_smb
,
int
level
)
{
char
*
new_entry
;
char
*
new_entry
;
FILE_DIRECTORY_INFO
*
pDirInfo
=
(
FILE_DIRECTORY_INFO
*
)
old_entry
;
if
(
level
==
SMB_FIND_FILE_INFO_STANDARD
)
{
...
...
@@ -526,10 +526,10 @@ static char *nxt_dir_entry(char *old_entry, char *end_of_smb, int level)
new_entry
,
end_of_smb
,
old_entry
));
return
NULL
;
}
else
if
(((
level
==
SMB_FIND_FILE_INFO_STANDARD
)
&&
(
new_entry
+
sizeof
(
FIND_FILE_STANDARD_INFO
)
>
end_of_smb
))
||
((
level
!=
SMB_FIND_FILE_INFO_STANDARD
)
&&
(
new_entry
+
sizeof
(
FIND_FILE_STANDARD_INFO
)
>
end_of_smb
))
||
((
level
!=
SMB_FIND_FILE_INFO_STANDARD
)
&&
(
new_entry
+
sizeof
(
FILE_DIRECTORY_INFO
)
>
end_of_smb
)))
{
cERROR
(
1
,(
"search entry %p extends after end of SMB %p"
,
cERROR
(
1
,
(
"search entry %p extends after end of SMB %p"
,
new_entry
,
end_of_smb
));
return
NULL
;
}
else
...
...
@@ -543,7 +543,7 @@ static char *nxt_dir_entry(char *old_entry, char *end_of_smb, int level)
static
int
cifs_entry_is_dot
(
char
*
current_entry
,
struct
cifsFileInfo
*
cfile
)
{
int
rc
=
0
;
char
*
filename
=
NULL
;
char
*
filename
=
NULL
;
int
len
=
0
;
if
(
cfile
->
srch_inf
.
info_level
==
SMB_FIND_FILE_UNIX
)
{
...
...
@@ -598,7 +598,7 @@ static int cifs_entry_is_dot(char *current_entry, struct cifsFileInfo *cfile)
}
else
if
(
len
==
4
)
{
/* check for .. */
if
((
ufilename
[
0
]
==
UNICODE_DOT
)
&&
(
ufilename
[
1
]
==
UNICODE_DOT
))
&&
(
ufilename
[
1
]
==
UNICODE_DOT
))
rc
=
2
;
}
}
else
/* ASCII */
{
...
...
@@ -617,7 +617,7 @@ static int cifs_entry_is_dot(char *current_entry, struct cifsFileInfo *cfile)
/* Check if directory that we are searching has changed so we can decide
whether we can use the cached search results from the previous search */
static
int
is_dir_changed
(
struct
file
*
file
)
static
int
is_dir_changed
(
struct
file
*
file
)
{
struct
inode
*
inode
=
file
->
f_path
.
dentry
->
d_inode
;
struct
cifsInodeInfo
*
cifsInfo
=
CIFS_I
(
inode
);
...
...
@@ -642,7 +642,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
int
pos_in_buf
=
0
;
loff_t
first_entry_in_buffer
;
loff_t
index_to_find
=
file
->
f_pos
;
struct
cifsFileInfo
*
cifsFile
=
file
->
private_data
;
struct
cifsFileInfo
*
cifsFile
=
file
->
private_data
;
/* check if index in the buffer */
if
((
cifsFile
==
NULL
)
||
(
ppCurrentEntry
==
NULL
)
||
...
...
@@ -681,7 +681,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
cifs_buf_release
(
cifsFile
->
srch_inf
.
ntwrk_buf_start
);
}
rc
=
initiate_cifs_search
(
xid
,
file
);
rc
=
initiate_cifs_search
(
xid
,
file
);
if
(
rc
)
{
cFYI
(
1
,
(
"error %d reinitiating a search on rewind"
,
rc
));
...
...
@@ -689,10 +689,10 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
}
}
while
((
index_to_find
>=
cifsFile
->
srch_inf
.
index_of_last_entry
)
&&
(
rc
==
0
)
&&
(
cifsFile
->
srch_inf
.
endOfSearch
==
FALSE
)){
while
((
index_to_find
>=
cifsFile
->
srch_inf
.
index_of_last_entry
)
&&
(
rc
==
0
)
&&
(
cifsFile
->
srch_inf
.
endOfSearch
==
FALSE
))
{
cFYI
(
1
,
(
"calling findnext2"
));
rc
=
CIFSFindNext
(
xid
,
pTcon
,
cifsFile
->
netfid
,
rc
=
CIFSFindNext
(
xid
,
pTcon
,
cifsFile
->
netfid
,
&
cifsFile
->
srch_inf
);
if
(
rc
)
return
-
ENOENT
;
...
...
@@ -701,8 +701,8 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
/* we found the buffer that contains the entry */
/* scan and find it */
int
i
;
char
*
current_entry
;
char
*
end_of_smb
=
cifsFile
->
srch_inf
.
ntwrk_buf_start
+
char
*
current_entry
;
char
*
end_of_smb
=
cifsFile
->
srch_inf
.
ntwrk_buf_start
+
smbCalcSize
((
struct
smb_hdr
*
)
cifsFile
->
srch_inf
.
ntwrk_buf_start
);
...
...
@@ -712,16 +712,16 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
pos_in_buf
=
index_to_find
-
first_entry_in_buffer
;
cFYI
(
1
,
(
"found entry - pos_in_buf %d"
,
pos_in_buf
));
for
(
i
=
0
;(
i
<
(
pos_in_buf
))
&&
(
current_entry
!=
NULL
);
i
++
)
{
for
(
i
=
0
;(
i
<
(
pos_in_buf
))
&&
(
current_entry
!=
NULL
);
i
++
)
{
/* go entry by entry figuring out which is first */
current_entry
=
nxt_dir_entry
(
current_entry
,
end_of_smb
,
current_entry
=
nxt_dir_entry
(
current_entry
,
end_of_smb
,
cifsFile
->
srch_inf
.
info_level
);
}
if
((
current_entry
==
NULL
)
&&
(
i
<
pos_in_buf
))
{
/* BB fixme - check if we should flag this error */
cERROR
(
1
,(
"reached end of buf searching for pos in buf"
cERROR
(
1
,
(
"reached end of buf searching for pos in buf"
" %d index to find %lld rc %d"
,
pos_in_buf
,
index_to_find
,
rc
));
pos_in_buf
,
index_to_find
,
rc
));
}
rc
=
0
;
*
ppCurrentEntry
=
current_entry
;
...
...
@@ -742,17 +742,17 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
/* inode num, inode type and filename returned */
static
int
cifs_get_name_from_search_buf
(
struct
qstr
*
pqst
,
char
*
current_entry
,
__u16
level
,
unsigned
int
unicode
,
struct
cifs_sb_info
*
cifs_sb
,
int
max_len
,
ino_t
*
pinum
)
struct
cifs_sb_info
*
cifs_sb
,
int
max_len
,
ino_t
*
pinum
)
{
int
rc
=
0
;
unsigned
int
len
=
0
;
char
*
filename
;
struct
nls_table
*
nlt
=
cifs_sb
->
local_nls
;
char
*
filename
;
struct
nls_table
*
nlt
=
cifs_sb
->
local_nls
;
*
pinum
=
0
;
if
(
level
==
SMB_FIND_FILE_UNIX
)
{
FILE_UNIX_INFO
*
pFindData
=
(
FILE_UNIX_INFO
*
)
current_entry
;
FILE_UNIX_INFO
*
pFindData
=
(
FILE_UNIX_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
if
(
unicode
)
{
...
...
@@ -762,27 +762,27 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
len
=
strnlen
(
filename
,
PATH_MAX
);
}
/* BB fixme - hash low and high 32 bits if not 64 bit arch BB
fixme
*/
/* BB fixme - hash low and high 32 bits if not 64 bit arch BB */
if
(
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_SERVER_INUM
)
*
pinum
=
pFindData
->
UniqueId
;
}
else
if
(
level
==
SMB_FIND_FILE_DIRECTORY_INFO
)
{
FILE_DIRECTORY_INFO
*
pFindData
=
FILE_DIRECTORY_INFO
*
pFindData
=
(
FILE_DIRECTORY_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
len
=
le32_to_cpu
(
pFindData
->
FileNameLength
);
}
else
if
(
level
==
SMB_FIND_FILE_FULL_DIRECTORY_INFO
)
{
FILE_FULL_DIRECTORY_INFO
*
pFindData
=
FILE_FULL_DIRECTORY_INFO
*
pFindData
=
(
FILE_FULL_DIRECTORY_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
len
=
le32_to_cpu
(
pFindData
->
FileNameLength
);
}
else
if
(
level
==
SMB_FIND_FILE_ID_FULL_DIR_INFO
)
{
SEARCH_ID_FULL_DIR_INFO
*
pFindData
=
SEARCH_ID_FULL_DIR_INFO
*
pFindData
=
(
SEARCH_ID_FULL_DIR_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
len
=
le32_to_cpu
(
pFindData
->
FileNameLength
);
*
pinum
=
pFindData
->
UniqueId
;
}
else
if
(
level
==
SMB_FIND_FILE_BOTH_DIRECTORY_INFO
)
{
FILE_BOTH_DIRECTORY_INFO
*
pFindData
=
FILE_BOTH_DIRECTORY_INFO
*
pFindData
=
(
FILE_BOTH_DIRECTORY_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
len
=
le32_to_cpu
(
pFindData
->
FileNameLength
);
...
...
@@ -798,7 +798,7 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
}
if
(
len
>
max_len
)
{
cERROR
(
1
,(
"bad search response length %d past smb end"
,
len
));
cERROR
(
1
,
(
"bad search response length %d past smb end"
,
len
));
return
-
EINVAL
;
}
...
...
@@ -810,12 +810,12 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
(
__le16
*
)
filename
,
len
/
2
,
nlt
);
else
pqst
->
len
=
cifs_strfromUCS_le
((
char
*
)
pqst
->
name
,
(
__le16
*
)
filename
,
len
/
2
,
nlt
);
(
__le16
*
)
filename
,
len
/
2
,
nlt
);
}
else
{
pqst
->
name
=
filename
;
pqst
->
len
=
len
;
}
pqst
->
hash
=
full_name_hash
(
pqst
->
name
,
pqst
->
len
);
pqst
->
hash
=
full_name_hash
(
pqst
->
name
,
pqst
->
len
);
/* cFYI(1, ("filldir on %s",pqst->name)); */
return
rc
;
}
...
...
@@ -825,10 +825,10 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
{
int
rc
=
0
;
struct
qstr
qstring
;
struct
cifsFileInfo
*
pCifsF
;
struct
cifsFileInfo
*
pCifsF
;
unsigned
obj_type
;
ino_t
inum
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifs_sb_info
*
cifs_sb
;
struct
inode
*
tmp_inode
;
struct
dentry
*
tmp_dentry
;
...
...
@@ -843,7 +843,7 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
if
((
scratch_buf
==
NULL
)
||
(
pfindEntry
==
NULL
)
||
(
pCifsF
==
NULL
))
return
-
ENOENT
;
rc
=
cifs_entry_is_dot
(
pfindEntry
,
pCifsF
);
rc
=
cifs_entry_is_dot
(
pfindEntry
,
pCifsF
);
/* skip . and .. since we added them first */
if
(
rc
!=
0
)
return
0
;
...
...
@@ -851,23 +851,24 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
cifs_sb
=
CIFS_SB
(
file
->
f_path
.
dentry
->
d_sb
);
qstring
.
name
=
scratch_buf
;
rc
=
cifs_get_name_from_search_buf
(
&
qstring
,
pfindEntry
,
rc
=
cifs_get_name_from_search_buf
(
&
qstring
,
pfindEntry
,
pCifsF
->
srch_inf
.
info_level
,
pCifsF
->
srch_inf
.
unicode
,
cifs_sb
,
pCifsF
->
srch_inf
.
unicode
,
cifs_sb
,
max_len
,
&
inum
/* returned */
);
if
(
rc
)
return
rc
;
rc
=
construct_dentry
(
&
qstring
,
file
,
&
tmp_inode
,
&
tmp_dentry
);
rc
=
construct_dentry
(
&
qstring
,
file
,
&
tmp_inode
,
&
tmp_dentry
);
if
((
tmp_inode
==
NULL
)
||
(
tmp_dentry
==
NULL
))
return
-
ENOMEM
;
if
(
rc
)
{
/* inode created, we need to hash it with right inode number */
if
(
inum
!=
0
)
{
/* BB fixme - hash the 2 32 quantities bits together if necessary BB */
/* BB fixme - hash the 2 32 quantities bits together if
* necessary BB */
tmp_inode
->
i_ino
=
inum
;
}
insert_inode_hash
(
tmp_inode
);
...
...
@@ -893,8 +894,8 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
}
rc
=
filldir
(
direntry
,
qstring
.
name
,
qstring
.
len
,
file
->
f_pos
,
tmp_inode
->
i_ino
,
obj_type
);
rc
=
filldir
(
direntry
,
qstring
.
name
,
qstring
.
len
,
file
->
f_pos
,
tmp_inode
->
i_ino
,
obj_type
);
if
(
rc
)
{
cFYI
(
1
,
(
"filldir rc = %d"
,
rc
));
/* we can not return filldir errors to the caller
...
...
@@ -913,7 +914,7 @@ static int cifs_save_resume_key(const char *current_entry,
int
rc
=
0
;
unsigned
int
len
=
0
;
__u16
level
;
char
*
filename
;
char
*
filename
;
if
((
cifsFile
==
NULL
)
||
(
current_entry
==
NULL
))
return
-
EINVAL
;
...
...
@@ -932,31 +933,31 @@ static int cifs_save_resume_key(const char *current_entry,
}
cifsFile
->
srch_inf
.
resume_key
=
pFindData
->
ResumeKey
;
}
else
if
(
level
==
SMB_FIND_FILE_DIRECTORY_INFO
)
{
FILE_DIRECTORY_INFO
*
pFindData
=
FILE_DIRECTORY_INFO
*
pFindData
=
(
FILE_DIRECTORY_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
len
=
le32_to_cpu
(
pFindData
->
FileNameLength
);
cifsFile
->
srch_inf
.
resume_key
=
pFindData
->
FileIndex
;
}
else
if
(
level
==
SMB_FIND_FILE_FULL_DIRECTORY_INFO
)
{
FILE_FULL_DIRECTORY_INFO
*
pFindData
=
FILE_FULL_DIRECTORY_INFO
*
pFindData
=
(
FILE_FULL_DIRECTORY_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
len
=
le32_to_cpu
(
pFindData
->
FileNameLength
);
cifsFile
->
srch_inf
.
resume_key
=
pFindData
->
FileIndex
;
}
else
if
(
level
==
SMB_FIND_FILE_ID_FULL_DIR_INFO
)
{
SEARCH_ID_FULL_DIR_INFO
*
pFindData
=
SEARCH_ID_FULL_DIR_INFO
*
pFindData
=
(
SEARCH_ID_FULL_DIR_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
len
=
le32_to_cpu
(
pFindData
->
FileNameLength
);
cifsFile
->
srch_inf
.
resume_key
=
pFindData
->
FileIndex
;
}
else
if
(
level
==
SMB_FIND_FILE_BOTH_DIRECTORY_INFO
)
{
FILE_BOTH_DIRECTORY_INFO
*
pFindData
=
FILE_BOTH_DIRECTORY_INFO
*
pFindData
=
(
FILE_BOTH_DIRECTORY_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
len
=
le32_to_cpu
(
pFindData
->
FileNameLength
);
cifsFile
->
srch_inf
.
resume_key
=
pFindData
->
FileIndex
;
}
else
if
(
level
==
SMB_FIND_FILE_INFO_STANDARD
)
{
FIND_FILE_STANDARD_INFO
*
pFindData
=
FIND_FILE_STANDARD_INFO
*
pFindData
=
(
FIND_FILE_STANDARD_INFO
*
)
current_entry
;
filename
=
&
pFindData
->
FileName
[
0
];
/* one byte length, no name conversion */
...
...
@@ -974,13 +975,13 @@ static int cifs_save_resume_key(const char *current_entry,
int
cifs_readdir
(
struct
file
*
file
,
void
*
direntry
,
filldir_t
filldir
)
{
int
rc
=
0
;
int
xid
,
i
;
int
xid
,
i
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifsTconInfo
*
pTcon
;
struct
cifsFileInfo
*
cifsFile
=
NULL
;
char
*
current_entry
;
char
*
current_entry
;
int
num_to_fill
=
0
;
char
*
tmp_buf
=
NULL
;
char
*
tmp_buf
=
NULL
;
char
*
end_of_smb
;
int
max_len
;
...
...
@@ -1015,7 +1016,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
if after then keep searching till find it */
if
(
file
->
private_data
==
NULL
)
{
rc
=
initiate_cifs_search
(
xid
,
file
);
rc
=
initiate_cifs_search
(
xid
,
file
);
cFYI
(
1
,
(
"initiate cifs search rc %d"
,
rc
));
if
(
rc
)
{
FreeXid
(
xid
);
...
...
@@ -1041,8 +1042,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
kfree(cifsFile->search_resume_name);
cifsFile->search_resume_name = NULL; */
rc
=
find_cifs_entry
(
xid
,
pTcon
,
file
,
&
current_entry
,
&
num_to_fill
);
rc
=
find_cifs_entry
(
xid
,
pTcon
,
file
,
&
current_entry
,
&
num_to_fill
);
if
(
rc
)
{
cFYI
(
1
,
(
"fce error %d"
,
rc
));
goto
rddir2_exit
;
...
...
fs/cifs/sess.c
View file @
3870253e
...
...
@@ -75,7 +75,7 @@ static __u32 cifs_ssetup_hdr(struct cifsSesInfo *ses, SESSION_SETUP_ANDX *pSMB)
return
capabilities
;
}
static
void
unicode_ssetup_strings
(
char
**
pbcc_area
,
struct
cifsSesInfo
*
ses
,
static
void
unicode_ssetup_strings
(
char
**
pbcc_area
,
struct
cifsSesInfo
*
ses
,
const
struct
nls_table
*
nls_cp
)
{
char
*
bcc_ptr
=
*
pbcc_area
;
...
...
@@ -130,7 +130,7 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses,
*
pbcc_area
=
bcc_ptr
;
}
static
void
ascii_ssetup_strings
(
char
**
pbcc_area
,
struct
cifsSesInfo
*
ses
,
static
void
ascii_ssetup_strings
(
char
**
pbcc_area
,
struct
cifsSesInfo
*
ses
,
const
struct
nls_table
*
nls_cp
)
{
char
*
bcc_ptr
=
*
pbcc_area
;
...
...
@@ -468,7 +468,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
/* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE);
bcc_ptr += LM2_SESS_KEY_SIZE; */
memcpy
(
bcc_ptr
,
(
char
*
)
v2_sess_key
,
sizeof
(
struct
ntlmv2_resp
));
memcpy
(
bcc_ptr
,
(
char
*
)
v2_sess_key
,
sizeof
(
struct
ntlmv2_resp
));
bcc_ptr
+=
sizeof
(
struct
ntlmv2_resp
);
kfree
(
v2_sess_key
);
if
(
ses
->
capabilities
&
CAP_UNICODE
)
{
...
...
fs/cifs/smbdes.c
View file @
3870253e
...
...
@@ -153,7 +153,7 @@ static uchar sbox[8][4][16] = {
};
static
void
permute
(
char
*
out
,
char
*
in
,
uchar
*
p
,
int
n
)
permute
(
char
*
out
,
char
*
in
,
uchar
*
p
,
int
n
)
{
int
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
...
...
@@ -202,18 +202,18 @@ dohash(char *out, char *in, char *key, int forw)
char
*
rl
;
/* Have to reduce stack usage */
pk1
=
kmalloc
(
56
+
56
+
64
+
64
,
GFP_KERNEL
);
if
(
pk1
==
NULL
)
pk1
=
kmalloc
(
56
+
56
+
64
+
64
,
GFP_KERNEL
);
if
(
pk1
==
NULL
)
return
;
ki
=
kmalloc
(
16
*
48
,
GFP_KERNEL
);
if
(
ki
==
NULL
)
{
if
(
ki
==
NULL
)
{
kfree
(
pk1
);
return
;
}
cd
=
pk1
+
56
;
pd1
=
cd
+
56
;
pd1
=
cd
+
56
;
rl
=
pd1
+
64
;
permute
(
pk1
,
key
,
perm1
,
56
);
...
...
@@ -247,7 +247,7 @@ dohash(char *out, char *in, char *key, int forw)
char
*
r2
;
/* r2[32] */
er
=
kmalloc
(
48
+
48
+
32
+
32
+
32
,
GFP_KERNEL
);
if
(
er
==
NULL
)
{
if
(
er
==
NULL
)
{
kfree
(
pk1
);
kfree
(
ki
);
return
;
...
...
@@ -327,8 +327,8 @@ smbhash(unsigned char *out, unsigned char *in, unsigned char *key, int forw)
char
*
keyb
;
/* keyb[64] */
unsigned
char
key2
[
8
];
outb
=
kmalloc
(
64
*
3
,
GFP_KERNEL
);
if
(
outb
==
NULL
)
outb
=
kmalloc
(
64
*
3
,
GFP_KERNEL
);
if
(
outb
==
NULL
)
return
;
inb
=
outb
+
64
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment