Bug 764890 (GLUSTER-3158) - Keep code more readable and clean
Summary: Keep code more readable and clean
Keywords:
Status: CLOSED NOTABUG
Alias: GLUSTER-3158
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: ---
Assignee: Amar Tumballi
QA Contact:
URL:
Whiteboard:
: 769691 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-12 09:49 UTC by Amar Tumballi
Modified: 2014-06-13 17:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-17 18:19:37 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Anand Avati 2011-07-12 09:37:16 UTC
PATCH: http://patches.gluster.com/patch/7836 in master (storage/posix: move the helper functions to separate file)

Comment 1 Amar Tumballi 2011-07-12 09:49:17 UTC
Meta bug to keep track of all or most of the below.

1. Add more comments to existing code, where ever the logic is complex
2. Separate out functions into different files based on the tasks (like keep only fops in <xlator-name>.c file, and move helpers to <xlator-name>-helpers.c file.
3. Improve the logging. Let the log serve as the comment in error (negative) code path.
4. Every system call made should be checked for return code and also print 'errno' value (mostly strerror (errno)).
5. No more white-spaces and indexing issues. Follow coding standard properly.

Can be treated as 'logging enhancement - Phase 2'.

Comment 2 Anand Avati 2011-09-05 09:41:25 UTC
CHANGE: http://review.gluster.com/281 (created new files per operations, (or group of operations)) merged in master by Vijay Bellur (vijay)

Comment 3 Anand Avati 2011-09-12 03:24:40 UTC
CHANGE: http://review.gluster.com/329 (Change-Id: I012f78bac8ba82333628c59ef51d5e5f43d05ac7) merged in master by Vijay Bellur (vijay)

Comment 4 Anand Avati 2011-09-19 05:23:56 UTC
CHANGE: http://review.gluster.com/392 (Change-Id: Ia51ffe03c8b94ddfe21c6609bc0d54b5bd29eca7) merged in master by Vijay Bellur (vijay)

Comment 5 Anand Avati 2011-09-23 10:48:35 UTC
CHANGE: http://review.gluster.com/435 (earlier, sub_count was having different meaning depending on the) merged in master by Vijay Bellur (vijay)

Comment 6 Anand Avati 2011-09-29 13:06:59 UTC
CHANGE: http://review.gluster.com/528 (Change-Id: I400e515431cf739fe0b2f90840359496a2b529d2) merged in master by Vijay Bellur (vijay)

Comment 7 Amar Tumballi 2011-10-03 02:12:04 UTC
(In reply to comment #4)
> CHANGE: http://review.gluster.com/549 (now returns 'true(1)' is gfid is root,
> 'false(0)' if not.) merged in master by Vijay Bellur (vijay)

The above commit is for this bug (was added in bug 765250 instead)

Comment 8 Anand Avati 2011-11-16 06:45:28 UTC
CHANGE: http://review.gluster.com/610 (no more backward compatibility between glusterd <-> glusterd) merged in master by Vijay Bellur (vijay)

Comment 9 Anand Avati 2011-11-16 06:46:53 UTC
CHANGE: http://review.gluster.com/718 (earlier only DELETE_VOLUME was having volume name as context, where) merged in master by Vijay Bellur (vijay)

Comment 10 Anand Avati 2011-11-16 06:47:21 UTC
CHANGE: http://review.gluster.com/726 (Change-Id: Ibda7e9d7425ecea8c7c673b42bc9fd3489a3a042) merged in master by Vijay Bellur (vijay)

Comment 11 Anand Avati 2011-11-16 08:43:57 UTC
CHANGE: http://review.gluster.com/734 (* 'GD_OP_RENAME_VOLUME' removed) merged in master by Vijay Bellur (vijay)

Comment 12 Anand Avati 2011-11-23 09:14:52 UTC
CHANGE: http://review.gluster.com/738 (Change-Id: I3a9b3059fd9b918cb32bbe724ae1125fb1f5642a) merged in master by Vijay Bellur (vijay)

Comment 13 Anand Avati 2011-11-23 09:26:26 UTC
CHANGE: http://review.gluster.com/748 (Change-Id: I6126e22694c177d3e2b0b4e98551a9038d5cdacd) merged in master by Vijay Bellur (vijay)

Comment 14 Anand Avati 2011-11-23 09:32:12 UTC
CHANGE: http://review.gluster.com/749 (Change-Id: Ifd560492f93b1a35b36bb663c62b3c427e066caa) merged in master by Vijay Bellur (vijay)

Comment 15 Anand Avati 2011-12-06 07:02:09 UTC
CHANGE: http://review.gluster.com/744 (Change-Id: I653a1cc8123baa36d750250d02721aa98b196f38) merged in master by Vijay Bellur (vijay)

Comment 16 Anand Avati 2012-02-14 09:00:35 UTC
CHANGE: http://review.gluster.com/2742 (protocol: code cleanup) merged in master by Anand Avati (avati)

Comment 17 Amar Tumballi 2012-02-18 11:04:39 UTC
*** Bug 769691 has been marked as a duplicate of this bug. ***

Comment 18 Amar Tumballi 2012-04-17 18:19:37 UTC
Will close this bug for now and re-use it if required. NOTABUG because this is more of an practise and advise :-)

