mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
[CIFS] reduce checkpatch warnings
Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
@@ -461,7 +461,7 @@ A partial list of the supported mount options follows:
|
||||
cifsacl Report mode bits (e.g. on stat) based on the Windows ACL for
|
||||
the file. (EXPERIMENTAL)
|
||||
servern Specify the server 's netbios name (RFC1001 name) to use
|
||||
when attempting to setup a session to the server. This is
|
||||
when attempting to setup a session to the server.
|
||||
This is needed for mounting to some older servers (such
|
||||
as OS/2 or Windows 98 and Windows ME) since they do not
|
||||
support a default server name. A server name can be up
|
||||
|
||||
@@ -98,8 +98,7 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
|
||||
if (mid_entry->resp_buf) {
|
||||
cifs_dump_detail(mid_entry->resp_buf);
|
||||
cifs_dump_mem("existing buf: ",
|
||||
mid_entry->resp_buf,
|
||||
62 /* fixme */);
|
||||
mid_entry->resp_buf, 62);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ extern int cifsERROR;
|
||||
* ---------
|
||||
*/
|
||||
#else /* _CIFS_DEBUG */
|
||||
#define cERROR(button,prspec)
|
||||
#define cEVENT(format,arg...)
|
||||
#define cERROR(button, prspec)
|
||||
#define cEVENT(format, arg...)
|
||||
#define cFYI(button, prspec)
|
||||
#define cifserror(format,arg...)
|
||||
#define cifserror(format, arg...)
|
||||
#endif /* _CIFS_DEBUG */
|
||||
|
||||
#endif /* _H_CIFS_DEBUG */
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
*
|
||||
*/
|
||||
int
|
||||
cifs_strfromUCS_le(char *to, const __le16 * from,
|
||||
cifs_strfromUCS_le(char *to, const __le16 *from,
|
||||
int len, const struct nls_table *codepage)
|
||||
{
|
||||
int i;
|
||||
@@ -61,7 +61,7 @@ cifs_strfromUCS_le(char *to, const __le16 * from,
|
||||
*
|
||||
*/
|
||||
int
|
||||
cifs_strtoUCS(__le16 * to, const char *from, int len,
|
||||
cifs_strtoUCS(__le16 *to, const char *from, int len,
|
||||
const struct nls_table *codepage)
|
||||
{
|
||||
int charlen;
|
||||
|
||||
@@ -254,7 +254,8 @@ UniStrstr(const wchar_t *ucs1, const wchar_t *ucs2)
|
||||
const wchar_t *anchor2 = ucs2;
|
||||
|
||||
while (*ucs1) {
|
||||
if (*ucs1 == *ucs2) { /* Partial match found */
|
||||
if (*ucs1 == *ucs2) {
|
||||
/* Partial match found */
|
||||
ucs1++;
|
||||
ucs2++;
|
||||
} else {
|
||||
@@ -279,7 +280,8 @@ UniToupper(register wchar_t uc)
|
||||
{
|
||||
register const struct UniCaseRange *rp;
|
||||
|
||||
if (uc < sizeof (CifsUniUpperTable)) { /* Latin characters */
|
||||
if (uc < sizeof(CifsUniUpperTable)) {
|
||||
/* Latin characters */
|
||||
return uc + CifsUniUpperTable[uc]; /* Use base tables */
|
||||
} else {
|
||||
rp = CifsUniUpperRange; /* Use range tables */
|
||||
@@ -320,7 +322,8 @@ UniTolower(wchar_t uc)
|
||||
{
|
||||
register struct UniCaseRange *rp;
|
||||
|
||||
if (uc < sizeof (UniLowerTable)) { /* Latin characters */
|
||||
if (uc < sizeof(UniLowerTable)) {
|
||||
/* Latin characters */
|
||||
return uc + UniLowerTable[uc]; /* Use base tables */
|
||||
} else {
|
||||
rp = UniLowerRange; /* Use range tables */
|
||||
|
||||
@@ -46,8 +46,7 @@ static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
|
||||
static const struct cifs_sid sid_everyone = {
|
||||
1, 1, {0, 0, 0, 0, 0, 1}, {0} };
|
||||
/* group users */
|
||||
static const struct cifs_sid sid_user =
|
||||
{1, 2 , {0, 0, 0, 0, 0, 5}, {} };
|
||||
static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} };
|
||||
|
||||
|
||||
int match_sid(struct cifs_sid *ctsid)
|
||||
@@ -195,9 +194,9 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
|
||||
/* For deny ACEs we change the mask so that subsequent allow access
|
||||
control entries do not turn on the bits we are denying */
|
||||
if (type == ACCESS_DENIED) {
|
||||
if (flags & GENERIC_ALL) {
|
||||
if (flags & GENERIC_ALL)
|
||||
*pbits_to_set &= ~S_IRWXUGO;
|
||||
}
|
||||
|
||||
if ((flags & GENERIC_WRITE) ||
|
||||
((flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS))
|
||||
*pbits_to_set &= ~S_IWUGO;
|
||||
|
||||
@@ -203,9 +203,8 @@ cifs_put_super(struct super_block *sb)
|
||||
return;
|
||||
}
|
||||
rc = cifs_umount(sb, cifs_sb);
|
||||
if (rc) {
|
||||
if (rc)
|
||||
cERROR(1, ("cifs_umount failed with return code %d", rc));
|
||||
}
|
||||
#ifdef CONFIG_CIFS_DFS_UPCALL
|
||||
if (cifs_sb->mountdata) {
|
||||
kfree(cifs_sb->mountdata);
|
||||
|
||||
@@ -53,11 +53,11 @@ extern int SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses,
|
||||
extern int SendReceive2(const unsigned int /* xid */ , struct cifsSesInfo *,
|
||||
struct kvec *, int /* nvec to send */,
|
||||
int * /* type of buf returned */ , const int flags);
|
||||
extern int SendReceiveBlockingLock(const unsigned int /* xid */ ,
|
||||
struct cifsTconInfo *,
|
||||
struct smb_hdr * /* input */ ,
|
||||
struct smb_hdr * /* out */ ,
|
||||
int * /* bytes returned */);
|
||||
extern int SendReceiveBlockingLock(const unsigned int xid,
|
||||
struct cifsTconInfo *ptcon,
|
||||
struct smb_hdr *in_buf ,
|
||||
struct smb_hdr *out_buf,
|
||||
int *bytes_returned);
|
||||
extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length);
|
||||
extern int is_valid_oplock_break(struct smb_hdr *smb, struct TCP_Server_Info *);
|
||||
extern int is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
|
||||
@@ -84,7 +84,7 @@ extern __u16 GetNextMid(struct TCP_Server_Info *server);
|
||||
extern struct oplock_q_entry *AllocOplockQEntry(struct inode *, u16,
|
||||
struct cifsTconInfo *);
|
||||
extern void DeleteOplockQEntry(struct oplock_q_entry *);
|
||||
extern struct timespec cifs_NTtimeToUnix(u64 /* utc nanoseconds since 1601 */ );
|
||||
extern struct timespec cifs_NTtimeToUnix(u64 utc_nanoseconds_since_1601);
|
||||
extern u64 cifs_UnixTimeToNT(struct timespec);
|
||||
extern __le64 cnvrtDosCifsTm(__u16 date, __u16 time);
|
||||
extern struct timespec cnvrtDosUnixTm(__u16 date, __u16 time);
|
||||
@@ -175,11 +175,11 @@ extern int CIFSSMBQFSPosixInfo(const int xid, struct cifsTconInfo *tcon,
|
||||
struct kstatfs *FSData);
|
||||
|
||||
extern int CIFSSMBSetTimes(const int xid, struct cifsTconInfo *tcon,
|
||||
const char *fileName, const FILE_BASIC_INFO * data,
|
||||
const char *fileName, const FILE_BASIC_INFO *data,
|
||||
const struct nls_table *nls_codepage,
|
||||
int remap_special_chars);
|
||||
extern int CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
|
||||
const FILE_BASIC_INFO * data, __u16 fid);
|
||||
const FILE_BASIC_INFO *data, __u16 fid);
|
||||
#if 0
|
||||
extern int CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon,
|
||||
char *fileName, __u16 dos_attributes,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* vfs operations that deal with dentries
|
||||
*
|
||||
* Copyright (C) International Business Machines Corp., 2002,2007
|
||||
* Copyright (C) International Business Machines Corp., 2002,2008
|
||||
* Author(s): Steve French (sfrench@us.ibm.com)
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
@@ -111,16 +111,6 @@ cifs_bp_rename_retry:
|
||||
return full_path;
|
||||
}
|
||||
|
||||
/* char * build_wildcard_path_from_dentry(struct dentry *direntry)
|
||||
{
|
||||
if(full_path == NULL)
|
||||
return full_path;
|
||||
|
||||
full_path[namelen] = '\\';
|
||||
full_path[namelen+1] = '*';
|
||||
full_path[namelen+2] = 0;
|
||||
BB remove above eight lines BB */
|
||||
|
||||
/* Inode operations in similar order to how they appear in Linux file fs.h */
|
||||
|
||||
int
|
||||
@@ -171,9 +161,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
|
||||
disposition = FILE_OVERWRITE_IF;
|
||||
else if ((oflags & O_CREAT) == O_CREAT)
|
||||
disposition = FILE_OPEN_IF;
|
||||
else {
|
||||
else
|
||||
cFYI(1, ("Create flag not set in create function"));
|
||||
}
|
||||
}
|
||||
|
||||
/* BB add processing to set equivalent of mode - e.g. via CreateX with
|
||||
@@ -367,7 +356,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
|
||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
|
||||
int oplock = 0;
|
||||
u16 fileHandle;
|
||||
FILE_ALL_INFO * buf;
|
||||
FILE_ALL_INFO *buf;
|
||||
|
||||
cFYI(1, ("sfu compat create special file"));
|
||||
|
||||
@@ -534,9 +523,8 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
|
||||
int isValid = 1;
|
||||
|
||||
if (direntry->d_inode) {
|
||||
if (cifs_revalidate(direntry)) {
|
||||
if (cifs_revalidate(direntry))
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
cFYI(1, ("neg dentry 0x%p name = %s",
|
||||
direntry, direntry->d_name.name));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* fs/cifs/dns_resolve.h -- DNS Resolver upcall management for CIFS DFS
|
||||
* Handles host name to IP address resolution
|
||||
*
|
||||
*
|
||||
* Copyright (c) International Business Machines Corp., 2008
|
||||
* Author(s): Steve French (sfrench@us.ibm.com)
|
||||
*
|
||||
|
||||
@@ -35,9 +35,8 @@ static __u32 convert_to_cifs_notify_flags(unsigned long fcntl_notify_flags)
|
||||
|
||||
/* No way on Linux VFS to ask to monitor xattr
|
||||
changes (and no stream support either */
|
||||
if (fcntl_notify_flags & DN_ACCESS) {
|
||||
if (fcntl_notify_flags & DN_ACCESS)
|
||||
cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_LAST_ACCESS;
|
||||
}
|
||||
if (fcntl_notify_flags & DN_MODIFY) {
|
||||
/* What does this mean on directories? */
|
||||
cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_LAST_WRITE |
|
||||
@@ -47,9 +46,8 @@ static __u32 convert_to_cifs_notify_flags(unsigned long fcntl_notify_flags)
|
||||
cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_CREATION |
|
||||
FILE_NOTIFY_CHANGE_LAST_WRITE;
|
||||
}
|
||||
if (fcntl_notify_flags & DN_DELETE) {
|
||||
if (fcntl_notify_flags & DN_DELETE)
|
||||
cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_LAST_WRITE;
|
||||
}
|
||||
if (fcntl_notify_flags & DN_RENAME) {
|
||||
/* BB review this - checking various server behaviors */
|
||||
cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_DIR_NAME |
|
||||
|
||||
@@ -353,9 +353,9 @@ static int cifs_reopen_file(struct file *file, int can_flush)
|
||||
int disposition = FILE_OPEN;
|
||||
__u16 netfid;
|
||||
|
||||
if (file->private_data) {
|
||||
if (file->private_data)
|
||||
pCifsFile = (struct cifsFileInfo *)file->private_data;
|
||||
} else
|
||||
else
|
||||
return -EBADF;
|
||||
|
||||
xid = GetXid();
|
||||
@@ -1423,9 +1423,8 @@ static int cifs_writepage(struct page *page, struct writeback_control *wbc)
|
||||
xid = GetXid();
|
||||
/* BB add check for wbc flags */
|
||||
page_cache_get(page);
|
||||
if (!PageUptodate(page)) {
|
||||
if (!PageUptodate(page))
|
||||
cFYI(1, ("ppw - page not up to date"));
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the "writeback" flag, and clear "dirty" in the radix tree.
|
||||
@@ -1460,9 +1459,9 @@ static int cifs_commit_write(struct file *file, struct page *page,
|
||||
cFYI(1, ("commit write for page %p up to position %lld for %d",
|
||||
page, position, to));
|
||||
spin_lock(&inode->i_lock);
|
||||
if (position > inode->i_size) {
|
||||
if (position > inode->i_size)
|
||||
i_size_write(inode, position);
|
||||
}
|
||||
|
||||
spin_unlock(&inode->i_lock);
|
||||
if (!PageUptodate(page)) {
|
||||
position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset;
|
||||
@@ -1596,9 +1595,9 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
|
||||
}
|
||||
open_file = (struct cifsFileInfo *)file->private_data;
|
||||
|
||||
if ((file->f_flags & O_ACCMODE) == O_WRONLY) {
|
||||
if ((file->f_flags & O_ACCMODE) == O_WRONLY)
|
||||
cFYI(1, ("attempting read on write only file instance"));
|
||||
}
|
||||
|
||||
for (total_read = 0, current_offset = read_data;
|
||||
read_size > total_read;
|
||||
total_read += bytes_read, current_offset += bytes_read) {
|
||||
@@ -1625,9 +1624,8 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
|
||||
smb_read_data +
|
||||
4 /* RFC1001 length field */ +
|
||||
le16_to_cpu(pSMBr->DataOffset),
|
||||
bytes_read)) {
|
||||
bytes_read))
|
||||
rc = -EFAULT;
|
||||
}
|
||||
|
||||
if (buf_type == CIFS_SMALL_BUFFER)
|
||||
cifs_small_buf_release(smb_read_data);
|
||||
@@ -2026,7 +2024,7 @@ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
|
||||
struct cifs_sb_info *cifs_sb;
|
||||
|
||||
cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb);
|
||||
if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) {
|
||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
|
||||
/* since no page cache to corrupt on directio
|
||||
we can change size safely */
|
||||
return 1;
|
||||
|
||||
@@ -490,9 +490,9 @@ int cifs_get_inode_info(struct inode **pinode,
|
||||
if (decode_sfu_inode(inode,
|
||||
le64_to_cpu(pfindData->EndOfFile),
|
||||
search_path,
|
||||
cifs_sb, xid)) {
|
||||
cifs_sb, xid))
|
||||
cFYI(1, ("Unrecognized sfu inode type"));
|
||||
}
|
||||
|
||||
cFYI(1, ("sfu mode 0%o", inode->i_mode));
|
||||
} else {
|
||||
inode->i_mode |= S_IFREG;
|
||||
@@ -1198,9 +1198,8 @@ int cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
|
||||
} /* if we can not get memory just leave rc as EEXIST */
|
||||
}
|
||||
|
||||
if (rc) {
|
||||
if (rc)
|
||||
cFYI(1, ("rename rc %d", rc));
|
||||
}
|
||||
|
||||
if ((rc == -EIO) || (rc == -EEXIST)) {
|
||||
int oplock = FALSE;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#define CIFS_IOC_CHECKUMOUNT _IO(0xCF, 2)
|
||||
|
||||
int cifs_ioctl (struct inode *inode, struct file *filep,
|
||||
int cifs_ioctl(struct inode *inode, struct file *filep,
|
||||
unsigned int command, unsigned long arg)
|
||||
{
|
||||
int rc = -ENOTTY; /* strange error - but the precedent */
|
||||
|
||||
@@ -56,7 +56,7 @@ lshift(__u32 x, int s)
|
||||
|
||||
/* this applies md4 to 64 byte chunks */
|
||||
static void
|
||||
mdfour64(__u32 * M, __u32 * A, __u32 *B, __u32 * C, __u32 *D)
|
||||
mdfour64(__u32 *M, __u32 *A, __u32 *B, __u32 *C, __u32 *D)
|
||||
{
|
||||
int j;
|
||||
__u32 AA, BB, CC, DD;
|
||||
@@ -137,7 +137,7 @@ mdfour64(__u32 * M, __u32 * A, __u32 *B, __u32 * C, __u32 *D)
|
||||
}
|
||||
|
||||
static void
|
||||
copy64(__u32 * M, unsigned char *in)
|
||||
copy64(__u32 *M, unsigned char *in)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx)
|
||||
|
||||
/* This is the central step in the MD5 algorithm. */
|
||||
#define MD5STEP(f, w, x, y, z, data, s) \
|
||||
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
|
||||
(w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x)
|
||||
|
||||
/*
|
||||
* The core of the MD5 algorithm, this alters an existing MD5 hash to
|
||||
@@ -302,9 +302,8 @@ hmac_md5_init_limK_to_64(const unsigned char *key, int key_len,
|
||||
int i;
|
||||
|
||||
/* if key is longer than 64 bytes truncate it */
|
||||
if (key_len > 64) {
|
||||
if (key_len > 64)
|
||||
key_len = 64;
|
||||
}
|
||||
|
||||
/* start out by storing key in pads */
|
||||
memset(ctx->k_ipad, 0, sizeof(ctx->k_ipad));
|
||||
@@ -359,9 +358,9 @@ hmac_md5(unsigned char key[16], unsigned char *data, int data_len,
|
||||
{
|
||||
struct HMACMD5Context ctx;
|
||||
hmac_md5_init_limK_to_64(key, 16, &ctx);
|
||||
if (data_len != 0) {
|
||||
if (data_len != 0)
|
||||
hmac_md5_update(data, data_len, &ctx);
|
||||
}
|
||||
|
||||
hmac_md5_final(digest, &ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* fs/cifs/misc.c
|
||||
*
|
||||
* Copyright (C) International Business Machines Corp., 2002,2007
|
||||
* Copyright (C) International Business Machines Corp., 2002,2008
|
||||
* Author(s): Steve French (sfrench@us.ibm.com)
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
@@ -320,9 +320,9 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
|
||||
if (treeCon->ses) {
|
||||
if (treeCon->ses->capabilities & CAP_UNICODE)
|
||||
buffer->Flags2 |= SMBFLG2_UNICODE;
|
||||
if (treeCon->ses->capabilities & CAP_STATUS32) {
|
||||
if (treeCon->ses->capabilities & CAP_STATUS32)
|
||||
buffer->Flags2 |= SMBFLG2_ERR_STATUS;
|
||||
}
|
||||
|
||||
/* Uid is not converted */
|
||||
buffer->Uid = treeCon->ses->Suid;
|
||||
buffer->Mid = GetNextMid(treeCon->ses->server);
|
||||
@@ -610,7 +610,8 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
|
||||
|
||||
buffer = (unsigned char *) smb_buf;
|
||||
for (i = 0, j = 0; i < smb_buf_length; i++, j++) {
|
||||
if (i % 8 == 0) { /* have reached the beginning of line */
|
||||
if (i % 8 == 0) {
|
||||
/* have reached the beginning of line */
|
||||
printk(KERN_DEBUG "| ");
|
||||
j = 0;
|
||||
}
|
||||
@@ -621,7 +622,8 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
|
||||
else
|
||||
debug_line[1 + (2 * j)] = '_';
|
||||
|
||||
if (i % 8 == 7) { /* reached end of line, time to print ascii */
|
||||
if (i % 8 == 7) {
|
||||
/* reached end of line, time to print ascii */
|
||||
debug_line[16] = 0;
|
||||
printk(" | %s\n", debug_line);
|
||||
}
|
||||
@@ -631,7 +633,7 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
|
||||
debug_line[2 * j] = ' ';
|
||||
debug_line[1 + (2 * j)] = ' ';
|
||||
}
|
||||
printk( " | %s\n", debug_line);
|
||||
printk(" | %s\n", debug_line);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* fs/cifs/netmisc.c
|
||||
*
|
||||
* Copyright (c) International Business Machines Corp., 2002
|
||||
* Copyright (c) International Business Machines Corp., 2002,2008
|
||||
* Author(s): Steve French (sfrench@us.ibm.com)
|
||||
*
|
||||
* Error mapping routines from Samba libsmb/errormap.c
|
||||
@@ -253,7 +253,8 @@ static const struct {
|
||||
ERRDOS, 87, NT_STATUS_INVALID_PARAMETER_MIX}, {
|
||||
ERRHRD, ERRgeneral, NT_STATUS_INVALID_QUOTA_LOWER}, {
|
||||
ERRHRD, ERRgeneral, NT_STATUS_DISK_CORRUPT_ERROR}, {
|
||||
ERRDOS, ERRbadfile, NT_STATUS_OBJECT_NAME_INVALID}, { /* mapping changed since shell does lookup on * and expects file not found */
|
||||
/* mapping changed since shell does lookup on * expects FileNotFound */
|
||||
ERRDOS, ERRbadfile, NT_STATUS_OBJECT_NAME_INVALID}, {
|
||||
ERRDOS, ERRbadfile, NT_STATUS_OBJECT_NAME_NOT_FOUND}, {
|
||||
ERRDOS, ERRalreadyexists, NT_STATUS_OBJECT_NAME_COLLISION}, {
|
||||
ERRHRD, ERRgeneral, NT_STATUS_HANDLE_NOT_WAITABLE}, {
|
||||
@@ -820,7 +821,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
|
||||
/* old style errors */
|
||||
|
||||
/* DOS class smb error codes - map DOS */
|
||||
if (smberrclass == ERRDOS) { /* 1 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) /
|
||||
@@ -834,7 +836,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
|
||||
}
|
||||
/* else try next error mapping one to see if match */
|
||||
}
|
||||
} else if (smberrclass == ERRSRV) { /* server class of error codes */
|
||||
} else if (smberrclass == ERRSRV) {
|
||||
/* server class of error codes */
|
||||
for (i = 0;
|
||||
i <
|
||||
sizeof(mapping_table_ERRSRV) /
|
||||
@@ -922,8 +925,8 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
|
||||
{
|
||||
struct timespec ts;
|
||||
int sec, min, days, month, year;
|
||||
SMB_TIME * st = (SMB_TIME *)&time;
|
||||
SMB_DATE * sd = (SMB_DATE *)&date;
|
||||
SMB_TIME *st = (SMB_TIME *)&time;
|
||||
SMB_DATE *sd = (SMB_DATE *)&date;
|
||||
|
||||
cFYI(1, ("date %d time %d", date, time));
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Directory search handling
|
||||
*
|
||||
* Copyright (C) International Business Machines Corp., 2004, 2007
|
||||
* Copyright (C) International Business Machines Corp., 2004, 2008
|
||||
* Author(s): Steve French (sfrench@us.ibm.com)
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
@@ -42,15 +42,12 @@ static void dump_cifs_file_struct(struct file *file, char *label)
|
||||
cFYI(1, ("empty cifs private file data"));
|
||||
return;
|
||||
}
|
||||
if (cf->invalidHandle) {
|
||||
if (cf->invalidHandle)
|
||||
cFYI(1, ("invalid handle"));
|
||||
}
|
||||
if (cf->srch_inf.endOfSearch) {
|
||||
if (cf->srch_inf.endOfSearch)
|
||||
cFYI(1, ("end of search"));
|
||||
}
|
||||
if (cf->srch_inf.emptyDir) {
|
||||
if (cf->srch_inf.emptyDir)
|
||||
cFYI(1, ("empty dir"));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* DEBUG2 */
|
||||
@@ -150,7 +147,7 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
|
||||
cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));
|
||||
} else { /* legacy, OS2 and DOS style */
|
||||
/* struct timespec ts;*/
|
||||
FIND_FILE_STANDARD_INFO * pfindData =
|
||||
FIND_FILE_STANDARD_INFO *pfindData =
|
||||
(FIND_FILE_STANDARD_INFO *)buf;
|
||||
|
||||
tmp_inode->i_mtime = cnvrtDosUnixTm(
|
||||
@@ -198,9 +195,8 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
|
||||
if (attr & ATTR_DIRECTORY) {
|
||||
*pobject_type = DT_DIR;
|
||||
/* override default perms since we do not lock dirs */
|
||||
if (atomic_read(&cifsInfo->inUse) == 0) {
|
||||
if (atomic_read(&cifsInfo->inUse) == 0)
|
||||
tmp_inode->i_mode = cifs_sb->mnt_dir_mode;
|
||||
}
|
||||
tmp_inode->i_mode |= S_IFDIR;
|
||||
} else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
|
||||
(attr & ATTR_SYSTEM)) {
|
||||
@@ -231,9 +227,8 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
|
||||
} /* could add code here - to validate if device or weird share type? */
|
||||
|
||||
/* can not fill in nlink here as in qpathinfo version and Unx search */
|
||||
if (atomic_read(&cifsInfo->inUse) == 0) {
|
||||
if (atomic_read(&cifsInfo->inUse) == 0)
|
||||
atomic_set(&cifsInfo->inUse, 1);
|
||||
}
|
||||
|
||||
spin_lock(&tmp_inode->i_lock);
|
||||
if (is_size_safe_to_change(cifsInfo, end_of_file)) {
|
||||
@@ -461,9 +456,8 @@ static int initiate_cifs_search(const int xid, struct file *file)
|
||||
|
||||
full_path = build_path_from_dentry(file->f_path.dentry);
|
||||
|
||||
if (full_path == NULL) {
|
||||
if (full_path == NULL)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
cFYI(1, ("Full path: %s start at: %lld", full_path, file->f_pos));
|
||||
|
||||
@@ -471,9 +465,9 @@ ffirst_retry:
|
||||
/* test for Unix extensions */
|
||||
/* but now check for them on the share/mount not on the SMB session */
|
||||
/* if (pTcon->ses->capabilities & CAP_UNIX) { */
|
||||
if (pTcon->unix_ext) {
|
||||
if (pTcon->unix_ext)
|
||||
cifsFile->srch_inf.info_level = SMB_FIND_FILE_UNIX;
|
||||
} else if ((pTcon->ses->capabilities &
|
||||
else if ((pTcon->ses->capabilities &
|
||||
(CAP_NT_SMBS | CAP_NT_FIND)) == 0) {
|
||||
cifsFile->srch_inf.info_level = SMB_FIND_FILE_INFO_STANDARD;
|
||||
} else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
|
||||
@@ -514,10 +508,10 @@ static int cifs_unicode_bytelen(char *str)
|
||||
static char *nxt_dir_entry(char *old_entry, char *end_of_smb, int level)
|
||||
{
|
||||
char *new_entry;
|
||||
FILE_DIRECTORY_INFO * pDirInfo = (FILE_DIRECTORY_INFO *)old_entry;
|
||||
FILE_DIRECTORY_INFO *pDirInfo = (FILE_DIRECTORY_INFO *)old_entry;
|
||||
|
||||
if (level == SMB_FIND_FILE_INFO_STANDARD) {
|
||||
FIND_FILE_STANDARD_INFO * pfData;
|
||||
FIND_FILE_STANDARD_INFO *pfData;
|
||||
pfData = (FIND_FILE_STANDARD_INFO *)pDirInfo;
|
||||
|
||||
new_entry = old_entry + sizeof(FIND_FILE_STANDARD_INFO) +
|
||||
@@ -553,7 +547,7 @@ static int cifs_entry_is_dot(char *current_entry, struct cifsFileInfo *cfile)
|
||||
int len = 0;
|
||||
|
||||
if (cfile->srch_inf.info_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 (cfile->srch_inf.unicode) {
|
||||
len = cifs_unicode_bytelen(filename);
|
||||
@@ -562,30 +556,30 @@ static int cifs_entry_is_dot(char *current_entry, struct cifsFileInfo *cfile)
|
||||
len = strnlen(filename, 5);
|
||||
}
|
||||
} else if (cfile->srch_inf.info_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 (cfile->srch_inf.info_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 (cfile->srch_inf.info_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);
|
||||
} else if (cfile->srch_inf.info_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);
|
||||
} else if (cfile->srch_inf.info_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];
|
||||
len = pFindData->FileNameLength;
|
||||
@@ -718,7 +712,7 @@ 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,
|
||||
cifsFile->srch_inf.info_level);
|
||||
@@ -793,7 +787,7 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
|
||||
filename = &pFindData->FileName[0];
|
||||
len = le32_to_cpu(pFindData->FileNameLength);
|
||||
} 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 */
|
||||
@@ -928,7 +922,7 @@ static int cifs_save_resume_key(const char *current_entry,
|
||||
level = cifsFile->srch_inf.info_level;
|
||||
|
||||
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 (cifsFile->srch_inf.unicode) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user