From owner-p4-projects@FreeBSD.ORG Fri Oct 27 23:02:21 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 823CB16A415; Fri, 27 Oct 2006 23:02:21 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A06E16A40F for ; Fri, 27 Oct 2006 23:02:21 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09AA843D4C for ; Fri, 27 Oct 2006 23:02:21 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9RN2Kr0053637 for ; Fri, 27 Oct 2006 23:02:20 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9RN2KhD053633 for perforce@freebsd.org; Fri, 27 Oct 2006 23:02:20 GMT (envelope-from marcel@freebsd.org) Date: Fri, 27 Oct 2006 23:02:20 GMT Message-Id: <200610272302.k9RN2KhD053633@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 108580 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2006 23:02:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=108580 Change 108580 by marcel@marcel_cluster on 2006/10/27 23:02:06 o In efifs_open(), f->f_fsdata may contain junk. Don't test for it. o In efifs_open(), s/if/while/ to remove all duplicated '/' characters in the path. o In efifs_open(), also test for EFI_ACCESS_DENIED to determine whether we should try to open in R/O mode. o In efifs_read() and efifs_write(), remove the call to twiddle(). Affected files ... .. //depot/projects/ia64/sys/boot/efi/libefi/efifs.c#10 edit Differences ... ==== //depot/projects/ia64/sys/boot/efi/libefi/efifs.c#10 (text+ko) ==== @@ -87,9 +87,6 @@ dev->d_unit >= fs_handle_count) return (EINVAL); - if (f->f_fsdata != NULL) - return (EBUSY); - status = BS->HandleProtocol(fs_handles[dev->d_unit], &sfs_guid, (VOID **)&fsif); if (EFI_ERROR(status)) @@ -119,7 +116,7 @@ while (*upath != '\0') { if (*upath == '/') { *cp = '\\'; - if (upath[1] == '/') + while (upath[1] == '/') upath++; } else *cp = *upath; @@ -131,7 +128,7 @@ /* Open the file. */ status = root->Open(root, &file, path, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, 0); - if (status == EFI_WRITE_PROTECTED) + if (status == EFI_ACCESS_DENIED || status == EFI_WRITE_PROTECTED) status = root->Open(root, &file, path, EFI_FILE_MODE_READ, 0); free(path); root->Close(root); @@ -172,7 +169,6 @@ if (sz > EFI_BLOCK_SIZE) sz = EFI_BLOCK_SIZE; status = file->Read(file, &sz, bufp); - twiddle(); if (EFI_ERROR(status)) return (status_to_errno(status)); if (sz == 0) @@ -202,7 +198,6 @@ if (sz > EFI_BLOCK_SIZE) sz = EFI_BLOCK_SIZE; status = file->Write(file, &sz, bufp); - twiddle(); if (EFI_ERROR(status)) return (status_to_errno(status)); if (sz == 0)