diff options
author | Gluster Ant <bugzilla-bot@gluster.org> | 2018-09-12 17:52:45 +0530 |
---|---|---|
committer | Nigel Babu <nigelb@redhat.com> | 2018-09-12 17:52:45 +0530 |
commit | e16868dede6455cab644805af6fe1ac312775e13 (patch) | |
tree | 15aebdb4fff2d87cf8a72f836816b3aa634da58d /xlators/nfs/server/src/nfs3-fh.c | |
parent | 45a71c0548b6fd2c757aa2e7b7671a1411948894 (diff) |
Land part 2 of clang-format changes
Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4
Signed-off-by: Nigel Babu <nigelb@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs3-fh.c')
-rw-r--r-- | xlators/nfs/server/src/nfs3-fh.c | 206 |
1 files changed, 103 insertions, 103 deletions
diff --git a/xlators/nfs/server/src/nfs3-fh.c b/xlators/nfs/server/src/nfs3-fh.c index 3feeae39dae..c63f9328f57 100644 --- a/xlators/nfs/server/src/nfs3-fh.c +++ b/xlators/nfs/server/src/nfs3-fh.c @@ -20,167 +20,167 @@ #include "common-utils.h" #include "nfs-messages.h" - int -nfs3_fh_validate (struct nfs3_fh *fh) +nfs3_fh_validate(struct nfs3_fh *fh) { - if (!fh) - return 0; + if (!fh) + return 0; - if (fh->ident[0] != GF_NFSFH_IDENT0) - return 0; + if (fh->ident[0] != GF_NFSFH_IDENT0) + return 0; - if (fh->ident[1] != GF_NFSFH_IDENT1) - return 0; + if (fh->ident[1] != GF_NFSFH_IDENT1) + return 0; - if (fh->ident[2] != GF_NFSFH_IDENT2) - return 0; + if (fh->ident[2] != GF_NFSFH_IDENT2) + return 0; - if (fh->ident[3] != GF_NFSFH_IDENT3) - return 0; + if (fh->ident[3] != GF_NFSFH_IDENT3) + return 0; - return 1; + return 1; } - void -nfs3_fh_init (struct nfs3_fh *fh, struct iatt *buf) +nfs3_fh_init(struct nfs3_fh *fh, struct iatt *buf) { - if ((!fh) || (!buf)) - return; + if ((!fh) || (!buf)) + return; - fh->ident[0] = GF_NFSFH_IDENT0; - fh->ident[1] = GF_NFSFH_IDENT1; - fh->ident[2] = GF_NFSFH_IDENT2; - fh->ident[3] = GF_NFSFH_IDENT3; + fh->ident[0] = GF_NFSFH_IDENT0; + fh->ident[1] = GF_NFSFH_IDENT1; + fh->ident[2] = GF_NFSFH_IDENT2; + fh->ident[3] = GF_NFSFH_IDENT3; - gf_uuid_copy (fh->gfid, buf->ia_gfid); + gf_uuid_copy(fh->gfid, buf->ia_gfid); } - struct nfs3_fh -nfs3_fh_build_indexed_root_fh (xlator_list_t *cl, xlator_t *xl) +nfs3_fh_build_indexed_root_fh(xlator_list_t *cl, xlator_t *xl) { - struct nfs3_fh fh = {{0}, }; - struct iatt buf = {0, }; - uuid_t root = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; - - if ((!cl) || (!xl)) - return fh; + struct nfs3_fh fh = { + {0}, + }; + struct iatt buf = { + 0, + }; + uuid_t root = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + + if ((!cl) || (!xl)) + return fh; - gf_uuid_copy (buf.ia_gfid, root); - nfs3_fh_init (&fh, &buf); - fh.exportid [15] = nfs_xlator_to_xlid (cl, xl); + gf_uuid_copy(buf.ia_gfid, root); + nfs3_fh_init(&fh, &buf); + fh.exportid[15] = nfs_xlator_to_xlid(cl, xl); - return fh; + return fh; } - struct nfs3_fh -nfs3_fh_build_uuid_root_fh (uuid_t volumeid, uuid_t mountid) +nfs3_fh_build_uuid_root_fh(uuid_t volumeid, uuid_t mountid) { - struct nfs3_fh fh = {{0}, }; - struct iatt buf = {0, }; - uuid_t root = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; - - gf_uuid_copy (buf.ia_gfid, root); - nfs3_fh_init (&fh, &buf); - gf_uuid_copy (fh.exportid, volumeid); - gf_uuid_copy (fh.mountid, mountid); - - return fh; + struct nfs3_fh fh = { + {0}, + }; + struct iatt buf = { + 0, + }; + uuid_t root = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + + gf_uuid_copy(buf.ia_gfid, root); + nfs3_fh_init(&fh, &buf); + gf_uuid_copy(fh.exportid, volumeid); + gf_uuid_copy(fh.mountid, mountid); + + return fh; } - int -nfs3_fh_is_root_fh (struct nfs3_fh *fh) +nfs3_fh_is_root_fh(struct nfs3_fh *fh) { - uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; - if (!fh) - return 0; + if (!fh) + return 0; - if (gf_uuid_compare (fh->gfid, rootgfid) == 0) - return 1; + if (gf_uuid_compare(fh->gfid, rootgfid) == 0) + return 1; - return 0; + return 0; } - void -nfs3_fh_to_str (struct nfs3_fh *fh, char *str, size_t len) +nfs3_fh_to_str(struct nfs3_fh *fh, char *str, size_t len) { - char gfid[GF_UUID_BUF_SIZE]; - char exportid[GF_UUID_BUF_SIZE]; - char mountid[GF_UUID_BUF_SIZE]; + char gfid[GF_UUID_BUF_SIZE]; + char exportid[GF_UUID_BUF_SIZE]; + char mountid[GF_UUID_BUF_SIZE]; - if ((!fh) || (!str)) - return; + if ((!fh) || (!str)) + return; - snprintf (str, len, "FH: exportid %s, gfid %s, mountid %s", - uuid_utoa_r (fh->exportid, exportid), - uuid_utoa_r (fh->gfid, gfid), - uuid_utoa_r (fh->mountid, mountid)); + snprintf(str, len, "FH: exportid %s, gfid %s, mountid %s", + uuid_utoa_r(fh->exportid, exportid), uuid_utoa_r(fh->gfid, gfid), + uuid_utoa_r(fh->mountid, mountid)); } void -nfs3_log_fh (struct nfs3_fh *fh) +nfs3_log_fh(struct nfs3_fh *fh) { - char gfidstr[512]; - char exportidstr[512]; + char gfidstr[512]; + char exportidstr[512]; - if (!fh) - return; + if (!fh) + return; - gf_msg_trace ("nfs3-fh", 0, "filehandle: exportid 0x%s, gfid 0x%s", - uuid_utoa_r (fh->exportid, exportidstr), - uuid_utoa_r (fh->gfid, gfidstr)); + gf_msg_trace("nfs3-fh", 0, "filehandle: exportid 0x%s, gfid 0x%s", + uuid_utoa_r(fh->exportid, exportidstr), + uuid_utoa_r(fh->gfid, gfidstr)); } int -nfs3_fh_build_parent_fh (struct nfs3_fh *child, struct iatt *newstat, - struct nfs3_fh *newfh) +nfs3_fh_build_parent_fh(struct nfs3_fh *child, struct iatt *newstat, + struct nfs3_fh *newfh) { - if ((!child) || (!newstat) || (!newfh)) - return -1; + if ((!child) || (!newstat) || (!newfh)) + return -1; - nfs3_fh_init (newfh, newstat); - gf_uuid_copy (newfh->exportid, child->exportid); - return 0; + nfs3_fh_init(newfh, newstat); + gf_uuid_copy(newfh->exportid, child->exportid); + return 0; } int -nfs3_build_fh (inode_t *inode, uuid_t exportid, struct nfs3_fh *newfh) +nfs3_build_fh(inode_t *inode, uuid_t exportid, struct nfs3_fh *newfh) { - if (!newfh || !inode) - return -1; - - newfh->ident[0] = GF_NFSFH_IDENT0; - newfh->ident[1] = GF_NFSFH_IDENT1; - newfh->ident[2] = GF_NFSFH_IDENT2; - newfh->ident[3] = GF_NFSFH_IDENT3; - gf_uuid_copy (newfh->gfid, inode->gfid); - gf_uuid_copy (newfh->exportid, exportid); - /*gf_uuid_copy (newfh->mountid, mountid);*/ - return 0; + if (!newfh || !inode) + return -1; + + newfh->ident[0] = GF_NFSFH_IDENT0; + newfh->ident[1] = GF_NFSFH_IDENT1; + newfh->ident[2] = GF_NFSFH_IDENT2; + newfh->ident[3] = GF_NFSFH_IDENT3; + gf_uuid_copy(newfh->gfid, inode->gfid); + gf_uuid_copy(newfh->exportid, exportid); + /*gf_uuid_copy (newfh->mountid, mountid);*/ + return 0; } int -nfs3_fh_build_child_fh (struct nfs3_fh *parent, struct iatt *newstat, - struct nfs3_fh *newfh) +nfs3_fh_build_child_fh(struct nfs3_fh *parent, struct iatt *newstat, + struct nfs3_fh *newfh) { - if ((!parent) || (!newstat) || (!newfh)) - return -1; + if ((!parent) || (!newstat) || (!newfh)) + return -1; - nfs3_fh_init (newfh, newstat); - gf_uuid_copy (newfh->exportid, parent->exportid); - gf_uuid_copy (newfh->mountid, parent->mountid); - return 0; + nfs3_fh_init(newfh, newstat); + gf_uuid_copy(newfh->exportid, parent->exportid); + gf_uuid_copy(newfh->mountid, parent->mountid); + return 0; } - uint32_t -nfs3_fh_compute_size () +nfs3_fh_compute_size() { - return GF_NFSFH_STATIC_SIZE; + return GF_NFSFH_STATIC_SIZE; } |