Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
debian-packages
lustre-release
Commits
5cb9bb2f
Commit
5cb9bb2f
authored
21 years ago
by
Phil Schwan
Browse files
Options
Downloads
Patches
Plain Diff
b=2225 fix obd_self_export issues
parent
5597015a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lustre/obdclass/genops.c
+21
-17
21 additions, 17 deletions
lustre/obdclass/genops.c
with
21 additions
and
17 deletions
lustre/obdclass/genops.c
+
21
−
17
View file @
5cb9bb2f
...
...
@@ -82,14 +82,14 @@ struct obd_type *class_get_type(char *name)
}
#endif
if
(
type
)
__MOD_INC_USE_COUNT
(
type
->
typ_ops
->
o_owner
);
try_module_get
(
type
->
typ_ops
->
o_owner
);
return
type
;
}
void
class_put_type
(
struct
obd_type
*
type
)
{
LASSERT
(
type
);
__MOD_DEC_USE_COUNT
(
type
->
typ_ops
->
o_owner
);
module_put
(
type
->
typ_ops
->
o_owner
);
}
int
class_register_type
(
struct
obd_ops
*
ops
,
struct
lprocfs_vars
*
vars
,
...
...
@@ -296,7 +296,10 @@ struct obd_device *class_conn2obd(struct lustre_handle *conn)
struct
obd_import
*
class_conn2cliimp
(
struct
lustre_handle
*
conn
)
{
return
class_conn2obd
(
conn
)
->
u
.
cli
.
cl_import
;
struct
obd_device
*
obd
=
class_conn2obd
(
conn
);
if
(
obd
==
NULL
)
return
NULL
;
return
obd
->
u
.
cli
.
cl_import
;
}
struct
obd_import
*
class_conn2ldlmimp
(
struct
lustre_handle
*
conn
)
...
...
@@ -329,6 +332,7 @@ struct obd_export *class_export_get(struct obd_export *exp)
void
class_export_put
(
struct
obd_export
*
exp
)
{
ENTRY
;
LASSERT
(
exp
!=
NULL
);
LASSERT
(
exp
);
CDEBUG
(
D_INFO
,
"PUTting export %p : new refcount %d
\n
"
,
exp
,
...
...
@@ -357,18 +361,18 @@ void class_export_put(struct obd_export *exp)
EXIT
;
}
struct
obd_export
*
class_new_export
(
struct
obd_device
*
obd
dev
)
struct
obd_export
*
class_new_export
(
struct
obd_device
*
obd
)
{
struct
obd_export
*
export
;
OBD_ALLOC
(
export
,
sizeof
(
*
export
));
if
(
!
export
)
{
CERROR
(
"no memory! (minor %d)
\n
"
,
obd
dev
->
obd_minor
);
CERROR
(
"no memory! (minor %d)
\n
"
,
obd
->
obd_minor
);
return
NULL
;
}
atomic_set
(
&
export
->
exp_refcount
,
2
);
export
->
exp_obd
=
obd
dev
;
export
->
exp_obd
=
obd
;
/* XXX this should be in LDLM init */
INIT_LIST_HEAD
(
&
export
->
exp_ldlm_data
.
led_held_locks
);
...
...
@@ -376,12 +380,12 @@ struct obd_export *class_new_export(struct obd_device *obddev)
class_handle_hash
(
&
export
->
exp_handle
,
export_handle_addref
);
spin_lock_init
(
&
export
->
exp_lock
);
spin_lock
(
&
obd
dev
->
obd_dev_lock
);
LASSERT
(
!
obd
dev
->
obd_stopping
);
/* shouldn't happen, but might race */
atomic_inc
(
&
obd
dev
->
obd_refcount
);
spin_lock
(
&
obd
->
obd_dev_lock
);
LASSERT
(
!
obd
->
obd_stopping
);
/* shouldn't happen, but might race */
atomic_inc
(
&
obd
->
obd_refcount
);
list_add
(
&
export
->
exp_obd_chain
,
&
export
->
exp_obd
->
obd_exports
);
export
->
exp_obd
->
obd_num_exports
++
;
spin_unlock
(
&
obd
dev
->
obd_dev_lock
);
spin_unlock
(
&
obd
->
obd_dev_lock
);
return
export
;
}
...
...
@@ -474,11 +478,11 @@ void class_destroy_import(struct obd_import *import)
/* a connection defines an export context in which preallocation can
be managed. */
int
class_connect
(
struct
lustre_handle
*
exporth
,
struct
obd_device
*
obd
,
int
class_connect
(
struct
lustre_handle
*
conn
,
struct
obd_device
*
obd
,
struct
obd_uuid
*
cluuid
)
{
struct
obd_export
*
export
;
LASSERT
(
exporth
!=
NULL
);
LASSERT
(
conn
!=
NULL
);
LASSERT
(
obd
!=
NULL
);
LASSERT
(
cluuid
!=
NULL
);
...
...
@@ -486,17 +490,17 @@ int class_connect(struct lustre_handle *exporth, struct obd_device *obd,
if
(
export
==
NULL
)
return
-
ENOMEM
;
exporth
->
cookie
=
export
->
exp_handle
.
h_cookie
;
conn
->
cookie
=
export
->
exp_handle
.
h_cookie
;
memcpy
(
&
export
->
exp_client_uuid
,
cluuid
,
sizeof
(
export
->
exp_client_uuid
));
class_export_put
(
export
);
CDEBUG
(
D_IOCTL
,
"connect: client %s, cookie "
LPX64
"
\n
"
,
cluuid
->
uuid
,
exporth
->
cookie
);
cluuid
->
uuid
,
conn
->
cookie
);
return
0
;
}
int
class_disconnect
(
struct
lustre_handle
*
conn
,
int
f
ailover
)
int
class_disconnect
(
struct
lustre_handle
*
conn
,
int
f
lags
)
{
struct
obd_export
*
export
=
class_conn2export
(
conn
);
ENTRY
;
...
...
@@ -515,7 +519,7 @@ int class_disconnect(struct lustre_handle *conn, int failover)
RETURN
(
0
);
}
void
class_disconnect_exports
(
struct
obd_device
*
obd
,
int
f
ailover
)
void
class_disconnect_exports
(
struct
obd_device
*
obd
,
int
f
lags
)
{
int
rc
;
struct
list_head
*
tmp
,
*
n
,
work_list
;
...
...
@@ -536,7 +540,7 @@ void class_disconnect_exports(struct obd_device *obd, int failover)
class_export_get
(
exp
);
fake_conn
.
cookie
=
exp
->
exp_handle
.
h_cookie
;
rc
=
obd_disconnect
(
&
fake_conn
,
f
ailover
);
rc
=
obd_disconnect
(
&
fake_conn
,
f
lags
);
/* exports created from last_rcvd data, and "fake"
exports created by lctl don't have an import */
if
(
exp
->
exp_ldlm_data
.
led_import
!=
NULL
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment