From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: review 2, was Re: projected date for mount.cifs to support DFS junction points Date: Sun, 13 Jan 2008 19:48:46 +0000 Message-ID: <20080113194846.GB23832@infradead.org> References: <1199988975.7483.3.camel@gn2.draper.com> <524f69650801101228o3639363cp4c9710d747b71ead@mail.gmail.com> <20080111090749.GA14910@infradead.org> <524f69650801110805y56cdbe4nf7587e396b70f32c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , linux-cifs-client@lists.samba.org, sfrench@us.ibm.com, linux-fsdevel To: Steve French Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:38454 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752620AbYAMTss (ORCPT ); Sun, 13 Jan 2008 14:48:48 -0500 Content-Disposition: inline In-Reply-To: <524f69650801110805y56cdbe4nf7587e396b70f32c@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: +struct dfs_info3_param { + int flags; /* DFSREF_REFERRAL_SERVER, DFSREF_STORAGE_SERVER*/ + int PathConsumed; + int server_type; + int ref_flag; + char *path_name; + char *node_name; +}; Please avoid mixed case struct member names. + +static inline void init_dfs_info_param(struct dfs_info3_param *param) +{ + memset(param, 0, sizeof(struct dfs_info3_param)); +} And open-coded memset at the caller would be more readable.. + +static inline void free_dfs_info_param(struct dfs_info3_param *param) +{ + if (param) { + kfree(param->path_name); + kfree(param->node_name); + kfree(param); + } +} This one is completely unused. --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -3879,8 +3879,8 @@ GetInodeNumOut: int CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses, const unsigned char *searchName, - unsigned char **targetUNCs, - unsigned int *number_of_UNC_in_array, + struct dfs_info3_param **targetNode, + unsigned int *number_of_Nodes_in_array, const struct nls_table *nls_codepage, int remap) This function already was huge before the patch and grows even more. Please consider refactoring it into small, readable helpers. + cFYI(1, + ("Decoding GetDFSRefer response BCC: %d Offset %d", + pSMBr->ByteCount, data_offset)); Very strange formatting.. +/* BB: Probably we do not need this function any more. + * Anyway it never worked. May be one day we well need it. + */ int connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, const struct nls_table *nls_codepage, int remap) { + /* Please just remove such dead code entirely. If people want to resurrect it for some reason they still have the git archives.