[OpenAFS-devel] CopyOnWrite failure: ihandle.c Patch: Code Cleanup

Srikanth Vishwanathan vsrikanth@in.ibm.com
Tue, 2 Apr 2002 06:24:32 +0530


--0__=85256B8F0004CD468f9e8a93df938690918c85256B8F0004CD46
Content-type: text/plain; charset=us-ascii

Hello -

I have attached the patch as a text file in case you run into problems
with the one sent in the previous post.


(See attached file: ihandle.c.diff)

Thanks,

Srikanth.

--0__=85256B8F0004CD468f9e8a93df938690918c85256B8F0004CD46
Content-type: application/octet-stream; 
	name="ihandle.c.diff"
Content-Disposition: attachment; filename="ihandle.c.diff"
Content-transfer-encoding: base64

LS0tIGloYW5kbGUuYy5vcmlnaW5hbAlNb24gQXByICAxIDE4OjM1OjQ2IDIwMDIKKysrIGloYW5k
bGUuYwlNb24gQXByICAxIDE5OjA0OjMwIDIwMDIKQEAgLTI1OSwxMCArMjU5LDYgQEAKIAogICAg
IElIX0xPQ0sKIAotICAgIGlmICghaWhfSW5pdGVkKSB7Ci0JaWhfSW5pdGlhbGl6ZSgpOwotICAg
IH0KLQogICAgIC8qIERvIHdlIGFscmVhZHkgaGF2ZSBhbiBvcGVuIGZpbGUgaGFuZGxlIGZvciB0
aGlzIElub2RlPyAqLwogICAgIGZvciAoZmRQID0gaWhQLT5paF9mZHRhaWwgOyBmZFAgIT0gTlVM
TCA7IGZkUCA9IGZkUC0+ZmRfaWhwcmV2KSB7CiAJaWYgKGZkUC0+ZmRfc3RhdHVzICE9IEZEX0hB
TkRMRV9JTlVTRSkgewpAQCAtMjk4LDcgKzI5NCw3IEBACiAJYXNzZXJ0KGZkUC0+ZmRfc3RhdHVz
ID09IEZEX0hBTkRMRV9PUEVOKTsKIAlETExfREVMRVRFKGZkUCwgZmRMcnVIZWFkLCBmZExydVRh
aWwsIGZkX25leHQsIGZkX3ByZXYpOwogCURMTF9ERUxFVEUoZmRQLCBmZFAtPmZkX2loLT5paF9m
ZGhlYWQsIGZkUC0+ZmRfaWgtPmloX2ZkdGFpbCwKLQkJICAgZm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