kernels/linux-2.4.0/fs/smbfs/proc.c
/*
 * Note that we are now returning the name as a reference to avoid
 * an extra copy, and that the upper/lower casing is done in place.
 *
 * Bugs Noted:
 * (1) Pathworks servers may pad the name with extra spaces.
 */
Note that we are now returning the name as a reference to avoid
an extra copy, and that the upper/lower casing is done in place.

Bugs Noted:
(1) Pathworks servers may pad the name with extra spaces.
Note that we are now returning the name as a reference to avoid an extra copy and that the upper / lower casing is done in place . Bugs Noted : ( 1 ) Pathworks servers may pad the name with extra spaces .
static __u8 *
smb_decode_dirent(struct smb_sb_info *server, __u8 *p, 
			struct cache_dirent *entry)
{
	int len;
	entry->ino = 0;
	p += SMB_STATUS_SIZE;	
	entry->name = p + 9;
	len = strlen(entry->name);
	if (len > 12)
		len = 12;
	while (len > 2 && entry->name[len-1] == ' ')
		len--;
	entry->len = len;
	switch (server->opt.case_handling) {
	case SMB_CASE_UPPER:
		str_upper(entry->name, len);
		break;
	case SMB_CASE_LOWER:
		str_lower(entry->name, len);
		break;
	default:
		break;
	}
	entry->len = server->convert(server->name_buf, SMB_MAXNAMELEN,
				     entry->name, len,
				     server->remote_nls, server->local_nls);
	entry->name = server->name_buf;
	DEBUG1("len=%d, name=%.*s\n", entry->len, entry->len, entry->name);
	return p + 22;
}
static __u8 * smb_decode_dirent ( struct smb_sb_info * server , __u8 * p , struct cache_dirent * entry ) { int len ; entry -> ino = 0 ; p += SMB_STATUS_SIZE ; entry -> name = p + 9 ; len = strlen ( entry -> name ) ; if ( len > 12 ) len = 12 ; while ( len > 2 && entry -> name [ len - 1 ] == ' ' ) len -- ; entry -> len = len ; switch ( server -> opt . case_handling ) { case SMB_CASE_UPPER : str_upper ( entry -> name , len ) ; break ; case SMB_CASE_LOWER : str_lower ( entry -> name , len ) ; break ; default : break ; } entry -> len = server -> convert ( server -> name_buf , SMB_MAXNAMELEN , entry -> name , len , server -> remote_nls , server -> local_nls ) ; entry -> name = server -> name_buf ; DEBUG1 ( " \n " , entry -> len , entry -> len , entry -> name ) ; return p + 22 ; }
Note that we are now returning the name as a reference to avoid
 an extra copy, and that the upper/lower casing is done in place.
Note that we are now returning the name as a reference to avoid an extra copy and that the upper / lower casing is done in place .
/*
	 * SMB doesn't have a concept of inode numbers ...
	 */ /* reserved (search_status) */ /*
	 * Trim trailing blanks for Pathworks servers
	 */ /* FIXME: These only work for ascii chars, and recent smbmount doesn't
	   allow the flag to be set anyway. Remove? */