Comment 19 Vijay Bellur 2012-07-04 18:57:07 UTC
CHANGE: http://review.gluster.com/3628 (xlators/protocol: better filename) merged in master by Anand Avati (avati)

Comment 20 Vijay Bellur 2012-07-11 23:30:07 UTC
CHANGE: http://review.gluster.com/3657 (core: remove unused code) merged in master by Anand Avati (avati)

Comment 21 Vijay Bellur 2012-07-12 16:40:14 UTC
CHANGE: http://review.gluster.com/3632 (rpc: variable name changes) merged in master by Anand Avati (avati)

Comment 22 Vijay Bellur 2012-07-12 23:16:43 UTC
CHANGE: http://review.gluster.com/3660 (core: remove the unused files - round 2) merged in master by Anand Avati (avati)

Comment 23 Vijay Bellur 2012-07-19 16:09:46 UTC
CHANGE: http://review.gluster.com/3668 (glusterd: Refactored brickinfo APIs) merged in master by Anand Avati (avati)

Comment 24 Vijay Bellur 2012-08-15 17:39:52 UTC
CHANGE: http://review.gluster.com/3785 (rfc.sh: set 'Change-Id: ' header on first run) merged in master by Anand Avati (avati)

Comment 25 Vijay Bellur 2012-08-23 09:17:52 UTC
CHANGE: http://review.gluster.org/3839 (socket: code cleanup) merged in master by Anand Avati (avati)

Comment 26 Vijay Bellur 2012-10-16 05:43:13 UTC
CHANGE: http://review.gluster.org/4042 (glusterfs: code cleanup) merged in master by Anand Avati (avati)

Comment 27 Vijay Bellur 2012-10-18 06:37:14 UTC
CHANGE: http://review.gluster.org/4091 (glusterfs: add gf_mkostemp api and use it instead of mkostemp of libc) merged in master by Anand Avati (avati)

Comment 28 Vijay Bellur 2012-11-30 08:00:52 UTC
CHANGE: http://review.gluster.org/4235 (build: make dist to capture current build tree state) merged in master by Anand Avati (avati)

Comment 29 Vijay Bellur 2012-12-01 02:04:44 UTC
CHANGE: http://review.gluster.org/4251 (encryption/rot-13: Cleanup trailing whitespaces) merged in master by Anand Avati (avati)

Comment 30 Vijay Bellur 2013-01-29 23:27:43 UTC
CHANGE: http://review.gluster.org/4422 (glusterfs : Moved option files, and statedumps from /tmp) merged in master by Anand Avati (avati)

