sm-notify: Added -f flag to nfs.conf parsing
Subsystems (2)
PATCH 1/1 sm-notify: Added -f flag to nfs.conf parsing
Cleaned up the nfs.conf parsing and added the setting of the force to the nfs.conf parsing
Signed-off-by Steve Dickson <[email protected]>
--- nfs.conf | 1 + utils/statd/sm-notify.c | 33 +++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-)
nfs.conf +1 -0
@@ -65,6 +65,7 @@ # [sm-notify] # debug=0 +# force=0 # retry-time=900 # outgoing-port= # outgoing-addr=
utils/statd/sm-notify.c +21 -12
@@ -49,6 +49,7 @@#define NLM_END_GRACE_FILE "/proc/fs/lockd/nlm_end_grace"int lift_grace =1 ; +int force =0 ;struct nsm_host {struct nsm_host * next;
@@ -480,19 +481,10 @@ nsm_lift_grace_period(void)close (fd);return ; } - -int -main (int argc,char **argv) +inline static void +read_nfs_conf (char **argv) { -int c, sock, force =0 ; -char * progname; -char * s; - - progname =strrchr (argv[0 ],'/' ); -if (progname !=NULL ) - progname++; -else - progname = argv[0 ]; +char *s;conf_init_file (NFS_CONFFILE );xlog_from_conffile ("sm-notify" );
@@ -500,10 +492,27 @@ main(int argc, char **argv) opt_srcport =conf_get_str ("sm-notify" ,"outgoing-port" ); opt_srcaddr =conf_get_str ("sm-notify" ,"outgoing-addr" ); lift_grace =conf_get_bool ("sm-notify" ,"lift-grace" , lift_grace); + s =conf_get_str ("statd" ,"state-directory-path" );if (s && !nsm_setup_pathnames (argv[0 ], s))exit (1 ); opt_update_state =conf_get_bool ("sm-notify" ,"update-state" , opt_update_state); + force =conf_get_bool ("sm-notify" ,"force" , force); +} + +int +main (int argc,char **argv) +{ +int c, sock; +char * progname; + + progname =strrchr (argv[0 ],'/' ); +if (progname !=NULL ) + progname++; +else + progname = argv[0 ]; + +read_nfs_conf (argv);while ((c =getopt (argc, argv,"dm:np:v:P:f" )) !=-1 ) {switch (c) {
Signature · 1 line
2.20.1
Quoted 4 lines · Steve Dickson
Cleaned up the nfs.conf parsing and added the setting of the force to the nfs.conf parsing
Signed-off-by Steve Dickson <[email protected]>
Committed...
steved.
Quoted 81 lines
--- nfs.conf | 1 + utils/statd/sm-notify.c | 33 +++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-)nfs.conf +1
-0@@ -65,6 +65,7 @@ # [sm-notify] # debug=0 +# force=0 # retry-time=900 # outgoing-port= # outgoing-addr=utils/statd/sm-notify.c +21
-12@@ -49,6 +49,7 @@#define NLM_END_GRACE_FILE "/proc/fs/lockd/nlm_end_grace"int lift_grace =1 ; +int force =0 ;struct nsm_host {struct nsm_host * next;@@ -480,19 +481,10 @@ nsm_lift_grace_period(void)close (fd);return ; } - -int -main (int argc,char **argv) +inline static void +read_nfs_conf (char **argv) { -int c, sock, force =0 ; -char * progname; -char * s; - - progname =strrchr (argv[0 ],'/' ); -if (progname !=NULL ) - progname++; -else - progname = argv[0 ]; +char *s;conf_init_file (NFS_CONFFILE );xlog_from_conffile ("sm-notify" );@@ -500,10 +492,27 @@ main(int argc, char **argv) opt_srcport =conf_get_str ("sm-notify" ,"outgoing-port" ); opt_srcaddr =conf_get_str ("sm-notify" ,"outgoing-addr" ); lift_grace =conf_get_bool ("sm-notify" ,"lift-grace" , lift_grace); + s =conf_get_str ("statd" ,"state-directory-path" );if (s && !nsm_setup_pathnames (argv[0 ], s))exit (1 ); opt_update_state =conf_get_bool ("sm-notify" ,"update-state" , opt_update_state); + force =conf_get_bool ("sm-notify" ,"force" , force); +} + +int +main (int argc,char **argv) +{ +int c, sock; +char * progname; + + progname =strrchr (argv[0 ],'/' ); +if (progname !=NULL ) + progname++; +else + progname = argv[0 ]; + +read_nfs_conf (argv);while ((c =getopt (argc, argv,"dm:np:v:P:f" )) !=-1 ) {switch (c) {