#!/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/usr/sbin/cluster/cspoc/utilities/cllsjfs2.sh 1.4 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2001,2010 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)37        1.4  src/43haes/usr/sbin/cluster/cspoc/utilities/cllsjfs2.sh, hacmp.cspoc, 61haes_r714 11/2/10 21:03:28
#
# Function:
#
#   Return the 'lsfs -c' output for a given file system.
#
# Arguments:
#
#   File system name
#
#   cllsjfs2 <file system name>
#
# Return Values:
#       0       success
#       1       failure
#
#
###############################################################################

FS_name=$1				# pick up the passed file system name

#
:   Pick up the file system type - JFS or JFS2
#
VFS_type=$(lsfs -c $FS_name | tail +2 | cut -f3 -d':')

#
:   Get log information
#
loglv=$(grep -p $FS_name /etc/filesystems | sed -n '/log.*=/s/^.*= \([^ ]*\).*/\1/p')
loglv=$(basename $loglv)

#
:   Run the appropriate list command, appending log lv to the end
#
header=""
ls${VFS_type} $FS_name | while read line 
    do
	if [[ -z $header ]]
	then
	    header="${line}:loglv"
	    print $header
	else
	    print "${line}${loglv}:"
	fi
    done