Comment 31 Vijay Bellur 2013-02-15 07:25:53 UTC
CHANGE: http://review.gluster.org/4510 (glusterfsd: Remove 'top {read,write}-perf' thread) merged in master by Anand Avati (avati)

Comment 32 Vijay Bellur 2013-02-20 02:57:28 UTC
CHANGE: http://review.gluster.org/4544 (code cleanup: remove unused parameter 'dict') merged in master by Anand Avati (avati)

Comment 33 Vijay Bellur 2013-02-20 22:39:13 UTC
CHANGE: http://review.gluster.org/4554 (syncop: Fixed indentation and whitespaces.) merged in master by Anand Avati (avati)

Comment 34 Vijay Bellur 2013-03-18 18:34:40 UTC
CHANGE: http://review.gluster.org/4679 (dht: fix a typo) merged in master by Anand Avati (avati)

Comment 35 Vijay Bellur 2013-03-25 07:27:18 UTC
CHANGE: http://review.gluster.org/4718 (glusterd: Simplify glusterd_service_stop()) merged in master by Anand Avati (avati) 
------
commit 8db38ffbb887e3ba7661b97ebb4ac072f2d0ca8f
Author: Krishnan Parthasarathi <kparthas>
Date:   Mon Mar 25 00:12:52 2013 +0530

    glusterd: Simplify glusterd_service_stop()
    
    Change-Id: I396d250a3299ad1f7fce4bd14389b0c2756b6cb0
    BUG: 764890
    Signed-off-by: Krishnan Parthasarathi <kparthas>
    Reviewed-on: http://review.gluster.org/4718
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Anand Avati <avati>

Comment 36 Anand Avati 2013-05-14 13:37:24 UTC
REVIEW: http://review.gluster.org/5004 (glusterfs: add gf_mkostemp api and use it instead of mkostemp of libc) posted (#1) for review on release-3.3 by Raghavendra Bhat (raghavendra)

Comment 37 Anand Avati 2013-05-14 13:37:47 UTC
REVIEW: http://review.gluster.org/5005 (libglusterfs/statedump: move options file and statedumps from /tmp) posted (#1) for review on release-3.3 by Raghavendra Bhat (raghavendra)

Comment 38 Anand Avati 2013-05-14 16:02:44 UTC
COMMIT: http://review.gluster.org/5004 committed in release-3.3 by Vijay Bellur (vbellur) 
------
commit c59166c5a3306231864fe7d99e383259a9385233
Author: Raghavendra Bhat <raghavendra>
Date:   Tue May 14 11:59:20 2013 +0530

    glusterfs: add gf_mkostemp api and use it instead of mkostemp of libc
    
    Change-Id: Ia3d2f37ae1f7a7d87a75c82bedb4963729d45b6c
    BUG: 764890
    Signed-off-by: Raghavendra Bhat <raghavendra>
    Reviewed-on: http://review.gluster.org/5004
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 39 Anand Avati 2013-05-14 17:48:00 UTC
COMMIT: http://review.gluster.org/5005 committed in release-3.3 by Vijay Bellur (vbellur) 
------
commit 2ee82710c088461cf4d3769625723346345566f9
Author: Raghavendra Bhat <raghavendra>
Date:   Tue May 14 14:00:08 2013 +0530

    libglusterfs/statedump: move options file and statedumps from /tmp
    
    Change-Id: I6b107b9a668b0521b955dba8895cbbeaf9e7cb02
    BUG: 764890
    Signed-off-by: Raghavendra Bhat <raghavendra>
    Reviewed-on: http://review.gluster.org/5005
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 40 Anand Avati 2013-08-14 23:34:09 UTC
REVIEW: http://review.gluster.org/5632 (rfc.sh: Include BUG: header even in first run) posted (#1) for review on master by Anand Avati (avati)

Comment 41 Anand Avati 2013-08-14 23:37:00 UTC
REVIEW: http://review.gluster.org/5633 (rfc.sh: Include BUG: header even in first run) posted (#1) for review on release-3.4 by Anand Avati (avati)

