Patch: vfat and msdos against 2.1.80pre4

Gordon Chaffee (chaffee@CS.Berkeley.EDU)
Mon, 19 Jan 1998 14:29:19 -0800 (PST)


--HhRjF3vxpL
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Here is a patch for vfat and msdos that fixes some vfat bugs with
renaming that hadn't been ironed out in the dentry kernels. Its
taken quite awhile, but I finally think that alias handling and
renaming are working properly. It fixes a problem with removing
directories with the msdos filesystem when vfat longnames used to
exist within the directory, cleans up a bunch of cruft that is
no longer needed with dentries, and reformats all the added cvf
code that didn't match the indenting formats of all the files
that it had previously patched.

- Gordon

--HhRjF3vxpL
Content-Type: application/octet-stream
Content-Description: fat-2.1.80pre4.patch
Content-Disposition: attachment;
filename="fat-2.1.80pre4-1.patch"
Content-Transfer-Encoding: base64

ZGlmZiAtdXIgbGludXgtMi4xLjgwcHJlNC1jbGVhbi9mcy9kY2FjaGUuYyBsaW51eC9mcy9k
Y2FjaGUuYwotLS0gbGludXgtMi4xLjgwcHJlNC1jbGVhbi9mcy9kY2FjaGUuYwlNb24gSmFu
IDE5IDExOjMwOjAyIDE5OTgKKysrIGxpbnV4L2ZzL2RjYWNoZS5jCU1vbiBKYW4gMTkgMTE6
MzA6MzggMTk5OApAQCAtNjgsNiArNjgsNyBAQAogCWlmIChpbm9kZSkgewogCQlkZW50cnkt
PmRfaW5vZGUgPSBOVUxMOwogCQlsaXN0X2RlbCgmZGVudHJ5LT5kX2FsaWFzKTsKKwkJSU5J
VF9MSVNUX0hFQUQoJmRlbnRyeS0+ZF9hbGlhcyk7CiAJCWlmIChkZW50cnktPmRfb3AgJiYg
ZGVudHJ5LT5kX29wLT5kX2lwdXQpCiAJCQlkZW50cnktPmRfb3AtPmRfaXB1dChkZW50cnks
IGlub2RlKTsKIAkJZWxzZQpkaWZmIC11ciBsaW51eC0yLjEuODBwcmU0LWNsZWFuL2ZzL2Zh
dC9idWZmZXIuYyBsaW51eC9mcy9mYXQvYnVmZmVyLmMKLS0tIGxp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