commit 49f7cf73d9aad910ac8d9f431b5d57f7e2b4bb36
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Tue May 29 21:43:22 2007 -0400
use 2 bytes for namelen in odf cache dir dirents
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index
73af6dc66d678f3b32bc14c3e581adb96f7f9eae..551861109357286ebc0255a4055ab029b49ff8a5
100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -1289,6 +1289,7 @@ int odf_write_dirent(struct file *filp,
u64 ino, unsigned int d_type)
{
int err = 0;
+ __le16 le16;
__le32 le32;
__le64 le64;
unsigned char byte;
@@ -1312,10 +1313,10 @@ int odf_write_dirent(struct file *filp,
goto out;
/* name length */
- byte = (unsigned char)namelen;
- err = filp->f_op->write(filp, (char*)&byte,
- sizeof(unsigned char), &filp->f_pos);
- if (err != sizeof(unsigned char))
+ le16 = cpu_to_le16(namelen);
+ err = filp->f_op->write(filp, (char*)&le16,
+ sizeof(__le16), &filp->f_pos);
+ if (err != sizeof(__le16))
goto out;
/* type */
@@ -1347,6 +1348,7 @@ int odf_read_dirent(struct file *filp, c
{
int err = 0;
mm_segment_t oldfs;
+ __le16 le16;
__le32 le32;
__le64 le64;
unsigned char byte;
@@ -1378,13 +1380,13 @@ int odf_read_dirent(struct file *filp, c
*ino = le64_to_cpu(le64);
/* name length */
- err = filp->f_op->read(filp, (char*)&byte,
- sizeof(unsigned char), &filp->f_pos);
- if (err != sizeof(unsigned char)) {
+ err = filp->f_op->read(filp, (char*)&le16,
+ sizeof(__le16), &filp->f_pos);
+ if (err != sizeof(__le16)) {
err = -EIO;
goto out;
}
- *namelen = byte;
+ *namelen = le16_to_cpu(le16);
if (*namelen <= 0) {
err = -EFAULT;
goto out;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs