X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fliblustre%2Flutil.c;fp=lustre%2Fliblustre%2Flutil.c;h=0de50cf72c56e3c68bdce0b4f14ef78d173aa2da;hp=1a832bba8c118841bcbc045c94abf083b127be1a;hb=14c1444535f2474268741795fabcec8541741f31;hpb=6b2cd6118cdf245dd3d32318b913431ebcaf0d28 diff --git a/lustre/liblustre/lutil.c b/lustre/liblustre/lutil.c index 1a832bb..0de50cf 100644 --- a/lustre/liblustre/lutil.c +++ b/lustre/liblustre/lutil.c @@ -228,6 +228,34 @@ int liblustre_init_current(char *comm) return 0; } +void cfs_cap_raise(cfs_cap_t cap) +{ + current->cap_effective |= (1 << cap); +} + +void cfs_cap_lower(cfs_cap_t cap) +{ + current->cap_effective &= ~(1 << cap); +} + +int cfs_cap_raised(cfs_cap_t cap) +{ + return current->cap_effective & (1 << cap); +} + +cfs_cap_t cfs_curproc_cap_pack(void) { + return cfs_current()->cap_effective; +} + +void cfs_curproc_cap_unpack(cfs_cap_t cap) { + cfs_current()->cap_effective = cap; +} + +int cfs_capable(cfs_cap_t cap) +{ + return cfs_cap_raised(cap); +} + int init_lib_portals() { int rc;