skip to main
|
skip to sidebar
Boardash
Boardash me, Major. The space has no more room for cadets.
Tuesday, August 3, 2010
Medical Imaging courses online
Careers in healthcare
Start studying for a degree.
Hello, - found a small bug in the language settings, namely, setting something like 'es' for my-lang-string, would on occasion output the menu item for the last entry starting with 'es', for example 'es_MX', which would show up as 'X]=Gestor de Ventanas', so this patch should fix that. - reduced the code for the 2 file verifying fuctions. - removed (build-saw-menu) as that was a part of the no-longer used (write-saw-menu) - cleaned up the code a bit in general Cheers -- Matthew Love diff --git a/lisp/sawfish/wm/ext/fdo-menu.jl b/lisp/sawfish/wm/ext/fdo-menu.jl index 97dd7f7..67c3187 100644 --- a/lisp/sawfish/wm/ext/fdo-menu.jl +++ b/lisp/sawfish/wm/ext/fdo-menu.jl @@ -1,5 +1,5 @@ ;-*-sawfish-*- -;; (fdo-menu.jl (v0.6.1) --- sawfish wm menu generation -- librep) +;; (fdo-menu.jl (v0.6.5) --- sawfish wm menu generation -- librep) ;; (c) 2009 Matthew Love ;; Christopher Bratusek @@ -84,7 +84,6 @@ Make sure the mk-saw-menu.jl is in your load path (unless batch-mode -; (defun update-vars ;; Some defaults ;;my-comm () ;;my-icon () @@ -116,13 +115,6 @@ Make sure the mk-saw-menu.jl is in your load path (t (append (flatten (car input)) (flatten (cdr input)))))) - ;; Variables that can be set in .sawfish[/]rc - - (if (not (boundp 'desktop-directory)) - (defvar desktop-directory '("/usr/share/applications"))) - - (defvar desk-files (flatten (map-dir-files desktop-directory))) - (defun find-lang-string () (if (getenv "LANG") (if (> (length (getenv "LANG")) 2) @@ -130,6 +122,10 @@ Make sure the mk-saw-menu.jl is in your load path (substring (getenv "LANG") 0 2)) '())) + ;; Variables that can be set in .sawfish[/]rc + (if (not (boundp 'desktop-directory)) + (defvar desktop-directory '("/usr/share/applications"))) + (if (not (boundp 'my-lang-string)) (defvar my-lang-string (find-lang-string))) @@ -148,8 +144,6 @@ Make sure the mk-saw-menu.jl is in your load path (if (not (boundp 'use-fdo-menu)) (defvar use-fdo-menu 't)) -; ) - ;; The Master Category List (defvar menu-cat-alist @@ -191,24 +185,19 @@ Make sure the mk-saw-menu.jl is in your load path (defun desktop-file-p (directory-file) (let ((this-file (open-file directory-file 'read))) (let ((this-line (read-line this-file))) - (if (string= this-line "[Desktop Entry]\012") - 't - '())))) + (string= this-line "[Desktop Entry]\012")))) (defun backup-file-p (input-file-name) - (if (or (string= "~" (substring input-file-name (- (length input-file-name) 1))) - (string= "#" (substring input-file-name 0 1))) - 't - '())) + (or (string= "~" (substring input-file-name (- (length input-file-name) 1))) + (string= "#" (substring input-file-name 0 1)))) ;; Helper for (parse-desk-line) - specifically, for categories. - (defun build-cat-list (line) ;; line must be excluding the \ - ;; categories= part -> (substring line 11) + ;; line must be excluding the categories= part -> (substring line 11) + (defun build-cat-list (line) (if (> (length line) 1) (let ((this-cat (prin1-to-string (read-from-string line)))) (cons this-cat (build-cat-list (substring line (+ 1 (length this-cat)))))))) - ;; Helper function for (fix-cats) (defun fix-sub-cats (cat-list loc-list) (if cat-list @@ -218,7 +207,6 @@ Make sure the mk-saw-menu.jl is in your load path (fix-sub-cats cat-list (remove (assoc cat-val loc-list) loc-list))) (fix-sub-cats (cdr cat-list) loc-list))))) - ;; Second Part of process, after (parse-desktop-file) has run \ ;; through and generated the *loc-menu*. ;; Will run through the Category alist and assign menu values accordingly, and \ @@ -256,7 +244,6 @@ Make sure the mk-saw-menu.jl is in your load path this-cat)) (car cat-list))) - ;; Helper function for (create-menu), which will parse the string input there. ;; Will only give an output for specified lines (i.e. category, name, etc.) (defun parse-desk-line (line desk-value) @@ -268,8 +255,8 @@ Make sure the mk-saw-menu.jl is in your load path my-lang-string (string= desk-value (substring line 0 5)) (string= (substring line 4 5) "[") - (or (string= my-lang-string (substring line 5 (+ (length my-lang-string) 5))) - (string= (substring my-lang-string 0 2) (substring line 5 (+ (length my-lang-string) 5))))) + (string= my-lang-string (substring line 5 (+ (length my-lang-string) 5))) + (string= (substring line (+ (length my-lang-string) 5) (+ (length my-lang-string) 6)) "]")) (substring line (+ 4 (length my-lang-string) 3) (- line-len 1))) ;; this section is for the exec and default name strings @@ -313,18 +300,13 @@ Make sure the mk-saw-menu.jl is in your load path ((parse-desk-line line "NoDisplay=") (setq my-disp (parse-desk-line line "NoDisplay="))))) - ;; Parse a .desktop file into a list suitable for a menu ;; ex. (parse-desktop-file "emacs.desktop") ==> ("Development" "Emacs Text Editor" (system "emacs &")) - (defun parse-desktop-file (desktop-file) (let ((desktop-file-name desktop-file)) - ;;desktop-file-name (if (and (file-exists-p desktop-file-name) (desktop-file-p desktop-file-name) (not (file-directory-p desktop-file-name))) - ;;(not (backup-file-p desktop-file-name)) - ;;(file-regular-p desktop-file-name)) (let ((new-file (open-file desktop-file-name 'read))) (while (setq file-line (read-line new-file)) (create-menu file-line)) @@ -338,10 +320,6 @@ Make sure the mk-saw-menu.jl is in your load path ;;(cons my-cat (cons my-icon (cons my-name (cons my-comm (cons (list 'system (concat my-term-string my-exec)) nil)))))) (setq my-disp ())))))) - ;; Format the menu for sawfish - (defun build-saw-menu (entry) - `(defvar saw-apps-menu ',entry)) - ;; Alphabetize the entries in the category menus (defun alphabetize-entries (saw-menu) (if saw-menu @@ -349,10 +327,11 @@ Make sure the mk-saw-menu.jl is in your load path (sort (cdr (car saw-menu)) string<)) (alphabetize-entries (cdr saw-menu))))) + ;; Update the menu and set it to 'apps-menu (define (update-saw-menu) (unless (not use-fdo-menu) (setq *loc-menu* nil) - (setq desk-files (flatten (map-dir-files desktop-directory))) + (defvar desk-files (flatten (map-dir-files desktop-directory))) (mapc (lambda (x) (setq *loc-menu* (append *loc-menu* (list (parse-desktop-file x))))) desk-files) (if want-alphabetize @@ -360,5 +339,4 @@ Make sure the mk-saw-menu.jl is in your load path (setq apps-menu (fix-cats menu-cat-alist))))) (define-command 'update-saw-menu update-saw-menu) - -)) +)) \ No newline at end of file On Wed, 2010-05-12 at 17:15 -0700, Joe Eykholt wrote: Robert Love wrote: This series represents the continuation of the RFC archived here: http://marc.info/?l=linux-scsi&m=126463466126962&w=2 . The sysfs organization has taken shape and object allocations make more sense than the previous RFC. The patches have undergone my own developer testing, which has mostly focused on NPIV port creation and deletion and some I/O. This series creates a Fibre Channel subsystem that has an improved sysfs device tree (the port's view of the fabric) and begins to abstract itself from SCSI. This RFC is to solicit any feedback before I continue to refine these patches. I've created two diagrams to help people understand the change. The first shows the current sysfs device layout and the second shows the allocation scheme for libfc and fcoe's primary data structures. http://open-fcoe.org/rwlove/fc_sysfs.jpg http://open-fcoe.org/rwlove/libfc_alloc.jpg These patches apply to scsi-misc + the recently submitted fcoe patches, which is the same as the fcoe-next tree on open-fcoe.org. Overview of N_Port creation/login (for fcoe.ko): 1) First, fc.ko is installed and then scsi_transport_fcp.ko is installed. scsi_transport_fcp.ko registers itself (SCSI initiator) as a FC4 with fc.ko. 2) When a fcoe port is "created" from 'echo ethX > /sys/module/fcoe/parameters/create' a fcport is allocated and added to sysfs. All of the port's physical properties are added as attributes. /fcport_0 3) At this point libfc/libfcoe/fcoe needs an lport and an fcoe_port. The lport and fcoe_ports are private data of a fcvport so a fcvport is allocated, but not added to sysfs. 4) libfcoe.ko discovers FCFs and allocates/adds them as fcfabrics to sysfs as they are discovered. [ I think that we may want to revisit the idea of having a fcfport between the fcport and fcfabric. Right now I'm creating a fcfabric for each FCF that is discovered at the FIP phase, but that doesn't make much sense since multiple FCFs on the same fabric can be discovered. Adding a fcfport for each FCF discovered might be more correct. ] /fcport_0/fcfabric_0 5) libfc.ko will FLOGI into the fabric and upon the FLOGI ACC the fcvport will be added to sysfs. /fcport_0/fcfabric_0/fcvport_0 5.1) The FC layer will call fc4_init_add in the fc4_template. If SCSI is the FC4, fcp_init_add (scsi_transport_fcp) will be called. This routine calls scsi_host_alloc/scsi_add_host. There is also a callback down to the LLD so that it can setup any SCSI-FCP private data. [ I'm not sure how non-FCoE HBAs will do this. I imagine they will just create all three sysfs devices (fcport, fcfabric and fcvport) on the FLOGI ACC since they do not rely on a discovery protocol. ] /fcport_0/fcfabric_0/fcvport_0/fcpinit_X/hostX 6) libfc will start discovery and as remote ports are discovered libfc will notify FC to create and add fcrports to sysfs. /fcport_0/fcfabric_0/fcvport_0/fcpinit_X/hostX /fcrport_0 6.1) When the fcrports are created the FC layer will call fc4_targ_add in the fc4_template. If SCSI is the FC4, fcp_targ_add (scsi_transport_fcp) will be called. This routine will allocate a fcptarg device, add it to sysfs and notify SCSI to scan it. /fcport_0/fcfabric_0/fcvport_0/fcpinit_X/hostX /fcrport_0/fcptargX:0-0 The current series shortcomings are: 1) The FC4 interface needs work to become more FC4 agnostic. (end of include/fc/fc.h) 2) Point-to-Point mode needs to be addressed 3) BSG needs to be tested and STGT should become another FC4 that is registered with FC. Since libfc/fcoe doesn't plug into STGT yet this will be a challenge. 4) user space updates - For the fcoe-utils package, libhbalinux (user space HBA API library) needs to be updated to read the new layout before heavy testing of the new layout can be done. 5) Miscellaneous problems like error handling, fcfabric deletion cleaning up vports, using attribute containers / scsi transport style for SCSI-FCP devices, warnings, etc... 6) FCoE attributes... Other thoughts: I would love to collaborate with someone who maintains a HBA that supports native FC since I'm not aware of the specific needs of traditional HBAs. I would hope that this new layout could be added to the kernel (when ready) and the existing FC Transport deprecated as I'm not sure how to get all HBA maintainers to switch their drivers at the same time. I think that only adding FCoE attributes to this layout would be an incentive to get LLDs to migrate. I've tried to keep this covermail brief, so there are plenty of details left out. Please ask if you have a question. Thanks, //Rob Hi Rob, Hi Joe, thanks for taking a look. I'm running the patches and they work OK (very lightly used). I'd prefer we kept the naming in /sys/class shorter and keep underscores after "fc" like we currently have in fc_remote_port. Maybe you could continue to use the existing names where they apply, after getting the other transport code converted. Here are my suggested name changes: fcvport becomes fc_vport fcvport/fcvport_0 becomes fc_vport/0 fcpinit_4 becomes fcp_init4 fcptarg-X:0-1 becomes fcp_targ/1 fcrport:xxx-0 becomes fc_rport/0 (or fc_remote_ports/xxx eventually) fcfabric/fcfabric_0 becomes fc_fabric/0 fcport/fcport_0 becomes fc_port/0 Sure, that sounds reasonable. I think I've got too much fc_fc* stuff in general- device names, function names, etc... When we have local FCP target ports (as opposed to remote ones) how will we represent that? You could include that in the diagram. This is something that I've got to figure out so that I don't lose any existing functionality. I need a way to test whatever scheme is agreed upon and since stgt isn't integrated with libfc/fcoe I'll either need to integrate it or use one of the out-of-tree target infrastructures to create local target ports. When we see remote initiators, how do we show them? Maybe we just don't create anything under fcport_N in that case. The FC layer could create an fc_rport and notify the registered FC4. I haven't really thought out if the SCSI-FCP layer would do anything though. Another related question is if a discovered target is represented by the same device/structure when the host is an initiator or target. The same question applies to discovered initiators. I may have more comments later after I look through the code a bit further. I'm modifying fcc to handle the new trees. Very cool. Let me know when you have it done as I'd love to use it for testing. Minor issues: I noticed that fnic no longer compiles and checkpatch spots some issues, but I'm sure those will be fixed later. Yeah, sorry about fnic. :) I tried to clean up a lot of the checkpatch warnings, many were the result of code moved from scsi_transport_fc, so I tried to clean up all of the issues that I introduced and some of the existing ones. I'll clean up all that stuff once this code matures. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majo ... @vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Newer Post
Older Post
Home
Followers
Blog Archive
►
2024
(16)
►
December
(2)
►
July
(1)
►
June
(2)
►
May
(4)
►
April
(2)
►
March
(1)
►
February
(4)
►
2023
(16)
►
October
(7)
►
September
(1)
►
August
(2)
►
July
(2)
►
June
(2)
►
May
(1)
►
February
(1)
►
2022
(17)
►
November
(3)
►
September
(4)
►
July
(3)
►
June
(1)
►
May
(1)
►
April
(2)
►
March
(3)
►
2021
(157)
►
December
(1)
►
November
(4)
►
July
(22)
►
June
(2)
►
May
(19)
►
April
(28)
►
March
(33)
►
February
(24)
►
January
(24)
►
2020
(302)
►
December
(26)
►
November
(35)
►
October
(29)
►
September
(35)
►
August
(47)
►
July
(25)
►
June
(12)
►
May
(22)
►
April
(14)
►
March
(33)
►
February
(13)
►
January
(11)
►
2019
(200)
►
December
(10)
►
November
(19)
►
October
(17)
►
September
(20)
►
August
(23)
►
July
(24)
►
June
(10)
►
May
(16)
►
April
(22)
►
March
(13)
►
February
(10)
►
January
(16)
►
2018
(227)
►
December
(14)
►
November
(14)
►
October
(22)
►
September
(19)
►
August
(25)
►
July
(10)
►
June
(3)
►
May
(27)
►
April
(32)
►
March
(21)
►
February
(16)
►
January
(24)
►
2017
(221)
►
December
(17)
►
November
(28)
►
October
(35)
►
September
(29)
►
August
(38)
►
July
(4)
►
June
(16)
►
May
(10)
►
April
(14)
►
March
(11)
►
February
(8)
►
January
(11)
►
2016
(106)
►
December
(18)
►
November
(9)
►
October
(9)
►
September
(3)
►
August
(9)
►
July
(11)
►
June
(3)
►
May
(7)
►
April
(16)
►
March
(11)
►
February
(4)
►
January
(6)
►
2015
(147)
►
December
(11)
►
November
(8)
►
October
(16)
►
September
(11)
►
August
(7)
►
July
(18)
►
June
(18)
►
May
(9)
►
April
(13)
►
March
(14)
►
February
(14)
►
January
(8)
►
2014
(135)
►
December
(12)
►
November
(9)
►
October
(11)
►
September
(20)
►
August
(12)
►
July
(13)
►
June
(8)
►
May
(10)
►
April
(12)
►
March
(8)
►
February
(11)
►
January
(9)
►
2013
(140)
►
December
(4)
►
November
(6)
►
October
(25)
►
September
(11)
►
August
(15)
►
July
(12)
►
June
(13)
►
May
(13)
►
April
(7)
►
March
(12)
►
February
(9)
►
January
(13)
►
2012
(91)
►
December
(10)
►
November
(7)
►
October
(11)
►
September
(8)
►
August
(7)
►
July
(6)
►
June
(8)
►
May
(14)
►
April
(6)
►
March
(3)
►
February
(4)
►
January
(7)
►
2011
(364)
►
December
(5)
►
November
(7)
►
October
(15)
►
September
(13)
►
August
(23)
►
July
(45)
►
June
(27)
►
May
(3)
►
April
(12)
►
March
(25)
►
February
(152)
►
January
(37)
▼
2010
(2424)
►
December
(22)
►
November
(24)
►
October
(19)
►
September
(27)
▼
August
(34)
arbcombo -- Presentation and Updated Agenda Posted...
tire-pressure -- Tire Pressure Regulation Approved
Classes are starting soon
Choose From Top Health Insurance Carriers.
Prepare for a healthcare career
cc -- SAVE THE DATE - Climate Action Team (CAT) Me...
arbcombo -- Changes in upcoming diesel workshops
cc -- August 30-31, 2010 -- CAPCOA Climate Change ...
Be successful from home
arbcombo -- Today - Public Meeting on Cap-and-Trad...
View comparisons on coverage
Look to get employed today
arbcombo -- ARB Chair's Seminar Series: Wednesday,...
HeatherN is inviting you to Daceband!
Protect Your Family
Act now to study coding
Fight the criminals as a Forensics Scientist
arbcombo -- Public Workshops to Discuss Revised Em...
arbcombo -- Public Meeting to Discuss Analysis to ...
Compare Health Plans
Don't overlook public sector jobs
arbcombo -- ARB Chair's Seminar Series: Wednesday,...
arbcombo -- ARB Chair's Seminar Series: Tuesday, S...
Be prepared when accidents happen
arbcombo -- ARB Chair's Seminar Series: Wednesday,...
Work as a medical coder
Certified CSI Techs needed
cc -- August 16 AB 32 Environmental Justice Advis...
cc -- August 18 California Carbon Capture and Stor...
Find out the benefits of becoming a Pharmaceutical...
arbcombo -- Delay of Board Hearing to Nov for Cons...
Get the best rates possible
Medical Imaging courses online
Don't Settle for Retail Prices
►
July
(33)
►
June
(36)
►
May
(18)
►
April
(61)
►
March
(749)
►
February
(656)
►
January
(745)
►
2009
(3239)
►
December
(769)
►
November
(724)
►
October
(670)
►
September
(483)
►
August
(250)
►
July
(256)
►
June
(87)
►
2006
(1)
►
December
(1)
About Me
Cadet Boardash
View my complete profile