diff mbox

[V9fs-developer] p9 vs unix mode bits

Message ID CAGG-pUS434Yo4=vdqTRr544jMAcM88myLRHj8s3jA+8r7G3gGQ@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Geyslan G. Bem Sept. 29, 2013, 1:35 p.m. UTC
Hi maintainers,

I suggested yesterday eight p9 patches. Well, I would like to ask you
about this other.

Maybe after the ORing the mode bit never break when placed in a signed
integer, but merely to remain in conformity, I propose this change
since both p9 and unix mode bits are unsigned integers:

                res |= P9_DMDIR;
@@ -144,7 +144,7 @@ static umode_t p9mode2unixmode(struct
v9fs_session_info *v9ses,
        else if ((mode & P9_DMDEVICE) && (v9fs_proto_dotu(v9ses))
                 && (v9ses->nodev == 0)) {
                char type = 0, ext[32];
-               int major = -1, minor = -1;
+               unsigned int major = 0, minor = 0;

                strlcpy(ext, stat->extension, sizeof(ext));
                sscanf(ext, "%c %u %u", &type, &major, &minor);


Let me know what do you think.

Best Regards.

Geyslan Gregório Bem
hackingbits.com

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
diff mbox

Patch

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index b352457..ff46755 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -63,7 +63,7 @@  static const struct inode_operations
v9fs_symlink_inode_operations;

 static u32 unixmode2p9mode(struct v9fs_session_info *v9ses, umode_t mode)
 {
-       int res;
+       unsigned int res;
        res = mode & 0777;
        if (S_ISDIR(mode))