Comment 42 Anand Avati 2013-08-15 05:29:58 UTC
COMMIT: http://review.gluster.org/5632 committed in master by Anand Avati (avati) 
------
commit 3d509b1b5acfe55d003f0ae9b51486247226e16f
Author: Anand Avati <avati>
Date:   Wed Aug 14 16:11:40 2013 -0700

    rfc.sh: Include BUG: header even in first run
    
    Set the commit hook before entiring editor mode. This fixes the
    error where rfc.sh after first clone does not set BUG: header
    
    Change-Id: Ic0e9f2d3f656bc81e29d35556022fbdff2f61225
    BUG: 764890
    Signed-off-by: Anand Avati <avati>
    Reviewed-on: http://review.gluster.org/5632

Comment 43 Anand Avati 2013-08-15 05:30:35 UTC
COMMIT: http://review.gluster.org/5633 committed in release-3.4 by Anand Avati (avati) 
------
commit bc18c15ac128719f1d4ae9c673431dd4d306d26d
Author: Anand Avati <avati>
Date:   Wed Aug 14 16:11:40 2013 -0700

    rfc.sh: Include BUG: header even in first run
    
    Set the commit hook before entiring editor mode. This fixes the
    error where rfc.sh after first clone does not set BUG: header
    
    Change-Id: Ic0e9f2d3f656bc81e29d35556022fbdff2f61225
    BUG: 764890
    Signed-off-by: Anand Avati <avati>
    Reviewed-on: http://review.gluster.org/5633

Comment 44 Anand Avati 2013-08-17 02:31:58 UTC
REVIEW: http://review.gluster.org/5643 (parser: use private namespace 'graphyy' instead of 'yy') posted (#1) for review on master by Anand Avati (avati)

Comment 45 Anand Avati 2013-08-18 18:38:43 UTC
REVIEW: http://review.gluster.org/5646 (rfc.sh: Avoid hardcoding of branch names) posted (#1) for review on master by Vijay Bellur (vbellur)

Comment 46 Anand Avati 2013-08-18 18:39:12 UTC
REVIEW: http://review.gluster.org/5646 (rfc.sh: Avoid hardcoding of branch name.) posted (#2) for review on master by Vijay Bellur (vbellur)

Comment 47 Anand Avati 2013-09-20 18:40:56 UTC
REVIEW: http://review.gluster.org/5643 (parser: use private namespace 'graphyy' instead of 'yy') posted (#2) for review on master by Anand Avati (avati)

Comment 48 Anand Avati 2013-09-21 08:24:01 UTC
REVIEW: http://review.gluster.org/5643 (parser: use private namespace 'graphyy' instead of 'yy') posted (#3) for review on master by Anand Avati (avati)

Comment 49 Anand Avati 2013-09-22 06:45:55 UTC
COMMIT: http://review.gluster.org/5643 committed in master by Anand Avati (avati) 
------
commit eec0e973be78e454665e6fbc645caddf44e362b9
Author: Anand Avati <avati>
Date:   Sat Aug 10 23:10:04 2013 -0700

    parser: use private namespace 'graphyy' instead of 'yy'
    
    This can cause linker errors when accessing glusterfs through
    libgfapi if the caller also uses a parser with 'yy' prefix.
    
    Change-Id: I6544333c47a1f18193741420717c989e4bdea7b1
    BUG: 764890
    Signed-off-by: Anand Avati <avati>
    Reviewed-on: http://review.gluster.org/5643
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Amar Tumballi <amarts>

Comment 50 Anand Avati 2013-09-24 19:00:13 UTC
REVIEW: http://review.gluster.org/5910 (logging: Expose set_log_file_path() in libglusterfs.) posted (#2) for review on master by Anand Avati (avati)

