diff options
author | Martin Brandenburg <martin@omnibond.com> | 2016-03-05 13:17:39 -0500 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2016-03-09 13:26:39 -0500 |
commit | acfcbaf1925f2dc5c46c61de69d756dec92a2ff8 (patch) | |
tree | d5b70201feb5d7e2ab640435703285405f9f1808 /fs/orangefs | |
parent | c62da5853de5564e367932185500f96ab70a6f7c (diff) |
orangefs: make fs_mount_pending static
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs')
-rw-r--r-- | fs/orangefs/devorangefs-req.c | 76 | ||||
-rw-r--r-- | fs/orangefs/orangefs-kernel.h | 1 |
2 files changed, 38 insertions, 39 deletions
diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c index 0f9a12ac7458..12ea8730aa5d 100644 --- a/fs/orangefs/devorangefs-req.c +++ b/fs/orangefs/devorangefs-req.c | |||
@@ -74,6 +74,44 @@ static struct orangefs_kernel_op_s *orangefs_devreq_remove_op(__u64 tag) | |||
74 | return NULL; | 74 | return NULL; |
75 | } | 75 | } |
76 | 76 | ||
77 | /* Returns whether any FS are still pending remounted */ | ||
78 | static int mark_all_pending_mounts(void) | ||
79 | { | ||
80 | int unmounted = 1; | ||
81 | struct orangefs_sb_info_s *orangefs_sb = NULL; | ||
82 | |||
83 | spin_lock(&orangefs_superblocks_lock); | ||
84 | list_for_each_entry(orangefs_sb, &orangefs_superblocks, list) { | ||
85 | /* All of these file system require a remount */ | ||
86 | orangefs_sb->mount_pending = 1; | ||
87 | unmounted = 0; | ||
88 | } | ||
89 | spin_unlock(&orangefs_superblocks_lock); | ||
90 | return unmounted; | ||
91 | } | ||
92 | |||
93 | /* | ||
94 | * Determine if a given file system needs to be remounted or not | ||
95 | * Returns -1 on error | ||
96 | * 0 if already mounted | ||
97 | * 1 if needs remount | ||
98 | */ | ||
99 | static int fs_mount_pending(__s32 fsid) | ||
100 | { | ||
101 | int mount_pending = -1; | ||
102 | struct orangefs_sb_info_s *orangefs_sb = NULL; | ||
103 | |||
104 | spin_lock(&orangefs_superblocks_lock); | ||
105 | list_for_each_entry(orangefs_sb, &orangefs_superblocks, list) { | ||
106 | if (orangefs_sb->fs_id == fsid) { | ||
107 | mount_pending = orangefs_sb->mount_pending; | ||
108 | break; | ||
109 | } | ||
110 | } | ||
111 | spin_unlock(&orangefs_superblocks_lock); | ||
112 | return mount_pending; | ||
113 | } | ||
114 | |||
77 | static int orangefs_devreq_open(struct inode *inode, struct file *file) | 115 | static int orangefs_devreq_open(struct inode *inode, struct file *file) |
78 | { | 116 | { |
79 | int ret = -EINVAL; | 117 | int ret = -EINVAL; |
@@ -449,44 +487,6 @@ Enomem: | |||
449 | goto wakeup; | 487 | goto wakeup; |
450 | } | 488 | } |
451 | 489 | ||
452 | /* Returns whether any FS are still pending remounted */ | ||
453 | static int mark_all_pending_mounts(void) | ||
454 | { | ||
455 | int unmounted = 1; | ||
456 | struct orangefs_sb_info_s *orangefs_sb = NULL; | ||
457 | |||
458 | spin_lock(&orangefs_superblocks_lock); | ||
459 | list_for_each_entry(orangefs_sb, &orangefs_superblocks, list) { | ||
460 | /* All of these file system require a remount */ | ||
461 | orangefs_sb->mount_pending = 1; | ||
462 | unmounted = 0; | ||
463 | } | ||
464 | spin_unlock(&orangefs_superblocks_lock); | ||
465 | return unmounted; | ||
466 | } | ||
467 | |||
468 | /* | ||
469 | * Determine if a given file system needs to be remounted or not | ||
470 | * Returns -1 on error | ||
471 | * 0 if already mounted | ||
472 | * 1 if needs remount | ||
473 | */ | ||
474 | int fs_mount_pending(__s32 fsid) | ||
475 | { | ||
476 | int mount_pending = -1; | ||
477 | struct orangefs_sb_info_s *orangefs_sb = NULL; | ||
478 | |||
479 | spin_lock(&orangefs_superblocks_lock); | ||
480 | list_for_each_entry(orangefs_sb, &orangefs_superblocks, list) { | ||
481 | if (orangefs_sb->fs_id == fsid) { | ||
482 | mount_pending = orangefs_sb->mount_pending; | ||
483 | break; | ||
484 | } | ||
485 | } | ||
486 | spin_unlock(&orangefs_superblocks_lock); | ||
487 | return mount_pending; | ||
488 | } | ||
489 | |||
490 | /* | 490 | /* |
491 | * NOTE: gets called when the last reference to this device is dropped. | 491 | * NOTE: gets called when the last reference to this device is dropped. |
492 | * Using the open_access_count variable, we enforce a reference count | 492 | * Using the open_access_count variable, we enforce a reference count |
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index c045c0b89507..045e493ab033 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h | |||
@@ -523,7 +523,6 @@ int orangefs_dev_init(void); | |||
523 | void orangefs_dev_cleanup(void); | 523 | void orangefs_dev_cleanup(void); |
524 | int is_daemon_in_service(void); | 524 | int is_daemon_in_service(void); |
525 | bool __is_daemon_in_service(void); | 525 | bool __is_daemon_in_service(void); |
526 | int fs_mount_pending(__s32 fsid); | ||
527 | 526 | ||
528 | /* | 527 | /* |
529 | * defined in orangefs-utils.c | 528 | * defined in orangefs-utils.c |