Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/smbfs do previous differently - pass ap->a_id down to...



details:   https://anonhg.NetBSD.org/src/rev/c1ac071c66b6
branches:  trunk
changeset: 543217:c1ac071c66b6
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Feb 19 13:51:24 2003 +0000

description:
do previous differently - pass ap->a_id down to smbfs_smb_lock()
and smbfs_smb_lockandx() as caddr_t, and mask it to 16bit value
in smbfs_smb_lockandx()
okayed by Martin

diffstat:

 sys/fs/smbfs/smbfs_smb.c   |  12 ++++++------
 sys/fs/smbfs/smbfs_subr.h  |   4 ++--
 sys/fs/smbfs/smbfs_vnops.c |   8 +++-----
 3 files changed, 11 insertions(+), 13 deletions(-)

diffs (103 lines):

diff -r 4ec47a085bd1 -r c1ac071c66b6 sys/fs/smbfs/smbfs_smb.c
--- a/sys/fs/smbfs/smbfs_smb.c  Wed Feb 19 12:58:53 2003 +0000
+++ b/sys/fs/smbfs/smbfs_smb.c  Wed Feb 19 13:51:24 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smbfs_smb.c,v 1.4 2003/02/19 12:44:47 martin Exp $     */
+/*     $NetBSD: smbfs_smb.c,v 1.5 2003/02/19 13:51:24 jdolecek Exp $   */
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -90,7 +90,7 @@
 }
 
 static int
-smbfs_smb_lockandx(struct smbnode *np, int op, u_int32_t pid, off_t start, off_t end,
+smbfs_smb_lockandx(struct smbnode *np, int op, caddr_t id, off_t start, off_t end,
        struct smb_cred *scred)
 {
        struct smb_share *ssp = np->n_mount->sm_share;
@@ -106,18 +106,18 @@
                return error;
        smb_rq_getrequest(rqp, &mbp);
        smb_rq_wstart(rqp);
-       mb_put_uint8(mbp, 0xff);                /* secondary command */
+       mb_put_uint8(mbp, 0xff);        /* secondary command */
        mb_put_uint8(mbp, 0);           /* MBZ */
        mb_put_uint16le(mbp, 0);
        mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM);
        mb_put_uint8(mbp, ltype);       /* locktype */
        mb_put_uint8(mbp, 0);           /* oplocklevel - 0 seems is NO_OPLOCK */
-       mb_put_uint32le(mbp, 0);                /* timeout - break immediately */
+       mb_put_uint32le(mbp, 0);        /* timeout - break immediately */
        mb_put_uint16le(mbp, op == SMB_LOCK_RELEASE ? 1 : 0);
        mb_put_uint16le(mbp, op == SMB_LOCK_RELEASE ? 0 : 1);
        smb_rq_wend(rqp);
        smb_rq_bstart(rqp);
-       mb_put_uint16le(mbp, pid);
+       mb_put_uint16le(mbp, (((long) id) & 0xffff));   /* process ID */
        mb_put_uint32le(mbp, start);
        mb_put_uint32le(mbp, end - start);
        smb_rq_bend(rqp);
@@ -127,7 +127,7 @@
 }
 
 int
-smbfs_smb_lock(struct smbnode *np, int op, int id,
+smbfs_smb_lock(struct smbnode *np, int op, caddr_t id,
        off_t start, off_t end, struct smb_cred *scred)
 {
        struct smb_share *ssp = np->n_mount->sm_share;
diff -r 4ec47a085bd1 -r c1ac071c66b6 sys/fs/smbfs/smbfs_subr.h
--- a/sys/fs/smbfs/smbfs_subr.h Wed Feb 19 12:58:53 2003 +0000
+++ b/sys/fs/smbfs/smbfs_subr.h Wed Feb 19 13:51:24 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smbfs_subr.h,v 1.3 2003/02/19 12:44:47 martin Exp $    */
+/*     $NetBSD: smbfs_subr.h,v 1.4 2003/02/19 13:51:25 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -134,7 +134,7 @@
 /*
  * smb level
  */
-int  smbfs_smb_lock(struct smbnode *np, int op, int id,
+int  smbfs_smb_lock(struct smbnode *np, int op, caddr_t id,
        off_t start, off_t end, struct smb_cred *scred);
 int  smbfs_smb_statfs2(struct smb_share *ssp, struct statfs *sbp,
        struct smb_cred *scred);
diff -r 4ec47a085bd1 -r c1ac071c66b6 sys/fs/smbfs/smbfs_vnops.c
--- a/sys/fs/smbfs/smbfs_vnops.c        Wed Feb 19 12:58:53 2003 +0000
+++ b/sys/fs/smbfs/smbfs_vnops.c        Wed Feb 19 13:51:24 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smbfs_vnops.c,v 1.4 2003/02/19 12:44:47 martin Exp $   */
+/*     $NetBSD: smbfs_vnops.c,v 1.5 2003/02/19 13:51:25 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -1047,8 +1047,6 @@
        struct vnode *vp = ap->a_vp;
        struct smbnode *np = VTOSMB(vp);
        struct flock *fl = ap->a_fl;
-       int id = 1 /* ap->a_id */;
-/*     int flags = ap->a_flags;*/
        struct proc *p = curproc;
        struct smb_cred scred;
        u_quad_t size;
@@ -1123,7 +1121,7 @@
                error = lf_advlock(ap, &np->n_lockf, size);
                if (error)
                        break;
-               error = smbfs_smb_lock(np, SMB_LOCK_EXCL, id, start, end, &scred);
+               error = smbfs_smb_lock(np, SMB_LOCK_EXCL,  ap->a_id, start, end, &scred);
                if (error) {
                        ap->a_op = F_UNLCK;
                        lf_advlock(ap, &np->n_lockf, size);
@@ -1131,7 +1129,7 @@
                break;
        case F_UNLCK:
                lf_advlock(ap, &np->n_lockf, size);
-               error = smbfs_smb_lock(np, SMB_LOCK_RELEASE, id, start, end, &scred);
+               error = smbfs_smb_lock(np, SMB_LOCK_RELEASE,  ap->a_id, start, end, &scred);
                break;
        case F_GETLK:
                error = lf_advlock(ap, &np->n_lockf, size);



Home | Main Index | Thread Index | Old Index