Comment 51 Anand Avati 2013-09-24 19:00:51 UTC
REVIEW: http://review.gluster.org/5909 (logging: Remove multiple definitions of DEFAULT_LOG_FILE_DIRECTORY) posted (#2) for review on master by Anand Avati (avati)

Comment 52 Anand Avati 2013-09-24 19:01:34 UTC
COMMIT: http://review.gluster.org/5909 committed in master by Anand Avati (avati) 
------
commit 848471799236063961eb37cb7bda3cf0e9a6f956
Author: Vijay Bellur <vbellur>
Date:   Fri Sep 13 11:11:41 2013 +0530

    logging: Remove multiple definitions of DEFAULT_LOG_FILE_DIRECTORY
    
    Change-Id: I8d670a228d3c1282aa7d70b151f166d04abc40e5
    BUG: 764890
    Signed-off-by: Vijay Bellur <vbellur>
    Reviewed-on: http://review.gluster.org/5909
    Reviewed-by: Anand Avati <avati>
    Tested-by: Anand Avati <avati>

Comment 53 Anand Avati 2013-09-24 19:02:17 UTC
COMMIT: http://review.gluster.org/5910 committed in master by Anand Avati (avati) 
------
commit aa971f439d6eef9e52091915ce7ab1127aac1368
Author: Vijay Bellur <vbellur>
Date:   Fri Sep 13 15:20:45 2013 +0530

    logging: Expose set_log_file_path() in libglusterfs.
    
    This patch also changes the behavior of glfs_set_logging().
    If logfile argument is not provided to glfs_set_logging(),
    libgfapi uses set_log_file_path() to create a logfile.
    
    Change-Id: I49ec66c7f16f5604ff2f7cf7b365b08a05b5460d
    BUG: 764890
    Signed-off-by: Vijay Bellur <vbellur>
    Reviewed-on: http://review.gluster.org/5910
    Reviewed-by: Anand Avati <avati>
    Tested-by: Anand Avati <avati>

Comment 54 Anand Avati 2014-06-12 07:13:00 UTC
REVIEW: http://review.gluster.org/8043 (cleanup: Fix domain in log message) posted (#1) for review on master by Krutika Dhananjay (kdhananj)

Comment 55 Anand Avati 2014-06-12 07:16:54 UTC
REVIEW: http://review.gluster.org/8044 (cleanup: Fix order of arguments passed in log message) posted (#1) for review on master by Krutika Dhananjay (kdhananj)

Comment 56 Anand Avati 2014-06-13 02:51:26 UTC
COMMIT: http://review.gluster.org/8043 committed in master by Vijay Bellur (vbellur) 
------
commit 21f2e1705af7d9330021c4e4f55f21f39b949634
Author: Krutika Dhananjay <kdhananj>
Date:   Thu Jun 12 12:42:05 2014 +0530

    cleanup: Fix domain in log message
    
    Change-Id: I554b9bcacf6c8acd6dffea0a485fc50e82c3dc04
    BUG: 764890
    Signed-off-by: Krutika Dhananjay <kdhananj>
    Reviewed-on: http://review.gluster.org/8043
    Reviewed-by: Vijay Bellur <vbellur>
    Tested-by: Gluster Build System <jenkins.com>

Comment 57 Anand Avati 2014-06-13 17:42:49 UTC
COMMIT: http://review.gluster.org/8044 committed in master by Vijay Bellur (vbellur) 
------
commit 56438208c8ada12f878e0317c587a3642bf1a3a0
Author: Krutika Dhananjay <kdhananj>
Date:   Thu Jun 12 12:45:26 2014 +0530

    cleanup: Fix order of arguments passed in log message
    
    Change-Id: Iae85cdfc223875688ea17155fffcf2a3a435d245
    BUG: 764890
    Signed-off-by: Krutika Dhananjay <kdhananj>
    Reviewed-on: http://review.gluster.org/8044
    Reviewed-by: Vijay Bellur <vbellur>
    Tested-by: Gluster Build System <jenkins.com>


Note You need to log in before you can comment on or make changes to this bug.