Re: [PATCH] reorder major-0 devices (was Re: [PATCH] implement /proc/sysvipc/*)

2011-04-04 Thread Corinna Vinschen
On Apr  3 16:54, Yaakov (Cygwin/X) wrote:
 On Fri, 2011-04-01 at 23:33 +0200, Corinna Vinschen wrote:
  On Apr  1 14:57, Yaakov (Cygwin/X) wrote:
   For the sake of clarity, I would reorder it a bit further to
   make FH_PROC and friends to one side of major-0 and everything else to
   the other side:
   
 /* begin /proc directories */
 FH_PROC= FHDEV (0, 255),
 FH_REGISTRY= FHDEV (0, 254),
 FH_PROCNET = FHDEV (0, 253),
 FH_PROCESSFD = FHDEV (0, 252),
 FH_PROCSYS = FHDEV (0, 251),
 FH_PROCSYSVIPC = FHDEV (0,250),
   
 FH_PROC_MIN_MINOR = FHDEV (0,200),
 /* end /proc directories */
   
 FH_PIPE= FHDEV (0, 199),
 FH_PIPER   = FHDEV (0, 198),
 FH_PIPEW   = FHDEV (0, 197),
 FH_FIFO= FHDEV (0, 196),
 FH_PROCESS = FHDEV (0, 195),
 FH_FS  = FHDEV (0, 194),/* filesystem based device */
 FH_NETDRIVE= FHDEV (0, 193),
 FH_DEV = FHDEV (0, 192),
   
   As either way this should be a separate changeset IMHO, I have committed
   my patch as is and will follow this up on Sunday.
  
  Sounds ok to me.
 
 Patch attached.
 
 
 Yaakov
 

 2011-03-04  Yaakov Selkowitz  ...
   Corinna Vinschen  ...

Bzzz.  Please, don't quote raw email addresses, not even as part of
a patch submission.  Especially don't quote my raw email address.

   * devices.h (fh_devices): Define FH_PROC_MIN_MINOR.
   Reorder major-0 devices so that all /proc directories fall
   between FH_PROC and FH_PROC_MIN_MINOR.
   * path.h (isproc_dev): Redefine accordingly.

Looks good.  Please apply.


Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


[PATCH] reorder major-0 devices (was Re: [PATCH] implement /proc/sysvipc/*)

2011-04-03 Thread Yaakov (Cygwin/X)
On Fri, 2011-04-01 at 23:33 +0200, Corinna Vinschen wrote:
 On Apr  1 14:57, Yaakov (Cygwin/X) wrote:
  For the sake of clarity, I would reorder it a bit further to
  make FH_PROC and friends to one side of major-0 and everything else to
  the other side:
  
/* begin /proc directories */
FH_PROC= FHDEV (0, 255),
FH_REGISTRY= FHDEV (0, 254),
FH_PROCNET = FHDEV (0, 253),
FH_PROCESSFD = FHDEV (0, 252),
FH_PROCSYS = FHDEV (0, 251),
FH_PROCSYSVIPC = FHDEV (0,250),
  
FH_PROC_MIN_MINOR = FHDEV (0,200),
/* end /proc directories */
  
FH_PIPE= FHDEV (0, 199),
FH_PIPER   = FHDEV (0, 198),
FH_PIPEW   = FHDEV (0, 197),
FH_FIFO= FHDEV (0, 196),
FH_PROCESS = FHDEV (0, 195),
FH_FS  = FHDEV (0, 194),  /* filesystem based device */
FH_NETDRIVE= FHDEV (0, 193),
FH_DEV = FHDEV (0, 192),
  
  As either way this should be a separate changeset IMHO, I have committed
  my patch as is and will follow this up on Sunday.
 
 Sounds ok to me.

Patch attached.


Yaakov

2011-03-04  Yaakov Selkowitz  yselkow...@users.sourceforge.net
	Corinna Vinschen  cori...@vinschen.de

	* devices.h (fh_devices): Define FH_PROC_MIN_MINOR.
	Reorder major-0 devices so that all /proc directories fall
	between FH_PROC and FH_PROC_MIN_MINOR.
	* path.h (isproc_dev): Redefine accordingly.

Index: devices.h
===
RCS file: /cvs/src/src/winsup/cygwin/devices.h,v
retrieving revision 1.27
diff -u -r1.27 devices.h
--- devices.h	1 Apr 2011 19:48:19 -	1.27
+++ devices.h	3 Apr 2011 21:46:44 -
@@ -1,6 +1,6 @@
 /* devices.h
 
-   Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010 Red Hat, Inc.
+   Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -39,22 +39,25 @@
   FH_WINDOWS = FHDEV (13, 255),
   FH_CLIPBOARD=FHDEV (13, 254),
 
-  FH_PIPE= FHDEV (0, 255),
-  FH_PIPER   = FHDEV (0, 254),
-  FH_PIPEW   = FHDEV (0, 253),
-  FH_FIFO= FHDEV (0, 252),
-  FH_PROC= FHDEV (0, 250),
-  FH_REGISTRY= FHDEV (0, 249),
-  FH_PROCESS = FHDEV (0, 248),
-
-  FH_FS  = FHDEV (0, 247),	/* filesystem based device */
-
-  FH_NETDRIVE= FHDEV (0, 246),
-  FH_DEV = FHDEV (0, 245),
-  FH_PROCNET = FHDEV (0, 244),
-  FH_PROCESSFD = FHDEV (0, 243),
-  FH_PROCSYS = FHDEV (0, 242),
-  FH_PROCSYSVIPC = FHDEV (0,241),
+  /* begin /proc directories */
+  FH_PROC= FHDEV (0, 255),
+  FH_REGISTRY= FHDEV (0, 254),
+  FH_PROCNET = FHDEV (0, 253),
+  FH_PROCESSFD = FHDEV (0, 252),
+  FH_PROCSYS = FHDEV (0, 251),
+  FH_PROCSYSVIPC = FHDEV (0,250),
+
+  FH_PROC_MIN_MINOR = FHDEV (0,200),
+  /* end /proc directories */
+
+  FH_PIPE= FHDEV (0, 199),
+  FH_PIPER   = FHDEV (0, 198),
+  FH_PIPEW   = FHDEV (0, 197),
+  FH_FIFO= FHDEV (0, 196),
+  FH_PROCESS = FHDEV (0, 195),
+  FH_FS  = FHDEV (0, 194),  /* filesystem based device */
+  FH_NETDRIVE= FHDEV (0, 193),
+  FH_DEV = FHDEV (0, 192),
 
   DEV_FLOPPY_MAJOR = 2,
   FH_FLOPPY  = FHDEV (DEV_FLOPPY_MAJOR, 0),
Index: path.h
===
RCS file: /cvs/src/src/winsup/cygwin/path.h,v
retrieving revision 1.155
diff -u -r1.155 path.h
--- path.h	1 Apr 2011 19:48:19 -	1.155
+++ path.h	3 Apr 2011 21:46:44 -
@@ -18,8 +18,7 @@
 #include fcntl.h
 
 #define isproc_dev(devn) \
-  (devn == FH_PROC || devn == FH_REGISTRY || devn == FH_PROCESS || \
-   devn == FH_PROCNET || devn == FH_PROCSYS || devn == FH_PROCSYSVIPC)
+  (devn = FH_PROC_MIN_MINOR  devn = FH_PROC)
 
 #define isprocsys_dev(devn) (devn == FH_PROCSYS)
 


Re: [PATCH] implement /proc/sysvipc/*

2011-04-01 Thread Christopher Faylor
On Fri, Apr 01, 2011 at 12:05:56PM +0200, Corinna Vinschen wrote:
Chris, do you think there's anything speaking against rearranging this
so that the FH_FS and FH_NETDRIVE definitions are separate from the
stuff under /proc?  Or, hang on, we should change all PROC values,
along these lines:

  FH_FS  = FHDEV (0, 247),  /* filesystem based device */
  FH_NETDRIVE= FHDEV (0, 246),
  FH_DEV = FHDEV (0, 245),

  FH_PROC= FHDEV (0, 244),
  FH_REGISTRY= FHDEV (0, 243),
  FH_PROCESS = FHDEV (0, 242),
  FH_PROCNET = FHDEV (0, 241),
  FH_PROCESSFD = FHDEV (0, 240),
  FH_PROCSYS = FHDEV (0, 239),
  FH_PROCSYSVIPC = FHDEV (0, 238),

  FH_PROC_MIN_MINOR = FHDEV (0, 200),  /* Arbitrary value */

Then we can simplify the isproc_dev definition like this:

#define isproc_dev(devn) \
   (devn = FH_PROC_MIN_MINOR  devn = FH_PROC)

Does that sound ok?

Yes.  I was, for a while, trying to keep the device numbers the same as
Linux but I don't think that even applies in this case.

cgf


Re: [PATCH] implement /proc/sysvipc/*

2011-04-01 Thread Corinna Vinschen
On Apr  1 11:34, Christopher Faylor wrote:
 On Fri, Apr 01, 2011 at 12:05:56PM +0200, Corinna Vinschen wrote:
 Chris, do you think there's anything speaking against rearranging this
 so that the FH_FS and FH_NETDRIVE definitions are separate from the
 stuff under /proc?  Or, hang on, we should change all PROC values,
 along these lines:
 
   FH_FS  = FHDEV (0, 247),  /* filesystem based device */
   FH_NETDRIVE= FHDEV (0, 246),
   FH_DEV = FHDEV (0, 245),
 
   FH_PROC= FHDEV (0, 244),
   FH_REGISTRY= FHDEV (0, 243),
   FH_PROCESS = FHDEV (0, 242),
   FH_PROCNET = FHDEV (0, 241),
   FH_PROCESSFD = FHDEV (0, 240),
   FH_PROCSYS = FHDEV (0, 239),
   FH_PROCSYSVIPC = FHDEV (0, 238),
 
   FH_PROC_MIN_MINOR = FHDEV (0, 200),/* Arbitrary value */
 
 Then we can simplify the isproc_dev definition like this:
 
 #define isproc_dev(devn) \
  (devn = FH_PROC_MIN_MINOR  devn = FH_PROC)
 
 Does that sound ok?
 
 Yes.  I was, for a while, trying to keep the device numbers the same as
 Linux but I don't think that even applies in this case.

Cool, thanks.

Yaakov, would you mind to apply youir patch with this change?


Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: [PATCH] implement /proc/sysvipc/*

2011-04-01 Thread Yaakov (Cygwin/X)
On Fri, 2011-04-01 at 12:05 +0200, Corinna Vinschen wrote:
 The definition of isproc_dev starts to get on my nerves.  We have to
 check for six distinct values now.  I think we should really change
 the definition.  Here's what we have in devices.h right now:
 
   FH_PROC= FHDEV (0, 250),
   FH_REGISTRY= FHDEV (0, 249),
   FH_PROCESS = FHDEV (0, 248),
 
   FH_FS  = FHDEV (0, 247),  /* filesystem based device */
 
   FH_NETDRIVE= FHDEV (0, 246),
   FH_DEV = FHDEV (0, 245),
   FH_PROCNET = FHDEV (0, 244),
   FH_PROCESSFD = FHDEV (0, 243),
   FH_PROCSYS = FHDEV (0, 242),
   FH_PROCSYSVIPC = FHDEV (0, 241),
 
 Chris, do you think there's anything speaking against rearranging this
 so that the FH_FS and FH_NETDRIVE definitions are separate from the
 stuff under /proc?  Or, hang on, we should change all PROC values,
 along these lines:
 
   FH_FS  = FHDEV (0, 247),  /* filesystem based device */
   FH_NETDRIVE= FHDEV (0, 246),
   FH_DEV = FHDEV (0, 245),
 
   FH_PROC= FHDEV (0, 244),
   FH_REGISTRY= FHDEV (0, 243),
   FH_PROCESS = FHDEV (0, 242),
   FH_PROCNET = FHDEV (0, 241),
   FH_PROCESSFD = FHDEV (0, 240),
   FH_PROCSYS = FHDEV (0, 239),
   FH_PROCSYSVIPC = FHDEV (0, 238),
 
   FH_PROC_MIN_MINOR = FHDEV (0, 200), /* Arbitrary value */
 
 Then we can simplify the isproc_dev definition like this:
 
 #define isproc_dev(devn) \
   (devn = FH_PROC_MIN_MINOR  devn = FH_PROC)
 
 Does that sound ok?

That would mean that the /proc directories range would be right in the
middle of the major-device-0 range, with non-/proc stuff before and
after.  For the sake of clarity, I would reorder it a bit further to
make FH_PROC and friends to one side of major-0 and everything else to
the other side:

  /* begin /proc directories */
  FH_PROC= FHDEV (0, 255),
  FH_REGISTRY= FHDEV (0, 254),
  FH_PROCNET = FHDEV (0, 253),
  FH_PROCESSFD = FHDEV (0, 252),
  FH_PROCSYS = FHDEV (0, 251),
  FH_PROCSYSVIPC = FHDEV (0,250),

  FH_PROC_MIN_MINOR = FHDEV (0,200),
  /* end /proc directories */

  FH_PIPE= FHDEV (0, 199),
  FH_PIPER   = FHDEV (0, 198),
  FH_PIPEW   = FHDEV (0, 197),
  FH_FIFO= FHDEV (0, 196),
  FH_PROCESS = FHDEV (0, 195),
  FH_FS  = FHDEV (0, 194),  /* filesystem based device */
  FH_NETDRIVE= FHDEV (0, 193),
  FH_DEV = FHDEV (0, 192),

As either way this should be a separate changeset IMHO, I have committed
my patch as is and will follow this up on Sunday.


Yaakov